Skip to content

Commit

Permalink
Changed aperture name
Browse files Browse the repository at this point in the history
  • Loading branch information
s-goldman committed Oct 26, 2023
1 parent 1641c9b commit dc1cfcf
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions drizzlepac/haputils/processing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ def refine_product_headers(product, total_obj_list):
phdu['filter'] = get_acs_filters(hdu, delimiter=';')

# WFPC2 update aperture if in poller file
if (total_obj_list[0].aperture != 'empty_aperture') & (phdu['instrume'] =='WFPC2'):
log.info(f"Updating aperture header keyword from {phdu['aperture']} to {total_obj_list[0].aperture}")
phdu['aperture'] = total_obj_list[0].aperture
if (total_obj_list[0].aperture_from_poller != 'empty_aperture') & (phdu['instrume'] =='WFPC2'):
log.info(f"Updating aperture header keyword from {phdu['aperture']} to {total_obj_list[0].aperture_from_poller}")
phdu['aperture'] = total_obj_list[0].aperture_from_poller

Check warning on line 176 in drizzlepac/haputils/processing_utils.py

View check run for this annotation

Codecov / codecov/patch

drizzlepac/haputils/processing_utils.py#L175-L176

Added lines #L175 - L176 were not covered by tests
else:
log.debug("Not updating aperture keyword.")

Expand Down
38 changes: 19 additions & 19 deletions drizzlepac/haputils/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class HAPProduct:
"""

def __init__(
self, prop_id, obset_id, instrument, detector, aperture, filename, filetype, log_level
self, prop_id, obset_id, instrument, detector, aperture_from_poller, filename, filetype, log_level
):
# set logging level to user-specified level
log.setLevel(log_level)
Expand All @@ -79,7 +79,7 @@ def __init__(
self.obset_id = obset_id
self.instrument = instrument
self.detector = detector
self.aperture = aperture
self.aperture_from_poller = aperture_from_poller
self.filetype = filetype
self.rules_file = None
self.basename = (
Expand Down Expand Up @@ -537,13 +537,13 @@ class TotalProduct(HAPProduct):
"""

def __init__(
self, prop_id, obset_id, instrument, detector, aperture, filename, filetype, log_level
self, prop_id, obset_id, instrument, detector, aperture_from_poller, filename, filetype, log_level
):
super().__init__(
prop_id, obset_id, instrument, detector, aperture, filename, filetype, log_level
prop_id, obset_id, instrument, detector, aperture_from_poller, filename, filetype, log_level
)
self.info = "_".join(
[prop_id, obset_id, instrument, detector, aperture, filename, filetype]
[prop_id, obset_id, instrument, detector, aperture_from_poller, filename, filetype]
)
self.exposure_name = filename[0:6]

Expand Down Expand Up @@ -703,18 +703,18 @@ def __init__(
obset_id,
instrument,
detector,
aperture,
aperture_from_poller,
filename,
filters,
filetype,
log_level,
):
super().__init__(
prop_id, obset_id, instrument, detector, aperture, filename, filetype, log_level
prop_id, obset_id, instrument, detector, aperture_from_poller, filename, filetype, log_level
)

self.info = "_".join(
[prop_id, obset_id, instrument, detector, aperture, filename, filters, filetype]
[prop_id, obset_id, instrument, detector, aperture_from_poller, filename, filters, filetype]
)
if filename[0:7].lower() != "metawcs":
self.exposure_name = filename[0:6]
Expand Down Expand Up @@ -851,18 +851,18 @@ def __init__(
obset_id,
instrument,
detector,
aperture,
aperture_from_poller,
filename,
filters,
filetype,
log_level,
):
super().__init__(
prop_id, obset_id, instrument, detector, aperture, filename, filetype, log_level
prop_id, obset_id, instrument, detector, aperture_from_poller, filename, filetype, log_level
)

self.info = "_".join(
[prop_id, obset_id, instrument, detector, aperture, filename, filters, filetype]
[prop_id, obset_id, instrument, detector, aperture_from_poller, filename, filters, filetype]
)
self.filters = filters
self.full_filename = self.copy_exposure(filename)
Expand Down Expand Up @@ -1017,18 +1017,18 @@ def __init__(
obset_id,
instrument,
detector,
aperture,
aperture_from_poller,
filename,
filters,
filetype,
log_level,
):
super().__init__(
prop_id, obset_id, instrument, detector, aperture, filename, filetype, log_level
prop_id, obset_id, instrument, detector, aperture_from_poller, filename, filetype, log_level
)

self.info = "_".join(
[prop_id, obset_id, instrument, detector, aperture, filename, filters, filetype]
[prop_id, obset_id, instrument, detector, aperture_from_poller, filename, filters, filetype]
)
self.filters = filters
self.full_filename = self.copy_exposure(filename)
Expand Down Expand Up @@ -1114,14 +1114,14 @@ def __init__(
obset_id,
instrument,
detector,
aperture,
aperture_from_poller,
filename,
layer,
filetype,
log_level,
):
super().__init__(
prop_id, obset_id, instrument, detector, aperture, filename, filetype, log_level
prop_id, obset_id, instrument, detector, aperture_from_poller, filename, filetype, log_level
)

filter_str = layer[0]
Expand Down Expand Up @@ -1350,14 +1350,14 @@ def __init__(
obset_id,
instrument,
detector,
aperture,
aperture_from_poller,
skycell_name,
layer,
filetype,
log_level,
):
super().__init__(
prop_id, obset_id, instrument, detector, aperture, skycell_name, filetype, log_level
prop_id, obset_id, instrument, detector, aperture_from_poller, skycell_name, filetype, log_level
)
# May need to exclude 'filter' component from layer_str
filter_str = layer[0]
Expand All @@ -1375,7 +1375,7 @@ def __init__(
layer_scale = layer[1]

self.info = "_".join(
["hst", skycell_name, instrument, detector, aperture, filter_str, layer_str]
["hst", skycell_name, instrument, detector, aperture_from_poller, filter_str, layer_str]
)
self.exposure_name = skycell_name
self.cell_id = skycell_name.strip("skycell-")
Expand Down

0 comments on commit dc1cfcf

Please sign in to comment.