Skip to content
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

Merged
merged 6 commits into from Oct 2, 2015

Conversation

PaulPrice
Copy link
Contributor

Goals:

  • Have something to ingest calibration data and create a calibration registry (calibRegistry.sqlite3)
  • Add mapping class calibration into DecamMapper and make butler able to get bias/flat/fringe.
  • Include calib in testdata_decam and add to the unit test retrieving calib data.

return ccdnum

def translate_date(self, md):
"""Convert a full DATE-OBS to a mere date or return unknown
Copy link
Member

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.

@hsinfang hsinfang force-pushed the tickets/DM-3766 branch 2 times, most recently from 3b7d918 to 006766f Compare September 29, 2015 19:20
"""
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)
Copy link
Member

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.

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.

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.
Copy link
Member

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.

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)
Copy link
Member

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.

@hsinfang hsinfang force-pushed the tickets/DM-3766 branch 3 times, most recently from 02f8bf7 to 74f9fb6 Compare September 30, 2015 23:13
Hsin-Fang Chiang added 3 commits October 1, 2015 09:11
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.
@hsinfang hsinfang merged commit 99726a8 into master Oct 2, 2015
@ktlim ktlim deleted the tickets/DM-3766 branch August 25, 2018 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants