-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Initial implementation of CircleSkyRegion.to_pixel in full mode #91
Conversation
56c854c
to
888990c
Compare
@astrofrog - Thanks! This is what you currently do in
There's clearly two steps:
@adonath and I think that computing the sky polygon approximation should be a separate method
If it's a separate method, testing would be easy: compute the sky separate of the SkyPolygonRegion to the circle center --- they should all be equal to the radius. I'm not convinced that this: sky_circle.to_pixel(wcs, mode='full', <other pars for precision>) is better than sky_circle.to_poly(<pars for precision>).to_pixel(wcs) We can discuss whether |
FYI: I've put this on the 0.2 milestone. |
@cdeil - done (I called it |
@astrofrog - Thanks! Do you want to add a test or docs example here? As far as I can see for several sky regions (rectangle, ellipse) the Or we merge and discuss next week in the hangout ... |
4b9bfb1
to
d775e2b
Compare
@cdeil - no time to add docs/tests here unfortunately. If you'd like to merge anyway, that works for me. |
I'll merge this now, because it's key functionality for debugging sky region plotting. Just for the record: currently |
Yep, let's discuss this on the telecon. |
Thank you! |
This will likely require some more discussion, but it is a first implementation of the
full
mode inCircleSkyRegion.to_pixel
based on the code in WCSAxes. Basically we start by setting up a spherical circle with the right radius and then rotating it in 3D to the correct coordinates, then converting the polygon to pixel coordinates.The main point I'd like to discuss is how to set the precision of this conversion. At the moment, the API specifies
tolerance
but that is ill defined, and requiring a final tolerance in pixel space would require iterating. Instead, I think we could do what I'm doing here and have a parameter that specifies the number of points to use in the polygon since in full mode the shapes always get converted to a polygon. I think in that case we should rename fromtolerance
to something else. This is much easier to implement.Here's an example of this code in action:
This also needs some kind of tests of course - not sure what the best way to test this would be?
@cdeil - obviously this doesn't have to go in 0.2, so no need to wait for it.