# The raw GPC data comes off the telescope with each of the chips stored in separate files

# How to identify this type
RULE	METADATA
#	TELESCOP	STR	PS1
#	DETECTOR	STR	GPC1
	EXTEND		BOOL	T
	NEXTEND		S32	64
	NAMPS		S32	64
END

# How to read this data
PHU		STR	CHIP	# The FITS file represents a single chip
EXTENSIONS	STR	CELL	# The extensions represent cells

# What's in the FITS file?
CONTENTS	METADATA
	# Extension name, type
	xy00	STR	pitch10u
	xy01	STR	pitch10u
	xy02	STR	pitch10u
	xy03	STR	pitch10u
	xy04	STR	pitch10u
	xy05	STR	pitch10u
	xy06	STR	pitch10u
	xy07	STR	pitch10u
	xy10	STR	pitch10u
	xy11	STR	pitch10u
	xy12	STR	pitch10u
	xy13	STR	pitch10u
	xy14	STR	pitch10u
	xy15	STR	pitch10u
	xy16	STR	pitch10u
	xy17	STR	pitch10u
	xy20	STR	pitch10u
	xy21	STR	pitch10u
	xy22	STR	pitch10u
	xy23	STR	pitch10u
	xy24	STR	pitch10u
	xy25	STR	pitch10u
	xy26	STR	pitch10u
	xy27	STR	pitch10u
	xy30	STR	pitch10u
	xy31	STR	pitch10u
	xy32	STR	pitch10u
	xy33	STR	pitch10u
	xy34	STR	pitch10u
	xy35	STR	pitch10u
	xy36	STR	pitch10u
	xy37	STR	pitch10u
	xy40	STR	pitch10u
	xy41	STR	pitch10u
	xy42	STR	pitch10u
	xy43	STR	pitch10u
	xy44	STR	pitch10u
	xy45	STR	pitch10u
	xy46	STR	pitch10u
	xy47	STR	pitch10u
	xy50	STR	pitch10u
	xy51	STR	pitch10u
	xy52	STR	pitch10u
	xy53	STR	pitch10u
	xy54	STR	pitch10u
	xy55	STR	pitch10u
	xy56	STR	pitch10u
	xy57	STR	pitch10u
	xy60	STR	pitch10u
	xy61	STR	pitch10u
	xy62	STR	pitch10u
	xy63	STR	pitch10u
	xy64	STR	pitch10u
	xy65	STR	pitch10u
	xy66	STR	pitch10u
	xy67	STR	pitch10u
	xy70	STR	pitch10u
	xy71	STR	pitch10u
	xy72	STR	pitch10u
	xy73	STR	pitch10u
	xy74	STR	pitch10u
	xy75	STR	pitch10u
	xy76	STR	pitch10u
	xy77	STR	pitch10u
END

# Specify the cell data
CELLS	METADATA
	pitch10u	METADATA
		CELL.BIASSEC	STR	VALUE:[575:606,1:594]
		CELL.TRIMSEC	STR	VALUE:[1:574,1:594]
	#	CELL.BIASSEC	STR	HEADER:BIASSEC
	#	CELL.TRIMSEC	STR	HEADER:DATASEC
	END

	# This is just in here for fun
	pitch12u	METADATA
		CELL.BIASSEC	STR	VALUE:[1:10,1:512];[523:574,1:512]
		CELL.TRIMSEC	STR	VALUE:[11:522,1:512]
	#	CELL.BIASSEC	STR	HEADER:BIASSEC
	#	CELL.TRIMSEC	STR	HEADER:TRIMSEC
	END
END


# How to translate PS concepts into FITS headers
TRANSLATION	METADATA
	CELL.BIN	STR	CCDSUM
	CELL.SATURATION	STR	SATURATE
END

# Default PS concepts that may be specified by value
DEFAULTS	METADATA
	FPA.AIRMASS	F32	0.0
	FPA.FILTER	STR	NONE
	FPA.POSANGLE	F32	0.0
	FPA.RA		STR	0:0:0
	FPA.DEC		STR	0:0:0
	FPA.RADECSYS	STR	ICRS
	FPA.NAME	S32	0
	FPA.MJD		F32	12345.6789
	CELL.EXPOSURE	F32	0.0
	CELL.DARKTIME	F32	0.0
	CELL.GAIN	F32	1.0
	CELL.READNOISE	F32	0.0
	CELL.BAD	S32	0
	CELL.BIN	S32	1
	CELL.XPARITY	S32	1
	CELL.YPARITY	S32	1
	CELL.TEST_DEPEND	STR	CELL.NAME
	CELL.TEST	METADATA
		xy00	S32	00
		xy01	S32	01
		xy02	S32	02
		xy03	S32	03
		xy04	S32	04
		xy05	S32	05
		xy06	S32	06
		xy07	S32	07
		xy10	S32	10
		xy11	S32	11
		xy12	S32	12
		xy13	S32	13
		xy14	S32	14
		xy15	S32	15
		xy16	S32	16
		xy17	S32	17
		xy20	S32	20
		xy21	S32	21
		xy22	S32	22
		xy23	S32	23
		xy24	S32	24
		xy25	S32	25
		xy26	S32	26
		xy27	S32	27
		xy30	S32	30
		xy31	S32	31
		xy32	S32	32
		xy33	S32	33
		xy34	S32	34
		xy35	S32	35
		xy36	S32	36
		xy37	S32	37
		xy40	S32	40
		xy41	S32	41
		xy42	S32	42
		xy43	S32	43
		xy44	S32	44
		xy45	S32	45
		xy46	S32	46
		xy47	S32	47
		xy50	S32	50
		xy51	S32	51
		xy52	S32	52
		xy53	S32	53
		xy54	S32	54
		xy55	S32	55
		xy56	S32	56
		xy57	S32	57
		xy60	S32	60
		xy61	S32	61
		xy62	S32	62
		xy63	S32	63
		xy64	S32	64
		xy65	S32	65
		xy66	S32	66
		xy67	S32	67
		xy70	S32	70
		xy71	S32	71
		xy72	S32	72
		xy73	S32	73
		xy74	S32	74
		xy75	S32	75
		xy76	S32	76
		xy77	S32	77
	END
END

# How to translation PS concepts into database lookups
DATABASE	METADATA
	TYPE		dbEntry		TABLE		COLUMN		GIVENDBCOL	GIVENPS
	CELL.GAIN	dbEntry		Camera		gain		chipId,cellId	CHIP,CELL
	CELL.READNOISE	dbEntry		Camera		readNoise	chipId,cellId	CHIP,CELL

# A database entry refers to a particular column (COLUMN) in a
# particular table (TABLE), given certain PS concepts (GIVENPS) that
# match certain database columns (GIVENDBCOL).

END
