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-11326: CameraMapper: add <exposure>_dims dataset #54

Merged
merged 1 commit into from Jul 24, 2017

Conversation

PaulPrice
Copy link
Contributor

This allows the user to retrieve the size of an image without
retrieving the image itself, or assuming it's FITS under the
covers.

@PaulPrice PaulPrice requested a review from parejkoj July 20, 2017 01:57
md = afwImage.readMetadata(location.getLocationsWithRoot()[0])
return afwGeom.Extent2I(md.get("NAXIS1"), md.get("NAXIS2"))
setMethods("dims", bypassImpl=dimsBypass)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move the setMethods call outside of the if...elif block?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, they're different.

@TallJimbo
Copy link
Member

Instead of _dims, could we just add _bbox and get the dimensions from that?

@PaulPrice
Copy link
Contributor Author

Good idea.

New implementation to come soon....

Copy link
Collaborator

@parejkoj parejkoj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment on variable names.

Question: this should work for dataRef.get('calexp_bbox)`?

@@ -423,6 +423,15 @@ def setMethods(suffix, mapImpl=None, bypassImpl=None, queryImpl=None):
bypassImpl=lambda datasetType, pythonType, location, dataId:
afwImage.Filter(
afwImage.readMetadata(location.getLocationsWithRoot()[0])))
setMethods("bbox", bypassImpl=lambda dsType, pyType, location, dataId:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the examples above use datasetType and pythonType: that's better than an unnecessary abbreviation. And the same below.

@PaulPrice
Copy link
Contributor Author

Fixed the variable names.

Yes, this should allow you to do dataRef.get("calexp_bbox").

This allows the user to retrieve the bounding box of an image
without retrieving the image itself, or assuming it's FITS under
the covers.
@PaulPrice PaulPrice merged commit aa8612d into master Jul 24, 2017
@ktlim ktlim deleted the tickets/DM-11326 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
4 participants