New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DM-3766: Add Butler access to calibration data in obs_decam #5
Conversation
7768ac8
to
9f58d82
Compare
return ccdnum | ||
|
||
def translate_date(self, md): | ||
"""Convert a full DATE-OBS to a mere date or return unknown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd prefer a description along the lines of:
Extract the date as a string in format YYYY-MM-DD from the supplied FITS header. Returns "unknown" if the DATE-OBS header can not be located.
3b7d918
to
006766f
Compare
""" | ||
if md.exists("DATE-OBS"): | ||
date = md.get("DATE-OBS").strip() | ||
date = re.search('^(\d\d\d\d-\d\d-\d\d)T', date).group(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If for some reason the regexp doesn't match I think this will blow up when you try to extract group 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes thanks! And it couldn't extract a date in ISO format either. Corrected with try/except.
006766f
to
ae4ba49
Compare
def translate_date(self, md): | ||
"""Extract the date or date-time string in ISO 8601 format | ||
from the supplied FITS header and return a mere date. | ||
Return "unknown" if the DATE-OBS header can not be located. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the docs to also indicate that "unknown" will be returned if the header is there but is corrupt.
ae4ba49
to
0e47a44
Compare
if md.exists("DATE-OBS"): | ||
date = md.get("DATE-OBS") | ||
try: | ||
date = re.search('(\d\d\d\d-\d\d-\d\d)', date).group(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the logic might be more obvious if it was something like
found = re.search('(\d....)', date)
if found:
date = found.group(1)
else:
self.log.warn()
date = "unknown"
rather than trying and catching.
02f8bf7
to
74f9fb6
Compare
Add DecamCalibsParseTask for parsing DECam Community-Pipeline calibration products, including nightly-MasterCal bias/flat from NOAO Archive, and master fringe from CP website. Files from the two sources have different formats (MEF one HDU for each detector, or one single-HDU fits for each detector) and header keywords.
- Add calibration dataset types bias/flat/fringe in policy. - Add methods to standardize them to Exposure. - Add tests to retrieve flat/bias/fringe with Butler.
74f9fb6
to
36b969c
Compare
Otherwise the dry-run option would not work. DM-3668.
36b969c
to
99726a8
Compare
Goals: