diff --git a/xrtpy/image_correction/remove_lightleak.py b/xrtpy/image_correction/remove_lightleak.py index f03f8ed2..eeb13a5f 100644 --- a/xrtpy/image_correction/remove_lightleak.py +++ b/xrtpy/image_correction/remove_lightleak.py @@ -98,22 +98,22 @@ def _get_stray_light_phase(date_obs): def _select_lightleak_file(filter_wheel_1, filter_wheel_2, date): phase = _get_stray_light_phase(date) file_dict = { - ("open", "al mesh"): { + ("open", "al_mesh"): { 2: "term_p2am_20150718_160913.fits", 3: "term_p3am_20170808_180126.fits", 4: "term_p4am_20180712_171919.fits", 5: "term_p5am_20220709_180901.fits", }, - ("al poly", "open"): { + ("al_poly", "open"): { 2: "term_p2ap_20150620_172818.fits", 3: "term_p3ap_20170809_183821.fits", 4: "term_p4ap_20180712_171928.fits", 5: "term_p5ap_20220709_180910.fits", }, - ("c poly", "open"): { + ("c_poly", "open"): { 2: "term_p2cp_20150620_190645.fits", }, - ("open", "ti poly"): { + ("open", "ti_poly"): { 1: "term_p1tp_20140515_182503.fits", 2: "term_p2tp_20150718_160921.fits", }, @@ -206,9 +206,9 @@ def remove_lightleak(in_map, scale=1.0, leak_map=None): warnings.warn("HISTORY indicates light leak subtraction already done on image.") # noqa: B028 if leak_map is None: - leak_filename = _select_lightleak_file( - *in_map.measurement.split("-"), in_map.date - ) + fw1 = in_map.meta["EC_FW1_"] + fw2 = in_map.meta["EC_FW2_"] + leak_filename = _select_lightleak_file(fw1, fw2, in_map.date) # NOTE: This function is being defined inline because the filename is only known once # the date and filter wheel combination are known.