In [1]:
import os
import glob
import numpy

from pypeit.metadata import PypeItMetaData

In [2]:
#file_list = glob.glob(os.path.join(os.environ['PYPEIT_DEV'],
#                                   'RAW_DATA/Keck_LRIS_red/multi*/*.fits*'))
#file_list = glob.glob(os.path.join(os.environ['PYPEIT_DEV'],
#                                   'RAW_DATA/Keck_LRIS_red/multi_1200_9000_d680/*.fits*'))
file_list = glob.glob(os.path.join(os.environ['PYPEIT_DEV'],
                                   'RAW_DATA/Keck_LRIS_red/multi_400_8500_d560/*.fits*'))

Construct the metadata just based on the headers


In [3]:
fitstbl = PypeItMetaData('keck_lris_red', file_list=file_list, background_index=True)


[WARNING] :: metadata.py 188 _build() - Columns are missing.
[WARNING] :: metadata.py 233 _build() - ut keyword not in header. Setting to None
[INFO]    :: metadata.py 259 _build() - Successfully loaded headers for file:
             /Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560/r170320_2017.fits.gz
[WARNING] :: metadata.py 233 _build() - ut keyword not in header. Setting to None
[INFO]    :: metadata.py 259 _build() - Successfully loaded headers for file:
             /Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560/r170320_2057.fits.gz
[WARNING] :: metadata.py 233 _build() - ut keyword not in header. Setting to None
[INFO]    :: metadata.py 259 _build() - Successfully loaded headers for file:
             /Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560/r170320_2058.fits.gz
[WARNING] :: metadata.py 233 _build() - ut keyword not in header. Setting to None
[INFO]    :: metadata.py 259 _build() - Successfully loaded headers for file:
             /Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560/r170320_2059.fits.gz
[WARNING] :: metadata.py 233 _build() - ut keyword not in header. Setting to None
[INFO]    :: metadata.py 259 _build() - Successfully loaded headers for file:
             /Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560/r170320_2067.fits.gz
[WARNING] :: metadata.py 233 _build() - ut keyword not in header. Setting to None
[INFO]    :: metadata.py 259 _build() - Successfully loaded headers for file:
             /Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560/r170320_2068.fits.gz
[WARNING] :: metadata.py 233 _build() - ut keyword not in header. Setting to None
[INFO]    :: metadata.py 259 _build() - Successfully loaded headers for file:
             /Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560/r170320_2069.fits.gz
[WARNING] :: metadata.py 233 _build() - ut keyword not in header. Setting to None
[INFO]    :: metadata.py 259 _build() - Successfully loaded headers for file:
             /Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560/r170320_2070.fits.gz
[WARNING] :: metadata.py 233 _build() - ut keyword not in header. Setting to None
[INFO]    :: metadata.py 259 _build() - Successfully loaded headers for file:
             /Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560/r170320_2071.fits.gz
[WARNING] :: metadata.py 233 _build() - ut keyword not in header. Setting to None
[INFO]    :: metadata.py 259 _build() - Successfully loaded headers for file:
             /Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560/r170320_2072.fits.gz
[WARNING] :: metadata.py 233 _build() - ut keyword not in header. Setting to None
[INFO]    :: metadata.py 259 _build() - Successfully loaded headers for file:
             /Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560/r170320_2073.fits.gz
[WARNING] :: metadata.py 233 _build() - ut keyword not in header. Setting to None
[INFO]    :: metadata.py 259 _build() - Successfully loaded headers for file:
             /Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560/r170320_2074.fits.gz
[WARNING] :: metadata.py 233 _build() - ut keyword not in header. Setting to None
[INFO]    :: metadata.py 259 _build() - Successfully loaded headers for file:
             /Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560/r170320_2075.fits.gz
[WARNING] :: metadata.py 233 _build() - ut keyword not in header. Setting to None
[INFO]    :: metadata.py 259 _build() - Successfully loaded headers for file:
             /Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560/r170320_2076.fits.gz
[WARNING] :: metadata.py 233 _build() - ut keyword not in header. Setting to None
[INFO]    :: metadata.py 259 _build() - Successfully loaded headers for file:
             /Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560/r170320_2084.fits.gz
[WARNING] :: metadata.py 233 _build() - ut keyword not in header. Setting to None
[INFO]    :: metadata.py 259 _build() - Successfully loaded headers for file:
             /Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560/r170320_2085.fits.gz
[WARNING] :: metadata.py 233 _build() - ut keyword not in header. Setting to None
[INFO]    :: metadata.py 259 _build() - Successfully loaded headers for file:
             /Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560/r170320_2086.fits.gz
