Skip to content

Commit

Permalink
Merge pull request #363 from SunilSimha/img_filter2_hotfix
Browse files Browse the repository at this point in the history
process imaging data taken with FILTER2
  • Loading branch information
simontorres committed Jan 18, 2022
2 parents f99ebec + 179ba6d commit 690ec7d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
8 changes: 7 additions & 1 deletion goodman_pipeline/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
11 changes: 7 additions & 4 deletions goodman_pipeline/images/night_organizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

0 comments on commit 690ec7d

Please sign in to comment.