...
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 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 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 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 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 per diagram above
if it does not exist, append empty GUIDECAM HDU to the L0 FITS
Notes on file locations of Ca HK and Guide Camera FITS
...
The Ca HK and Guide Camera sub-FITS will be created on the KPF FIU computer (an ASL Lancelot located within the K1 server room). I believe these sub-FITS will need to be transferred from there to kpf-asl-prime in order for the FITS Assembler to access them.
...