[WARNING] :: metadata.py 233 _build() - ut keyword not in header. Setting to None
[INFO]    :: metadata.py 259 _build() - Successfully loaded headers for file:
             /Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560/r170320_2087.fits.gz
[WARNING] :: metadata.py 233 _build() - ut keyword not in header. Setting to None
[INFO]    :: metadata.py 259 _build() - Successfully loaded headers for file:
             /Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560/r170320_2088.fits.gz
[WARNING] :: metadata.py 233 _build() - ut keyword not in header. Setting to None
[INFO]    :: metadata.py 259 _build() - Successfully loaded headers for file:
             /Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560/r170320_2089.fits.gz
[WARNING] :: metadata.py 233 _build() - ut keyword not in header. Setting to None
[INFO]    :: metadata.py 259 _build() - Successfully loaded headers for file:
             /Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560/r170320_2090.fits.gz
[WARNING] :: metadata.py 233 _build() - ut keyword not in header. Setting to None
[INFO]    :: metadata.py 259 _build() - Successfully loaded headers for file:
             /Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560/r170320_2091.fits.gz
[WARNING] :: metadata.py 233 _build() - ut keyword not in header. Setting to None
[INFO]    :: metadata.py 259 _build() - Successfully loaded headers for file:
             /Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560/r170320_2092.fits.gz
[WARNING] :: metadata.py 233 _build() - ut keyword not in header. Setting to None
[INFO]    :: metadata.py 259 _build() - Successfully loaded headers for file:
             /Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560/r170320_2093.fits.gz
[WARNING] :: metadata.py 233 _build() - ut keyword not in header. Setting to None
[INFO]    :: metadata.py 259 _build() - Successfully loaded headers for file:
             /Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560/r170320_2094.fits.gz
[WARNING] :: metadata.py 233 _build() - ut keyword not in header. Setting to None
[INFO]    :: metadata.py 259 _build() - Successfully loaded headers for file:
             /Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560/r170320_2095.fits.gz
[WARNING] :: metadata.py 233 _build() - ut keyword not in header. Setting to None
[INFO]    :: metadata.py 259 _build() - Successfully loaded headers for file:
             /Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560/r170320_2096.fits.gz
[INFO]    :: metadata.py 262 _build() - Headers loaded for 27 files successfully

Add the frame types as we've always done


In [4]:
_ = fitstbl.get_frame_types(flag_unknown=True)


[INFO]    :: metadata.py 1172 get_frame_types() - Typing files
[WARNING] :: keck_lris.py 130 check_frame_type() - Cannot determine if frames are of type standard.
[INFO]    :: metadata.py 1241 get_frame_types() - Typing completed!

Find the unique configurations. The unique configurations are found by matching data in the headers between frames. The keywords that are matched is set by the configuration_keys in each spectrograph class.


In [5]:
cfgs = fitstbl.unique_configurations(ignore_frames=['bias', 'dark'])


[INFO]    :: metadata.py 791 unique_configurations() - Using metadata to determine unique configurations.
[INFO]    :: metadata.py 799 unique_configurations() - Unique configurations ignore frames with type: ['bias', 'dark']
[INFO]    :: metadata.py 846 unique_configurations() - Found 1 unique configurations.

In [6]:
cfgs


Out[6]:
{'A': {'dispname': '400/8500', 'dichroic': '560', 'decker': 'c17_60L.'}}

Once you have the unique configurations, the next step is to identify each frame with a configuration. The configuration is added to the table in the configuration column. The end result of unique_configurations and set_configurations can be done in a single step.


In [7]:
fitstbl.set_configurations(cfgs)

Then you identify each frame within a given configuration as being part of a calibration group. Calibration frames can be assigned to multiple calibration groups, but science frames can only be assigned to a single calibration group. I.e., the calibration group of a science frame selects which calibration frames to use for it. At the moment, some frame types can be assigned to calibrations independent of their configuration. These are defined by the global_frames keyword below. The calibration group is currently an integer or list of integers in the calib column of the table.

At the moment, frames are assigned to a calibration group just based on the configuration, but the logic will become more complicated. I.e., impose a time limit on when arcs should be used with given science frames.


In [8]:
fitstbl.set_calibration_groups(global_frames=['bias', 'dark'])

In [9]:
fitstbl[fitstbl.find_calib_group(0)]


