-
Notifications
You must be signed in to change notification settings - Fork 10
Description
Hi, I recently got an error while reducing data, where the code crashed because the DATE-OBS header key wasn't in the expected format. See the traceback below. While I don't know if adding the time to the DATE-OBS value, via the "Thh:mm:ss.s" added to the end of the string is fits standard, I have definitely seen this format several times. The fix is a super-simple change to dar.py - in line 324 in the version on the dev branch or line 325 in the version on the main branch:
Just change day = int(date[2]) ---> day = int(date[2][:2])
I've done this in my local version of KAI, but since the change is so quick, you can probably put it in the distributed version without any trouble.
Traceback (last few lines)
data.clean_drizzle(distXgeoim, distYgeoim, _bp, _ce, _wgt, _dlog,
File "/Users/cdf/git/KAI/kai/reduce/data.py", line 2458, in clean_drizzle
(_xgeoim, _ygeoim) = dar.darPlusDistortion(
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/cdf/git/KAI/kai/reduce/dar.py", line 406, in darPlusDistortion
(darCoeffL, darCoeffQ) = kaidar(inputFits, instrument=instrument,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/cdf/git/KAI/kai/reduce/dar.py", line 324, in kaidar
day = int(date[2])
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: '28T00:00:00.0'