# calibrateTask.py example broken

## Details

• Type: Story
• Status: Done
• Priority: Major
• Resolution: Done
• Fix Version/s: None
• Component/s:
• Labels:
• Templates:
• Story Points:
1
• Sprint:
DRP S17-1
• Team:
Data Release Production

## Description

As reported by Mandeep Gill this currently fails as follows:

 RuntimeError: No such FITS catalog file: /tigress/HSC/LSST/stack_20160915/Linux64/obs_test/12.1-9-g3e397f1+2/data/input/schema/icSrc.fits 

In addition to that, the code also attempts to pass a VisitInfo to an ExposureF constructor, which fails.

## Activity

Hide
John Swinbank added a comment -

Work arounds for both issues:

 --- a/examples/calibrateTask.py +++ b/examples/calibrateTask.py @@ -56,7 +56,10 @@ def loadData(pixelScale=1.0):  imFile = os.path.join(mypath, "CFHT", "D4", "cal-53535-i-797722_small_1.fits")    visitInfo = afwImage.makeVisitInfo(exposureTime=1.0) - exposure = afwImage.ExposureF(imFile, visitInfo) + exposureInfo = afwImage.ExposureInfo() + exposureInfo.setVisitInfo(visitInfo) + exposure = afwImage.ExposureF(imFile) + exposure.setInfo(exposureInfo)  # add a filter  afwImage.Filter.define(afwImage.FilterProperty(FilterName, 600, True))  exposure.setFilter(afwImage.Filter(FilterName)) @@ -125,7 +128,7 @@ def run(display=False):    config = CalibrateTask.ConfigClass()  config.astrometry.retarget(MyAstrometryTask) - calibrateTask = CalibrateTask(butler, config=config) + calibrateTask = CalibrateTask(config=config)    # load the data  # Exposure ID and the number of bits required for exposure IDs are usually obtained from a data repo, 

Show
Hide
John Swinbank added a comment - - edited

Hey Russell Owen, do you have time to review this, please? The changes are quite modest; I don't imagine it'll take more than a few minutes.

I think it's all straightforward enough, but, as per my post on CLO I wonder if there's an easier way to add the visitInfo to the exposure. If you have any suggestions, that would be much appreciated.

Pull request is here.

Show
John Swinbank added a comment - - edited Hey Russell Owen , do you have time to review this, please? The changes are quite modest; I don't imagine it'll take more than a few minutes. I think it's all straightforward enough, but, as per my post on CLO I wonder if there's an easier way to add the visitInfo to the exposure . If you have any suggestions, that would be much appreciated. Pull request is here .
Hide
Russell Owen added a comment -

Looks good. A few minor changes suggested on github.

Show
Russell Owen added a comment - Looks good. A few minor changes suggested on github.
Hide
John Swinbank added a comment -

Thank you! Now merged.

Show
John Swinbank added a comment - Thank you! Now merged.

## People

• Assignee:
John Swinbank
Reporter:
John Swinbank
Reviewers:
Russell Owen
Watchers:
John Swinbank, Mandeep Gill [X] (Inactive), Russell Owen