Skip to content

Commit

Permalink
Merge pull request #490 from lsst/tickets/DM-41735
Browse files Browse the repository at this point in the history
DM-41735: Fix problems with the ph_05 vs ph_5 physical filter
  • Loading branch information
timj authored Dec 4, 2023
2 parents 6f875d5 + eb8827a commit ad303e3
Show file tree
Hide file tree
Showing 3 changed files with 159 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/lsst/obs/lsst/translators/lsstCam.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ def fix_header(cls, header, instrument, obsid, filename=None):
header["FILTER2"] = None
modified = True

if header.get("DAYOBS") in ("20231107", "20231108") and header["FILTER"] == "ph_05":
header["FILTER"] = "ph_5"
modified = True

return modified

@classmethod
Expand Down
126 changes: 126 additions & 0 deletions tests/headers/lsstCam-MC_C_20231107_000078_R01_S01.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
{
"__CONTENT__" : "metadata",
"SIMPLE" : true,
"BITPIX" : 8,
"NAXIS" : 0,
"EXTEND" : true,
"DATE" : "2023-11-08T01:26:58.070",
"MJD" : 60256.06039432855,
"RUNNUM" : "13518",
"CCD_MANU" : "ITL",
"CCD_TYPE" : "3800C",
"TESTTYPE" : "BOT_PERSISTENCE",
"IMGTYPE" : "BIAS",
"DETSIZE" : "[1:4072,1:4000]",
"EXPTIME" : 0.0,
"FILENAME" : "MC_C_20231107_000078_R01_S01.fits",
"BINX" : 1,
"BINY" : 1,
"CCDGAIN" : 1.0,
"CCDNOISE" : 10.0,
"DATE-OBS" : "2023-11-08T01:26:57.923",
"MJD-OBS" : 60256.06039262749,
"DATE-TRG" : "2023-11-08T01:26:58.005",
"MJD-TRG" : 60256.06039357651,
"IMAGETAG" : "9f865cd8d662fcbe",
"CCDSLOT" : "S01",
"RAFTBAY" : "R01",
"FIRMWARE" : "3139500e",
"PLATFORM" : "ir2-camera",
"CONTNUM" : "18ed9486",
"DAQVERS" : "R5-V6.9 2023-09-11T17:05:01Z (9eb7c3ed)",
"DAQPART" : "camera",
"DAQFOLD" : "raw",
"OBSANNOT" : "",
"OBSID" : "MC_C_20231107_000078",
"CAMCODE" : "MC",
"CONTRLLR" : "C",
"DAYOBS" : "20231107",
"SEQNUM" : 78,
"HEADVER" : 2,
"INSTRUME" : "lsstCam",
"TELESCOP" : "LSST",
"TSTAND" : "BOT",
"SEQFILE" : "FP_ITL_2s_ir2_v26_no_RG.seq",
"SEQCKSUM" : "1477162166",
"LSST_NUM" : "ITL-3800C-226",
"CCD_SERN" : "23000",
"REBNAME" : "LCA-13574-055",
"RAFTNAME" : "LCA-11021_RTM-011",
"DARKTIME" : 0.092,
"TSEQNUM" : 0,
"FPVERS" : "1.2.4",
"IHVERS" : "1.1.4",
"DATE-BEG" : "2023-11-08T01:26:57.923",
"MJD-BEG" : 60256.06039262749,
"DATE-END" : "2023-11-08T01:26:58.015",
"MJD-END" : 60256.060393691994,
"TIMESYS" : "TAI",
"FILTER" : "ph_05",
"FILTER1" : null,
"FILTER2" : null,
"TEMPLED1" : null,
"TEMPLED2" : null,
"TEMPBRD" : null,
"CCOBLED" : null,
"CCOBCURR" : null,
"CCOBADC" : null,
"CCOBFLST" : null,
"PROJTIME" : null,
"CCOBFLUX" : null,
"DATEPBEG" : null,
"MJDPBEG" : null,
"DATEPEND" : null,
"MJDPEND" : null,
"CATKW101" : null,
"CATKW102" : null,
"CATKW103" : null,
"CATKW104" : null,
"CATKW105" : null,
"CATKW106" : null,
"CATKW107" : null,
"CATKW108" : null,
"CATKW109" : null,
"CATKW10A" : null,
"CATKW10B" : null,
"CATKW10C" : null,
"CATKW10D" : null,
"CATKW10E" : null,
"CATKW10F" : null,
"CATKW110" : null,
"CATKW111" : null,
"CATKW112" : null,
"CATKW113" : null,
"CATKW114" : null,
"CATKW115" : null,
"CATKW116" : null,
"CATKW117" : null,
"CATKW118" : null,
"CATKW119" : null,
"CATKW11A" : null,
"CATKW11B" : null,
"CATKW11C" : null,
"CATKW11D" : null,
"CATKW11E" : null,
"CATKW11F" : null,
"CATKW120" : null,
"CATKW121" : null,
"CATKW122" : null,
"CATKW123" : null,
"CATKW124" : null,
"CATKW125" : null,
"CATKW126" : null,
"CATKW127" : null,
"CATKW128" : null,
"CATKW129" : null,
"CATKW12A" : null,
"CATKW12B" : null,
"CATKW12C" : null,
"CATKW12D" : null,
"CATKW12E" : null,
"CATKW130" : null,
"CATKW131" : null,
"CATKW132" : null,
"CHECKSUM" : "IU67LU35IU35IU35",
"DATASUM" : "0"
}
29 changes: 29 additions & 0 deletions tests/test_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,35 @@ def test_lsstCam_translator(self):
science_program="unknown",
temperature=None,
visit_id=2029031900001)),
("lsstCam-MC_C_20231107_000078_R01_S01.json",
dict(telescope="Simonyi Survey Telescope",
instrument="LSSTCam",
boresight_rotation_coord="unknown",
dark_time=0.092*u.s,
detector_exposure_id=0x9e1004e01,
detector_group="R01",
detector_name="S01",
detector_num=1,
detector_serial="ITL-3800C-226",
exposure_id=2023110700078,
exposure_group="2023110700078",
exposure_time=0.0*u.s,
focus_z=0.0*u.mm,
group_counter_end=78,
group_counter_start=78,
has_simulated_content=False,
object="UNKNOWN",
observation_counter=78,
observation_id="MC_C_20231107_000078",
observation_type="bias",
observation_reason="bot_persistence",
observing_day=20231107,
physical_filter="ph_5",
pressure=None,
relative_humidity=None,
science_program="13518",
temperature=None,
visit_id=2023110700078)),
)
for filename, expected in test_data:
with self.subTest(f"Testing {filename}"):
Expand Down

0 comments on commit ad303e3

Please sign in to comment.