Out[9]:
Table length=27
indexdirectoryfilenameinstrumeidnametimeutcutradecairmassbinningdeckerdichroictargetexptimehatchdispnamedispanglewavecenspectrographlampstat01lampstat02lampstat03lampstat04lampstat05lampstat06lampstat07lampstat08lampstat09lampstat10lampstat11lampstat12filter1NAXIS01CCDGEOMCCDNAME01NAXIS02NAXIS03CCDNAME02NAXIS04index_bgframetypeframebitconfigurationcalibcalibbit
int64str97str20str13str4float64str11str4str11str11float64str3str8str3str8int64str6str8float64float64str4str3str3str3str3str3str3str3str3str3str3str3str3str5int64str27str4int64int64str4int64objectstr15int16str4str4int64
0/Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560r170320_2017.fits.gzkeck_lris_reddark57832.04023900:57:56.64None15:20:00.00+00:00:00.013.374813532,2c17_60L.560unknown1closed400/850022.134311686429.00585938LRISonononononononoffoffoffoffoffClear2LBNL Thick High-Resistivity19-32219-22Nonearc1A01
1/Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560r170320_2057.fits.gzkeck_lris_reddark57832.0992402:22:54.30None15:20:00.00+45:00:00.01.413092362,2c17_60L.560unknown7open400/850022.135440836429.89794922LRISoffoffoffoffoffoffoffoffoffononoffClear2LBNL Thick High-Resistivity19-32219-22Nonepixelflat,trace144A01
2/Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560r170320_2058.fits.gzkeck_lris_reddark57832.09999402:23:58.90None15:20:00.00+45:00:00.01.413092362,2c17_60L.560unknown7open400/850022.135440836429.89794922LRISoffoffoffoffoffoffoffoffoffononoffClear2LBNL Thick High-Resistivity19-32219-22Nonepixelflat,trace144A01
3/Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560r170320_2059.fits.gzkeck_lris_reddark57832.10072902:25:03.00None15:20:00.00+45:00:00.01.413092362,2c17_60L.560unknown7open400/850022.135440836429.89794922LRISoffoffoffoffoffoffoffoffoffononoffClear2LBNL Thick High-Resistivity19-32219-22Nonepixelflat,trace144A01
4/Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560r170320_2067.fits.gzkeck_lris_reddark57832.13488903:14:14.36None15:20:00.00+45:00:00.01.413092362,2sp15l.fi560unknown0closed400/850022.135440836429.89794922LRISoffoffoffoffoffoffoffoffoffoffoffoffClear2LBNL Thick High-Resistivity19-32219-22Nonebias2None01
5/Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560r170320_2068.fits.gzkeck_lris_reddark57832.13555703:15:12.13None15:20:00.00+45:00:00.01.413092362,2sp15l.fi560unknown0closed400/850022.135440836429.89794922LRISoffoffoffoffoffoffoffoffoffoffoffoffClear2LBNL Thick High-Resistivity19-32219-22Nonebias2None01
6/Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560r170320_2069.fits.gzkeck_lris_reddark57832.13624303:16:11.43None15:20:00.00+45:00:00.01.413092362,2sp15l.fi560unknown0closed400/850022.135440836429.89794922LRISoffoffoffoffoffoffoffoffoffoffoffoffClear2LBNL Thick High-Resistivity19-32219-22Nonebias2None01
7/Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560r170320_2070.fits.gzkeck_lris_reddark57832.13692203:17:10.02None15:20:00.00+45:00:00.01.413092362,2sp15l.fi560unknown0closed400/850022.135440836429.89794922LRISoffoffoffoffoffoffoffoffoffoffoffoffClear2LBNL Thick High-Resistivity19-32219-22Nonebias2None01
8/Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560r170320_2071.fits.gzkeck_lris_reddark57832.13759803:18:08.42None15:20:00.00+45:00:00.01.413092362,2sp15l.fi560unknown0closed400/850022.135440836429.89794922LRISoffoffoffoffoffoffoffoffoffoffoffoffClear2LBNL Thick High-Resistivity19-32219-22Nonebias2None01
9/Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560r170320_2072.fits.gzkeck_lris_reddark57832.13827203:19:06.72None15:20:00.00+45:00:00.01.413092362,2sp15l.fi560unknown0closed400/850022.135440836429.89794922LRISoffoffoffoffoffoffoffoffoffoffoffoffClear2LBNL Thick High-Resistivity19-32219-22Nonebias2None01
.............................................................................................................................................
17/Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560r170320_2087.fits.gzkeck_lris_reddark57832.27824406:40:40.23None10:01:24.75+02:11:54.51.183643452,2c17_60L.560c17_60L.850open400/850022.139955526433.46679688LRISoffoffoffoffoffoffoffoffoffoffoffoffClear2LBNL Thick High-Resistivity19-32219-22Nonescience32A01
18/Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560r170320_2088.fits.gzkeck_lris_reddark57832.28876706:55:49.47None10:01:24.75+02:11:54.51.146805352,2c17_60L.560c17_60L.850open400/850022.139955526433.46679688LRISoffoffoffoffoffoffoffoffoffoffoffoffClear2LBNL Thick High-Resistivity19-32219-22Nonescience32A01
19/Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560r170320_2089.fits.gzkeck_lris_reddark57832.29929107:10:58.76None10:01:24.75+02:11:54.51.116941142,2c17_60L.560c17_60L.850open400/850022.139955526433.46679688LRISoffoffoffoffoffoffoffoffoffoffoffoffClear2LBNL Thick High-Resistivity19-32219-22Nonescience32A01
20/Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560r170320_2090.fits.gzkeck_lris_reddark57832.30983707:26:09.90None10:01:24.75+02:11:54.51.093061132,2c17_60L.560c17_60L.850open400/850022.139955526433.46679688LRISoffoffoffoffoffoffoffoffoffoffoffoffClear2LBNL Thick High-Resistivity19-32219-22Nonescience32A01
21/Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560r170320_2091.fits.gzkeck_lris_reddark57832.32725807:51:15.05None10:01:24.04+02:11:47.31.06566182,2c17_60L.560c17_60L.850open400/850022.139955526433.46679688LRISoffoffoffoffoffoffoffoffoffoffoffoffClear2LBNL Thick High-Resistivity19-32219-22Nonescience32A01
22/Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560r170320_2092.fits.gzkeck_lris_reddark57832.33779308:06:25.34None10:01:24.04+02:11:47.31.055764942,2c17_60L.560c17_60L.850open400/850022.139955526433.46679688LRISoffoffoffoffoffoffoffoffoffoffoffoffClear2LBNL Thick High-Resistivity19-32219-22Nonescience32A01
23/Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560r170320_2093.fits.gzkeck_lris_reddark57832.34830508:21:33.58None10:01:24.04+02:11:47.31.050501642,2c17_60L.560c17_60L.850open400/850022.139955526433.46679688LRISoffoffoffoffoffoffoffoffoffoffoffoffClear2LBNL Thick High-Resistivity19-32219-22Nonescience32A01
24/Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560r170320_2094.fits.gzkeck_lris_reddark57832.35884708:36:44.37None10:01:24.04+02:11:47.31.049776192,2c17_60L.560c17_60L.850open400/850022.139955526433.46679688LRISoffoffoffoffoffoffoffoffoffoffoffoffClear2LBNL Thick High-Resistivity19-32219-22Nonescience32A01
25/Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560r170320_2095.fits.gzkeck_lris_reddark57832.36938408:51:54.80None10:01:24.04+02:11:47.31.053672212,2c17_60L.560c17_60L.880open400/850022.139955526433.46679688LRISoffoffoffoffoffoffoffoffoffoffoffoffClear2LBNL Thick High-Resistivity19-32219-22Nonescience32A01
26/Users/westfall/Work/packages/PypeIt-development-suite/RAW_DATA/Keck_LRIS_red/multi_400_8500_d560r170320_2096.fits.gzkeck_lris_reddark57832.38025909:07:34.39None10:01:24.04+02:11:47.31.062459222,2c17_60L.560c17_60L.880open400/850022.139955526433.46679688LRISoffoffoffoffoffoffoffoffoffoffoffoffClear2LBNL Thick High-Resistivity19-32219-22Nonescience32A01

