Repository navigation
More WCS convenience functions: pixel_scale, celestial - #2832
Conversation
|
cc @astrofrog too To any: are there cases I might be missing? i.e., are there occasions in which EDIT: There are errors here - this only works if the pixels are aligned with the grid at the moment |
There was a problem hiding this comment.
From experience with APLpy, I think the correct approach is:
This was the result of many iterations :)
|
I have mixed feelings about this - strictly speaking the pixel scale changes over the image with the exception of the |
|
Good points @astrofrog, I'll address these comments. I am a bit tired of having to recalculate pixel scale "from scratch" all the time; for the vast majority of my work the square-pixel approximation is perfect. But, I concede the point that the pixel size is not uniform, so a warning will be included. However, I must be writing my test incorrectly, because I get a failure for a filled CD matrix when trying the aplpy approach. |
There was a problem hiding this comment.
This doesn't work: recwarn.list is empty. Why?
|
@astrofrog ready for final review |
|
@keflavich - will review this later today, but what do you think of my suggestion of moving these into |
|
I don't like the idea of moving these to However, renaming sounds appropriate - it's a bit verbose, but that's OK. |
|
@keflavich what about |
|
@astrofrog - that sounds good. Might be worth bouncing it off one or two others... just ask someone down the hall what they think |
|
@keflavich - I was thinking about this some more and I really do think that while |
|
That last bit is a pretty good idea, and easy to implement - what should we call it? I guess I can move |
|
@keflavich - not sure if I'd call it +1 to |
|
Added the matrix. No time for tests now. |
There was a problem hiding this comment.
Here I think you can then make use of the pixel scale matrix?
|
@nden - since you are familiar with the WCS code, do you have any thoughts on this pull request so far? |
|
What would be nice in future would be to have a way of computing the pixel scale at a specific position. This would then make it easy to check how much the pixel scale is changing over the image and emit a warning if needed. |
|
It looks good to me. I think it makes sense to name the function |
|
@astrofrog - this includes many of the changes from aplpy/aplpy#211 now and is much more flexible. Can anyone provide a sanity check on the test parameters? |
There was a problem hiding this comment.
pixel_scale -> pixel_scale_matrix
|
Bump - this is ready for review. |
|
Cool! |
More WCS convenience functions: pixel_scale, celestial
Some more WCS convenience attributes:
wcs.pixel_scalereturns the pixel scale ("plate scale") in degrees in the celestial dimensions if the pixels are symmetric (otherwise, it raises an exception)wcs.celestialreturns a copy of the celestial component of the WCSQuestion: Should
wcs.pixel_scalereturn aQuantity?cc @mdboom