Skip to content

Commit

Permalink
This ticket is just a bit of tightening up of Python code. (#1871)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdlpstsci authored Aug 21, 2024
1 parent 06ccc9e commit d345a84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions drizzlepac/hapsequencer.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ def create_catalog_products(total_obj_list, log_level, diagnostic_mode=False, ph
# used for the creation of this particular total detection image.
# Accummulate the number of exposures per filter and the corresponding
# exposure time.
#pdb.set_trace()
for edp in total_product_obj.edp_list:
if edp.filters not in n1_dict:
n1_dict[edp.filters] = {'n': 1, 'texptime': edp.exptime}
Expand All @@ -208,10 +207,8 @@ def create_catalog_products(total_obj_list, log_level, diagnostic_mode=False, ph
# If the total detection image is comprised of more than one
# exposure in at least one filter...
filter_info = n1_dict.values()
if max([x['n'] for x in n1_dict.values()]) > 1:
for values in filter_info:
if values['n'] > 1:
tot_exposure_time += values['texptime']
if max(x['n'] for x in filter_info) > 1:
tot_exposure_time = sum(values['texptime'] for values in filter_info if values['n'] > 1)
# ...else if the the detection images is comprised of single
# filter exposures
else:
Expand Down
4 changes: 2 additions & 2 deletions drizzlepac/haputils/catalog_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def compute_background(self, box_size, win_size,
log.info("")

# Compute a minimum rms value based upon information directly from the data
if self.keyword_dict["detector"].upper() != "SBC":
if self.keyword_dict["detector"].upper() not in ['IR', 'SBC']:
minimum_rms = self.keyword_dict['atodgn'] * self.keyword_dict['readnse'] \
* self.keyword_dict['ndrizim'] / self.keyword_dict['texpo_time']

Expand Down Expand Up @@ -704,7 +704,7 @@ def verify_crthresh(self, n1_exposure_time):
log.info("{} catalog FAILED CR threshold.".format(cat_type))

# Ensure if any catalog is rejected, the remaining catalogs are also rejected
if any([True for k,v in self.reject_cats.items() if v == True]):
if any(self.reject_cats.values()):
for k in self.reject_cats.keys():
self.reject_cats[k] = True

Expand Down

0 comments on commit d345a84

Please sign in to comment.