...
sub-FITS are FITS files containing images or data (or both) and are created by subsystems throughout KPF
Some are created by devices (i.e. Archons) and some by dispatchers (i.e. Ca HK Detector dispatcher)
Each sub-FITS is designed to be stand-alone, and contain all of the relevant subsystem information within
The sub-FITS are assembled together by the FITS Assembler to form a single ‘L0’ FITS file per observation
...
use it within the sub-FITS filenames (“subsystem-prefix_obsID.FITS”)
this allows for straightforward assembly of correct files, and the assembler only needs to look at filenames
place it within the header of each sub-FITS
maintains obsID traceability after the L0 is created assembled and the sub-FITS filenames are lost
...
→ Sub-FITS Directory → Green
→ Red
→ Ca_HK
→ ExpMeter
→ GuidecamGuideCam
→ Solar_Irrad
The sub-FITS sub-directories will hold the separate FITS from each subsystem before L0 assembly
The sub-FITS will not be immediately deleted after L0 assembly, but will remain in the directory for one month (TBC) as a backup
...
After each observation, the FITS Assembler pulls images with the appropriate obsIDs from the separate subsystem interim directories
These sub-FITS are then directly copied into the larger L0 FITS, in the correct order, with no modifications, as shown in this schematic:
...
Description of Process
First thoughts on the sequence for the FITS Assembler:
get the current obsID value from the obsID keyword
create an empty L0 FITS file (with correct filename) to append to
pull telemetry from the desired KTL keywords and append them to the primary header in HDU 1
append the obsID to the primary header in HDU 1
look in the /Green sub-FITS directory for a file named “KPF_Green_obsID.FITS”
if it exists, append it to the L0 FITS file as in per diagram above
if it does not exist, append empty GREEN_AMP1, GREEN_AMP2, GREEN_AMP3, GREEN_AMP4 HDUs to the L0 FITS
look in the /Red sub-FITS directory for a file named “KPF_Red_obsID.FITS”
if it exists, append it to the L0 FITS file as in per diagram above
if it does not exist, append empty RED_AMP1, RED_AMP2, RED_AMP3, RED_AMP4 HDUs to the L0 FITS
look in the /Ca_HK sub-FITS directory for a file named “KPF_Ca_HK_obsID.FITS”
if it exists, append it to the L0 FITS file as in per diagram above
if it does not exist, append empty CA_HK HDU to the L0 FITS
look in the /ExpMeter sub-FITS directory for a file named “KPF_ExpMeter_obsID.FITS”
if it exists, append it to the L0 FITS file as in per diagram above
if it does not exist, append empty EXPMETER HDU to the L0 FITS
look in the /GuideCam sub-FITS directory for a file named “KPF_GuideCam_obsID.FITS”
if it exists, append it to the L0 FITS file as in per diagram above
if it does not exist, append empty GUIDECAM HDU to the L0 FITS
...
immediately after each sub-FITS is created. This is likely the preferred approach as the Ca HK detector and Guide Camera will read out faster than the main spectrometer Green and Red detectors. If the Ca HK detector dispatcher and the Guide Camera dispatcher copied their sub-FITS to kpf-asl-prime immediately after creation, they would be saved on kpf-asl-prime and ready to assemble likely before the main spectrometer CCDs have finished reading out.
by the FITS Assembler. Not ideal as then the FITS Assembler has to stop and wait for the files to arrive before proceeding.
by some better approach I haven’t thought of…