# Simulation test camera with single chip with single cell

# How to identify this type
RULE	METADATA
	TELESCOP	STR	SimScope
	INSTRUME	STR	SIMMOSAIC
	FORMAT		STR	TOGETHER
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.NAME	STR	FPANAME		# A PHU keyword for unique FPA identifier
	CONTENT	        STR     CHIPNAME	# How to determine content of FITS file
END

# What's in the FITS file?
CONTENTS	METADATA
	# Extension name ---> chip_name:chip_type
	Chip00		STR	Chip00:SimChip
	Chip01		STR	Chip01:SimChip
	Chip10		STR	Chip10:SimChip
	Chip11		STR	Chip11:SimChip
END

# Specify the layout
CHIPS	METADATA
	# Chip type ---> cell_name:cell_type
	SimChip		STR	Cell00:SimCell Cell01:SimCell Cell10:SimCell Cell11:SimCell
END


# Specify the cell data
CELLS	METADATA
	SimCell		METADATA
		CELL.TRIMSEC.SOURCE	STR	HEADER
		CELL.TRIMSEC		STR	TRIMSEC
		CELL.BIASSEC.SOURCE	STR	HEADER
		CELL.BIASSEC		STR	BIASSEC
	END
END

# How to translate PS concepts into FITS headers
TRANSLATION	METADATA
	FPA.TELESCOPE	STR	TELESCOP
	FPA.INSTRUMENT	STR	INSTRUME
	FPA.OBSTYPE	STR	OBSTYPE
	FPA.AIRMASS	STR	AIRMASS
	FPA.FILTER	STR	FILTER
	FPA.FILTERID	STR	FILTER
	FPA.POSANGLE	STR	POSANGLE
	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	DARKTIME
	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	SIMMOSAIC
	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.DEPEND	STR	CELL.NAME
	CELL.X0		METADATA
		Cell00	S32	0
		Cell01	S32	0
		Cell10	S32	1024
		Cell11	S32	1024
	END
	CELL.Y0.DEPEND	STR	CELL.NAME
	CELL.Y0		METADATA
		Cell00	S32	0
		Cell01	S32	1024
		Cell10	S32	0
		Cell11	S32	1024
	END
	CHIP.X0.DEPEND	STR	CHIP.NAME
	CHIP.X0		METADATA
		Chip00	S32	0
		Chip01	S32	0
		Chip10	S32	2072
		Chip11	S32	2072
	END
	CHIP.Y0.DEPEND	STR	CHIP.NAME
	CHIP.Y0		METADATA
		Chip00	S32	0
		Chip01	S32	2072
		Chip10	S32	0
		Chip11	S32	2072
	END
	CELL.XSIZE	S32	1000
	CELL.YSIZE	S32	1000
	CELL.XWINDOW	S32	0
	CELL.YWINDOW	S32	0
	CELL.GAIN	F32	1.0
	CELL.READNOISE	F32	10.0
END

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