drizzlepac
drizzlepac copied to clipboard
create_row_info crashes on non numeric obset_id
When trying to run run_hla_processing, the software crashes if the desired input file has a a non-numeric obset id. Here's the output with debug set to true:
INFO: Run start time: 2019-06-27 18:40:31.508374 INFO: 1: Apply rules to determine what exposures need to be combined into separate products INFO: Traceback (most recent call last): File "/internal/hladata/repos_dev4/drizzlepac/drizzlepac/runhlaprocessing.py", line 496, in run_hla_processing obs_info_dict = pipeline_poller_utils.interpret_obset_input(input_filename) File "/internal/hladata/repos_dev4/drizzlepac/drizzlepac/hlautils/pipeline_poller_utils.py", line 58, in interpret_obset_input obset_tree = build_obset_tree(obset_table) File "/internal/hladata/repos_dev4/drizzlepac/drizzlepac/hlautils/pipeline_poller_utils.py", line 83, in build_obset_tree row_info, filename = create_row_info(row) File "/internal/hladata/repos_dev4/drizzlepac/drizzlepac/hlautils/pipeline_poller_utils.py", line 99, in create_row_info info_list = [str(row['proposal_id']), "{:02d}".format(row['obset_id']), row['instrument'], ValueError: Unknown format code 'd' for object of type 'numpy.str_' INFO: Total processing time: 0.007558 sec INFO: 9: Return exit code for use by calling Condor/OWL workflow code: 0 (zero) for success, 1 for error condition
The line in question is here: https://github.com/spacetelescope/drizzlepac/blob/e37afedc4e88e871c322a0c0e397cae01c7ee7f2/drizzlepac/hlautils/pipeline_poller_utils.py#L99
I believe this is because the "{:02d}" doesn't work on strings with letters in them, which is the case for some of the obset ids. Since the obset id is only ever 2 characters long, im not sure it's necessary to use this formatting method. To avoid the case where an obset of 07 would get turned to just 7, I think it's better to use the zfill() method:
7.zfill(2) returns '07'
For what it's worth, here is my input file:
idm91ijsq_flt.fits,15117,DM9,1I,1I,452.936035,F125W,IR,idm91ijsq_flt.fits idm91ijvq_flt.fits,15117,DM9,1I,1I,302.934753,F160W,IR,idm91ijvq_flt.fits idm91ijyq_flt.fits,15117,DM9,1I,1I,352.935181,F105W,IR,idm91ijyq_flt.fits idm91ik0q_flt.fits,15117,DM9,1I,1I,352.935181,F105W,IR,idm91ik0q_flt.fits idm91ik3q_flt.fits,15117,DM9,1I,1I,352.935181,F125W,IR,idm91ik3q_flt.fits idm91ik5q_flt.fits,15117,DM9,1I,1I,502.936462,F160W,IR,idm91ik5q_flt.fits