This matches calibration frames to science frames using the existing approach.


In [10]:
fitstbl.match_to_science(fitstbl.par['calibrations'], fitstbl.par['rdx']['calwin'], fitstbl.par['fluxcalib'], setup=True)


[INFO]    :: metadata.py 1360 match_to_science() - Matching calibrations to Science frames
[INFO]    :: metadata.py 1379 match_to_science() - ==================================================
[INFO]    :: metadata.py 1380 match_to_science() - Matching calibrations to frame: c17_60L.
[INFO]    :: metadata.py 1436 match_to_science() -   Found 1 arc frame for c17_60L. (1 required)
[INFO]    :: metadata.py 1420 match_to_science() - No matching criteria for pinhole frames
[INFO]    :: metadata.py 1436 match_to_science() -   Found 0 pinhole frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 0 standard frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 3 pixelflat frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 3 trace frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 10 bias frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1394 match_to_science() -   Dark frames not required.  Not matching...
[INFO]    :: metadata.py 1379 match_to_science() - ==================================================
[INFO]    :: metadata.py 1380 match_to_science() - Matching calibrations to frame: c17_60L.
[INFO]    :: metadata.py 1436 match_to_science() -   Found 1 arc frame for c17_60L. (1 required)
[INFO]    :: metadata.py 1420 match_to_science() - No matching criteria for pinhole frames
[INFO]    :: metadata.py 1436 match_to_science() -   Found 0 pinhole frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 0 standard frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 3 pixelflat frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 3 trace frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 10 bias frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1394 match_to_science() -   Dark frames not required.  Not matching...
[INFO]    :: metadata.py 1379 match_to_science() - ==================================================
[INFO]    :: metadata.py 1380 match_to_science() - Matching calibrations to frame: c17_60L.
[INFO]    :: metadata.py 1436 match_to_science() -   Found 1 arc frame for c17_60L. (1 required)
[INFO]    :: metadata.py 1420 match_to_science() - No matching criteria for pinhole frames
[INFO]    :: metadata.py 1436 match_to_science() -   Found 0 pinhole frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 0 standard frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 3 pixelflat frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 3 trace frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 10 bias frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1394 match_to_science() -   Dark frames not required.  Not matching...
[INFO]    :: metadata.py 1379 match_to_science() - ==================================================
[INFO]    :: metadata.py 1380 match_to_science() - Matching calibrations to frame: c17_60L.
[INFO]    :: metadata.py 1436 match_to_science() -   Found 1 arc frame for c17_60L. (1 required)
[INFO]    :: metadata.py 1420 match_to_science() - No matching criteria for pinhole frames
[INFO]    :: metadata.py 1436 match_to_science() -   Found 0 pinhole frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 0 standard frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 3 pixelflat frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 3 trace frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 10 bias frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1394 match_to_science() -   Dark frames not required.  Not matching...
[INFO]    :: metadata.py 1379 match_to_science() - ==================================================
[INFO]    :: metadata.py 1380 match_to_science() - Matching calibrations to frame: c17_60L.
[INFO]    :: metadata.py 1436 match_to_science() -   Found 1 arc frame for c17_60L. (1 required)
[INFO]    :: metadata.py 1420 match_to_science() - No matching criteria for pinhole frames
[INFO]    :: metadata.py 1436 match_to_science() -   Found 0 pinhole frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 0 standard frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 3 pixelflat frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 3 trace frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 10 bias frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1394 match_to_science() -   Dark frames not required.  Not matching...
[INFO]    :: metadata.py 1379 match_to_science() - ==================================================
[INFO]    :: metadata.py 1380 match_to_science() - Matching calibrations to frame: c17_60L.
[INFO]    :: metadata.py 1436 match_to_science() -   Found 1 arc frame for c17_60L. (1 required)
[INFO]    :: metadata.py 1420 match_to_science() - No matching criteria for pinhole frames
[INFO]    :: metadata.py 1436 match_to_science() -   Found 0 pinhole frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 0 standard frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 3 pixelflat frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 3 trace frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 10 bias frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1394 match_to_science() -   Dark frames not required.  Not matching...
[INFO]    :: metadata.py 1379 match_to_science() - ==================================================
[INFO]    :: metadata.py 1380 match_to_science() - Matching calibrations to frame: c17_60L.
[INFO]    :: metadata.py 1436 match_to_science() -   Found 1 arc frame for c17_60L. (1 required)
[INFO]    :: metadata.py 1420 match_to_science() - No matching criteria for pinhole frames
[INFO]    :: metadata.py 1436 match_to_science() -   Found 0 pinhole frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 0 standard frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 3 pixelflat frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 3 trace frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 10 bias frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1394 match_to_science() -   Dark frames not required.  Not matching...
[INFO]    :: metadata.py 1379 match_to_science() - ==================================================
[INFO]    :: metadata.py 1380 match_to_science() - Matching calibrations to frame: c17_60L.
[INFO]    :: metadata.py 1436 match_to_science() -   Found 1 arc frame for c17_60L. (1 required)
[INFO]    :: metadata.py 1420 match_to_science() - No matching criteria for pinhole frames
[INFO]    :: metadata.py 1436 match_to_science() -   Found 0 pinhole frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 0 standard frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 3 pixelflat frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 3 trace frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 10 bias frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1394 match_to_science() -   Dark frames not required.  Not matching...
[INFO]    :: metadata.py 1379 match_to_science() - ==================================================
[INFO]    :: metadata.py 1380 match_to_science() - Matching calibrations to frame: c17_60L.
[INFO]    :: metadata.py 1436 match_to_science() -   Found 1 arc frame for c17_60L. (1 required)
[INFO]    :: metadata.py 1420 match_to_science() - No matching criteria for pinhole frames
[INFO]    :: metadata.py 1436 match_to_science() -   Found 0 pinhole frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 0 standard frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 3 pixelflat frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 3 trace frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 10 bias frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1394 match_to_science() -   Dark frames not required.  Not matching...
[INFO]    :: metadata.py 1379 match_to_science() - ==================================================
[INFO]    :: metadata.py 1380 match_to_science() - Matching calibrations to frame: c17_60L.
[INFO]    :: metadata.py 1436 match_to_science() -   Found 1 arc frame for c17_60L. (1 required)
[INFO]    :: metadata.py 1420 match_to_science() - No matching criteria for pinhole frames
[INFO]    :: metadata.py 1436 match_to_science() -   Found 0 pinhole frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 0 standard frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 3 pixelflat frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 3 trace frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 10 bias frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1394 match_to_science() -   Dark frames not required.  Not matching...
[INFO]    :: metadata.py 1379 match_to_science() - ==================================================
[INFO]    :: metadata.py 1380 match_to_science() - Matching calibrations to frame: c17_60L.
[INFO]    :: metadata.py 1436 match_to_science() -   Found 1 arc frame for c17_60L. (1 required)
[INFO]    :: metadata.py 1420 match_to_science() - No matching criteria for pinhole frames
[INFO]    :: metadata.py 1436 match_to_science() -   Found 0 pinhole frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 0 standard frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 3 pixelflat frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 3 trace frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 10 bias frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1394 match_to_science() -   Dark frames not required.  Not matching...
[INFO]    :: metadata.py 1379 match_to_science() - ==================================================
[INFO]    :: metadata.py 1380 match_to_science() - Matching calibrations to frame: c17_60L.
[INFO]    :: metadata.py 1436 match_to_science() -   Found 1 arc frame for c17_60L. (1 required)
[INFO]    :: metadata.py 1420 match_to_science() - No matching criteria for pinhole frames
[INFO]    :: metadata.py 1436 match_to_science() -   Found 0 pinhole frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 0 standard frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 3 pixelflat frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 3 trace frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 10 bias frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1394 match_to_science() -   Dark frames not required.  Not matching...
[INFO]    :: metadata.py 1379 match_to_science() - ==================================================
[INFO]    :: metadata.py 1380 match_to_science() - Matching calibrations to frame: c17_60L.
[INFO]    :: metadata.py 1436 match_to_science() -   Found 1 arc frame for c17_60L. (1 required)
[INFO]    :: metadata.py 1420 match_to_science() - No matching criteria for pinhole frames
[INFO]    :: metadata.py 1436 match_to_science() -   Found 0 pinhole frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 0 standard frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 3 pixelflat frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 3 trace frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1436 match_to_science() -   Found 10 bias frame for c17_60L. (0 required)
[INFO]    :: metadata.py 1394 match_to_science() -   Dark frames not required.  Not matching...
[INFO]    :: metadata.py 1459 match_to_science() - Science frames successfully matched to calibration frames.

The following is just a check to compare what one would get using the calib group to assign the science ID. In the test cases with a single configuration the two are identical.


In [11]:
fitstbl.calib_to_science()

In [12]:
fitstbl.get_setup(0)


Out[12]:
{'A': {'--': {'disperser': {'name': '400/8500', 'angle': 22.13431168},
   'dichroic': '560',
   'slit': {'decker': 'c17_60L.', 'slitwid': 'none', 'slitlen': 'none'}},
  '01': {'binning': '2,2', 'det': 1, 'namp': 2},
  '02': {'binning': '2,2', 'det': 2, 'namp': 2}}}

In [13]:
fitstbl.write_sorted('test.sorted')

In [14]:
fitstbl.write_setups('test.setups', ignore=['None'])

In [15]:
fitstbl.write_calib('test.calib')

In [16]:
fitstbl.master_key(0)


Out[16]:
'A_1_01'

In [ ]: