From 179ba6d2aa63183d7ddb0d750f4e2ed4c7ab4516 Mon Sep 17 00:00:00 2001 From: SunilSimha Date: Sun, 16 Jan 2022 02:59:46 -0800 Subject: [PATCH] process imaging data taken with FILTER2 --- goodman_pipeline/core/core.py | 8 +++++++- goodman_pipeline/images/night_organizer.py | 11 +++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/goodman_pipeline/core/core.py b/goodman_pipeline/core/core.py index ff54d0ba..54d8f09a 100644 --- a/goodman_pipeline/core/core.py +++ b/goodman_pipeline/core/core.py @@ -2319,7 +2319,13 @@ def name_master_flats(header, + '.fits' elif technique == 'Imaging': - flat_filter = re.sub('[- ]', '_', header['FILTER']) + if header['FILTER'] != 'NO_FILTER': + flat_filter = header['FILTER'] + elif header['FILTER2'] != 'NO_FILTER': + flat_filter = header['FILTER2'] + else: + flat_filter = "NO_FILTER" + flat_filter = re.sub('[- ]', '_', flat_filter) flat_filter = re.sub('[<> ]', '', flat_filter) master_flat_name += '_' + flat_filter + dome_sky + '.fits' diff --git a/goodman_pipeline/images/night_organizer.py b/goodman_pipeline/images/night_organizer.py index 6696afcf..3f34af0f 100644 --- a/goodman_pipeline/images/night_organizer.py +++ b/goodman_pipeline/images/night_organizer.py @@ -399,13 +399,14 @@ def imaging_night(self): # confs stands for configurations confs = flat_data.groupby( ['object', - 'filter']).size().reset_index().rename(columns={0: 'count'}) + 'filter', 'filter2']).size().reset_index().rename(columns={0: 'count'}) for i in confs.index: flat_group = flat_data[ ((flat_data['object'] == confs.iloc[i]['object']) & - (flat_data['filter'] == confs.iloc[i]['filter']))] + (flat_data['filter'] == confs.iloc[i]['filter']) & + (flat_data['filter2'] == confs.iloc[i]['filter2']))] self.data_container.add_day_flats(flat_group) @@ -417,12 +418,14 @@ def imaging_night(self): # confs stands for configurations confs = science_data.groupby( ['object', - 'filter']).size().reset_index().rename(columns={0: 'count'}) + 'filter', + 'filter2']).size().reset_index().rename(columns={0: 'count'}) for i in confs.index: science_group = science_data[ ((science_data['object'] == confs.iloc[i]['object']) & - (science_data['filter'] == confs.iloc[i]['filter']))] + (science_data['filter'] == confs.iloc[i]['filter']) & + (science_data['filter2'] == confs.iloc[i]['filter2']))] self.data_container.add_data_group(science_group)