### Raw data from microCam

# How to identify this type
RULE	METADATA
	ORIGIN		STR	PS0
#	INSTRUME	STR	ucam1
	EXTEND		BOOL	T
	NEXTEND		S32	64
END

# How to read this data
FILE	METADATA
	PHU		STR	FPA	# The FITS file represents an entire FPA
	EXTENSIONS	STR	CELL	# The extensions represent cells
	FPA.NAME	STR	OBSTYPE	# A PHU keyword for unique identifier within the hierarchy level
END

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

# Specify the cell data
CELLS	METADATA
	otCell	METADATA	# Orthogonal transfer cell
		CELL.BIASSEC.SOURCE	STR	HEADER
		CELL.TRIMSEC.SOURCE	STR	HEADER
		CELL.BIASSEC		STR	BIASSEC
		CELL.TRIMSEC		STR	DATASEC
	END
END

# How to translate PS concepts into FITS headers
TRANSLATION	METADATA
	FPA.AIRMASS		STR	AIRMASS
	FPA.FILTER		STR	FILTER
	FPA.POSANGLE		STR	ROTANGLE
	FPA.RA			STR	RA
	FPA.DEC			STR	DEC
	FPA.RADECSYS		STR	RADECSYS
	CELL.TIME		STR	DATE-OBS
	CELL.EXPOSURE		STR	EXPTIME
	CELL.DARKTIME		STR	DARKTIME
	CELL.XBIN		STR	CCDBIN1
	CELL.YBIN		STR	CCDBIN2
	CELL.XPARITY		STR	IMTM1_1
	CELL.YPARITY		STR	IMTM2_2
	CELL.X0			STR	IMNPIX1
	CELL.Y0			STR	IMNPIX2
END

# Default PS concepts that may be specified by value
DEFAULTS	METADATA
	CELL.GAIN		F32	1
	CELL.READNOISE		F32	10.0
	CELL.SATURATION		F32	65535
	CELL.BAD		F32	0
	CELL.READDIR		S32	1
	CELL.TIMESYS		STR	UTC
	CHIP.X0			S32	0
	CHIP.Y0			S32	0
	CHIP.XPARITY		S32	1
	CHIP.YPARITY		S32	1
END

# How to translation PS concepts into database lookups
DATABASE	METADATA
	TYPE		dbEntry		TABLE		COLUMN		GIVENDBCOL	GIVENPS
# 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


# Where there might be some ambiguity, specify the format
FORMATS		METADATA
	FPA.RA		STR	HOURS
	FPA.DEC		STR	DEGREES
	CELL.TIME	STR	MJD
	CELL.X0		STR	FORTRAN
	CELL.Y0		STR	FORTRAN
END
