# Simulation test camera with single chip with single cell

# How to identify this type
RULE	METADATA
	ORIGIN	STR		ESO
	NAXIS			S32	2
END

# How to read this data
FILE	METADATA
	PHU		STR	CHIP		# The FITS file represents an entire FPA
	EXTENSIONS	STR	NONE		# There are no extensions
	FPA.OBS		STR	ORIGIN		# A PHU keyword for unique FPA identifier
	CONTENT		STR	EXTNAME 	# Key to the CONTENTS menu
	CONTENT.RULE	STR	{CHIP.NAME}	# How to derive the CONTENT when writing
END

# What's in the FITS file?
CONTENTS	METADATA
	# File identifier with corresponding file layout name
	WIN1.CHIP1.OUT1		STR	Chip51:Chip
	WIN1.CHIP2.OUT1		STR	Chip52:Chip
	WIN1.CHIP3.OUT1		STR	Chip53:Chip
	WIN1.CHIP4.OUT1		STR	Chip54:Chip
	WIN1.CHIP5.OUT1		STR	Chip55:Chip
	WIN1.CHIP6.OUT1		STR	Chip56:Chip
	WIN1.CHIP7.OUT1		STR	Chip57:Chip
	WIN1.CHIP8.OUT1		STR	Chip58:Chip
END

# Specify the layout
CHIPS	METADATA
	Chip		STR		Cell00:Cell
END


# Specify the cell data
CELLS	METADATA
	Cell		METADATA
		CELL.TRIMSEC.SOURCE	STR	VALUE
		CELL.TRIMSEC				STR	[49:2094,1:4098]
		CELL.BIASSEC.SOURCE	STR	VALUE
		CELL.BIASSEC				STR	[1:48,1:4098]
	END
END

# How to translate PS concepts into FITS headers
TRANSLATION	METADATA
	FPA.TELESCOPE		STR		TELESCOP
	FPA.INSTRUMENT	STR		INSTRUME
	FPA.OBSTYPE			STR		IMAGETYPE
	FPA.AIRMASS			STR		AIRMASS
	FPA.FILTER			STR		FILTER1
	FPA.FILTERID		STR		FILTER1
	FPA.RA					STR		RA
	FPA.DEC					STR		DEC
	FPA.OBJECT			STR		OBJECT
	FPA.TIME				STR		MJD-OBS
	FPA.EXPOSURE		STR		EXPTIME
	CELL.EXPOSURE		STR		EXPTIME
	CELL.DARKTIME		STR		EXPTIME
	CELL.TIME				STR		MJD-OBS
	#CELL.XBIN			STR		XBIN
	#CELL.YBIN			STR		YBIN
END

# Default PS concepts that may be specified by value
DEFAULTS	METADATA
	FPA.DETECTOR		STR		WFI
	FPA.TIMESYS			STR		UTC
	FPA.RADECSYS		STR		ICRS
	CELL.SATURATION	F32		65535
	CELL.BAD				F32		0
	CELL.READDIR		S32		1
	CELL.TIMESYS		STR		UTC
	CELL.XPARITY		S32		1
	CELL.YPARITY		S32		1
	CHIP.XPARITY		S32		1
	CHIP.YPARITY		S32		1
	CELL.X0					S32   0
	CELL.Y0					S32   0
	CHIP.X0.DEPEND	STR	CHIP.NAME
	CHIP.X0		METADATA
		Chip50	S32	1
		Chip51	S32	2047
		Chip52	S32	4093
		Chip53	S32	6138
		Chip54	S32	1
		Chip55	S32	2047
		Chip56	S32	4093
		Chip57	S32	6138
	END
	CHIP.Y0.DEPEND	STR	CHIP.NAME
	CHIP.Y0		METADATA
		Chip50	S32	8196
		Chip51	S32	8196
		Chip52	S32	8196
		Chip53	S32	8196
		Chip54	S32	1
		Chip55	S32	1
		Chip56	S32	1
		Chip57	S32	1
	END
	CELL.XSIZE			S32	2142
	CELL.YSIZE			S32	4128
	CELL.XWINDOW		S32	0
	CELL.YWINDOW		S32	0
	CELL.GAIN				F32	2.0
	CELL.READNOISE	F32	3.0
END

FORMATS		METADATA
	FPA.RA		STR	HOURS
	FPA.DEC		STR	DEGREES
	FPA.TIME	STR	MJD
	CELL.TIME	STR	MJD
END
