# Simulation test camera with single chip with single cell

# How to identify this type
RULE	METADATA
	TELESCOP	STR	MPI-2.2
	INSTRUME	STR	WFI
	NAXIS		S32	0
END

# How to read this data
FILE	METADATA
	PHU		STR		FPA		# The FITS file represents an entire FPA
	EXTENSIONS	STR		CHIP		# There are no extensions
	FPA.OBS		STR		ESO OBS NAME	# A PHU keyword for unique FPA identifier
END

# What's in the FITS file?
CONTENTS	METADATA
	# Extension name ---> chip_name:chip_type
	WIN1.CHIP1.OUT1		STR		Chip50:WFIChip
	WIN1.CHIP2.OUT1		STR		Chip51:WFIChip
	WIN1.CHIP3.OUT1		STR		Chip52:WFIChip
	WIN1.CHIP4.OUT1		STR		Chip53:WFIChip
	WIN1.CHIP5.OUT2		STR		Chip54:WFIChip
	WIN1.CHIP6.OUT1		STR		Chip55:WFIChip
	WIN1.CHIP7.OUT1		STR		Chip56:WFIChip
	WIN1.CHIP8.OUT1		STR		Chip57:WFIChip
END

# Specify the layout
CHIPS	METADATA
	# Chip type ---> cell_name:cell_type
	WFIChip		STR	Cell00:WFICell
END


# Specify the cell data
CELLS	METADATA
	WFICell		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		IMAGETYP
	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
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.XBIN		S32		1
	CELL.YBIN		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	DEGREES
	FPA.DEC		STR	DEGREES
	FPA.TIME	STR	MJD
	CELL.TIME	STR	MJD
END
