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

Have sky-on-sky contains not require a wcs #295

Closed
eteq opened this issue Aug 21, 2019 · 3 comments
Closed

Have sky-on-sky contains not require a wcs #295

eteq opened this issue Aug 21, 2019 · 3 comments
Assignees
Milestone

Comments

@eteq
Copy link
Member

eteq commented Aug 21, 2019

Currently, if I do *SkyRegion.contains(skycoord), it fails, demanding a wcs. This seems strange to me. Why is a wcs needed to know if a point in sky coordinates is inside a shape in sky coordinates? Is this just a convenience to share implementations? And if so, perhaps there can be a "default" wcs that's created if non is given in the sky-on-sky case?

@larrybradley
Copy link
Member

The *SkyRegion classes are essentially convenience classes for the *PixelRegion classes. All of the real work is done with *PixelRegion classes, thus behind the scenes the *SkyRegion objects need to be converted to *PixelRegion objects. That requires a wcs object. The way *SkyRegion objects are converted to *PixelRegion objects is to do "world_to_pixel" on the central position and convert the shape parameters (e.g. radius) from angular to pixel units using the pixel scale. The *SkyRegion object is (and should be) independent of any particular WCS, thus a wcs object needs to be input to do the conversion.

All of the internal machinery uses the pixel-defined shapes. Because of distortions and projection effects, the shapes of course cannot be generally preserved in both sky and pixel coordinates, e.g. a circle defined in sky coordinates is not likely to be a circle in pixel coordinates.

@astrofrog
Copy link
Member

Note that we did used to also have true Sky regions (I think these were removed for now?) that had edges which were great circles. But yes, the current Sky regions are defined such that the edges are straight lines in the plane of an image.

@cdeil cdeil self-assigned this Oct 23, 2019
@cdeil cdeil added this to the 0.5 milestone Oct 23, 2019
@cdeil
Copy link
Member

cdeil commented Oct 23, 2019

I'm closing this issue as a duplicate of #276 -- let's discuss there and add this functionality now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants