Skip to content

Commit

Permalink
Better logging. Fix param def. Allow empty dark file list
Browse files Browse the repository at this point in the history
  • Loading branch information
bhilbert4 committed Sep 22, 2023
1 parent 1834232 commit 2f0e825
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 4 additions & 3 deletions jwql/instrument_monitors/common_monitors/bad_pixel_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -984,9 +984,10 @@ def process(self, illuminated_raw_files, illuminated_slope_files, flat_file_coun
else:
index += 1

min_dark_time = min(dark_obstimes)
max_dark_time = max(dark_obstimes)
mid_dark_time = instrument_properties.mean_time(dark_obstimes)
if len(dark_slope_files) > 0:
min_dark_time = min(dark_obstimes)
max_dark_time = max(dark_obstimes)
mid_dark_time = instrument_properties.mean_time(dark_obstimes)

# Check whether there are still enough files left to meet the threshold
if illuminated_slope_files is None:
Expand Down
8 changes: 6 additions & 2 deletions jwql/shared_tasks/run_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import shutil
import sys
import time
import traceback

from jwst import datamodels
from jwst.dq_init import DQInitStep
Expand Down Expand Up @@ -161,7 +162,8 @@ def run_pipe(input_file, short_name, work_directory, instrument, outputs, max_co
with open(status_file, "a+") as status_f:
status_f.write("EXCEPTION\n")
status_f.write("{}\n".format(e))
status_f.write("FAILED")
status_f.write("FAILED\n")
status_f.write(traceback.format_exc())
sys.exit(1)

with open(status_file, "a+") as status_f:
Expand Down Expand Up @@ -217,6 +219,7 @@ def run_save_jump(input_file, short_name, work_directory, instrument, ramp_fit=T
params['refpix'] = dict(odd_even_rows=False)

# Default CR rejection threshold is too low
params['jump'] = {}
params['jump']['rejection_threshold'] = 15

# Set up to save jump step output
Expand Down Expand Up @@ -284,7 +287,8 @@ def run_save_jump(input_file, short_name, work_directory, instrument, ramp_fit=T
with open(status_file, "a+") as status_f:
status_f.write("EXCEPTION\n")
status_f.write("{}\n".format(e))
status_f.write("FAILED")
status_f.write("FAILED\n")
status_f.write(traceback.format_exc())
sys.exit(1)

with open(status_file, "a+") as status_f:
Expand Down

0 comments on commit 2f0e825

Please sign in to comment.