Skip to content

Commit

Permalink
Merge pull request #899 from Keck-DataReductionPipelines/develop
Browse files Browse the repository at this point in the history
Hotfix for v2.7.0
  • Loading branch information
bjfultn authored May 28, 2024
2 parents 01c3637 + 0090431 commit 86d86fa
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 4 deletions.
3 changes: 3 additions & 0 deletions caldates/etalon_mask.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CALTAG, UT_start_date, UT_end_date, CALPATH, comment
1.0, 2000-01-01 00:00:00, 2024-02-03 00:00:00, /code/KPF-Pipeline/static/stellarmasks/kpf_etalon_masks_13nov2023.csv,
2.0, 2024-02-03 00:00:01, 3000-01-01 00:00:00, /code/KPF-Pipeline/static/stellarmasks/kpf_etalon_masks_1apr2024.csv,
2 changes: 1 addition & 1 deletion caldates/order_trace.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
CALTAG, UT_start_date, UT_end_date, CALPATH, comment
1.0, 2000-01-01 00:00:00, 2024-02-03 00:00:00, "['/data/reference_fits/kpf_20230920_master_flat_GREEN_CCD.csv', '/data/reference_fits/kpf_20230920_master_flat_RED_CCD.csv']"
2.0, 2024-02-03 00:00:01, 3000-01-01 00:00:00, "['/data/reference_fits/kpf_20240211_master_flat_GREEN_CCD.csv', '/data/reference_fits/kpf_20240211_master_flat_GREEN_CCD.csv']"
2.0, 2024-02-03 00:00:01, 3000-01-01 00:00:00, "['/data/reference_fits/kpf_20240211_master_flat_GREEN_CCD.csv', '/data/reference_fits/kpf_20240211_master_flat_RED_CCD.csv']"
1 change: 1 addition & 0 deletions configs/kpf_masters_drp.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ master_bias = modules/master_bias/configs/default.cfg
master_dark = modules/master_dark/configs/default.cfg
master_flat = modules/master_flat/configs/default.cfg
master_arclamp = modules/master_arclamp/configs/default.cfg
calibration_lookup = modules/calibration_lookup/configs/default.cfg



Expand Down
1 change: 1 addition & 0 deletions configs/kpf_masters_l1.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,4 @@ hk_spectral_extraction = modules/ca_hk/configs/default_hk.cfg
quicklook = modules/quicklook/configs/default.cfg
bias_subtraction = modules/bias_subtraction/configs/default.cfg
flat_fielding = modules/flat_fielding/configs/default.cfg
calibration_lookup = modules/calibration_lookup/configs/default.cfg
6 changes: 4 additions & 2 deletions modules/calibration_lookup/configs/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ date_files = {'rough_wls': 'caldates/master_wls.csv',
'start_order': 'caldates/start_order.csv',
'order_mask': 'caldates/order_mask.csv',
'smooth_lamp_pattern': 'caldates/smooth_lamp_pattern.csv',
'trace_flat': 'caldates/trace_flat.csv'}
'trace_flat': 'caldates/trace_flat.csv',
'etalon_mask': 'caldates/etalon_mask.csv'}

# List of possible calibration types and how to look them up
# possible values are 'database' | 'file' | 'wls'
Expand All @@ -23,7 +24,8 @@ lookup_map = {'bias': 'database',
'start_order': 'file',
'order_mask': 'file',
'smooth_lamp_pattern': 'file',
'trace_flat': 'file'}
'trace_flat': 'file',
'etalon_mask': 'file'}

defaults = {'bias': '/data/reference_fits/kpf_20240223_master_bias_autocal-bias.fits',
'dark': '/data/reference_fits/kpf_20240223_master_dark_autocal-dark.fits',
Expand Down
11 changes: 10 additions & 1 deletion modules/radial_velocity/src/alg_rv_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from modules.radial_velocity.src.alg_rv_base import RadialVelocityBase
from modules.radial_velocity.src.alg_rv_mask_line import RadialVelocityMaskLine
from modules.barycentric_correction.src.alg_barycentric_corr import BarycentricCorrectionAlg
from modules.calibration_lookup.src.alg import GetCalibrations
from modules.Utils.config_parser import ConfigHandler
from astropy.time import Time

Expand All @@ -15,6 +16,8 @@
# from kpfpipe.primitives.level0 import KPF0_Primitive
# from kpfpipe.models.level0 import KPF0

DEFAULT_CALIBRATION_CONFIG = '/code/KPF-Pipeline/modules/calibration_lookup/configs/default.cfg'

mask_file_map = {
'F9_espresso': ('F9_espresso.txt', 'air'),
'G2_espresso': ('G2.espresso.mas', 'air'),
Expand Down Expand Up @@ -150,6 +153,7 @@ def __init__(self, config=None, logger=None, l1_data=None, bc_time=None, bc_per
self.star_config_file = None
self.vel_span_pixel = None
self.mask_orderlet = dict()
self.config = config

@staticmethod
def ret_status(msg='ok'):
Expand Down Expand Up @@ -293,7 +297,12 @@ def init_star_from_header(self):
if fobj == RadialVelocityAlgInit.KEY_SKY_OBJ and sci_mask is not None and 'espresso' in sci_mask.lower():
default_mask = 'G2_espresso'

self.mask_path = stellar_dir + mask_file_map[default_mask][0]
if default_mask == 'etalon':
cals = GetCalibrations(self.pheader['DATE-MID'], DEFAULT_CALIBRATION_CONFIG).lookup()
self.mask_path = cals['etalon_mask']
else:
self.mask_path = stellar_dir + mask_file_map[default_mask][0]

self.mask_type = default_mask
self.mask_wavelengths = mask_file_map[default_mask][1]
self.mask_orderlet[fobj] = {"obj": fiber_obj,
Expand Down

0 comments on commit 86d86fa

Please sign in to comment.