Repository navigation
Expand documentation for now APE14 WCS API - #7962
Conversation
… in fact be used to access data
|
Hi there @astrofrog 👋 - thanks for the pull request! I'm just a friendly 🤖 that checks for issues related to the changelog and making sure that this pull request is milestoned and labeled correctly. This is mainly intended for the maintainers, so if you are not a maintainer you can ignore this, and a maintainer will let you know if any action is required on your part 😃. Everything looks good from my point of view! 👍 If there are any issues with this message, please report them here. |
eteq
left a comment
There was a problem hiding this comment.
A few minor and a few larger suggestions. Note that I'm using this as an excuse to experiment with the new "suggest" thingie, so sorry if this ends up annoying @astrofrog.
| the method or property used, and this can normally be determined from the | ||
| property or method name. Properties and methods containing ``pixel`` assume | ||
| ``(x, y)`` ordering, while properties and methods containing ``array`` assume | ||
| ``(row, column)`` ordering. |
There was a problem hiding this comment.
I find this a bit confusing. In my head "x" and "y" are the same thing as "row" and "column". Am I right that what we really mean is "the in-memory representation on the array" vs "the conceptual order of dimensions exposed to the user in the WCS itself"? That's a bit too wordy, but something in that direction? I think it's fine to use "row"/"column" vs "x"/"y", but only once you've defined what that means a bit more.
There was a problem hiding this comment.
Would it help to say:
Properties and methods containing ``pixel`` assume
``(x, y)`` or ``Carstesian`` ordering, while properties and methods containing ``array`` assume
``(row, column)`` or ``numpy array`` ordering.
There was a problem hiding this comment.
I guess that doesn't help because as our discussions revealed, I don't really get what "Cartesian ordering" means: to me "Cartesian" means "the metric is s^2 = x^2 + y^2", which is true regardless of the ordering. And "numpy array" also doesn't help because it can be both fortran or C ordered.
If preferred I can write the words on it... once I actually have right in my head which is supposed to be which 😉
There was a problem hiding this comment.
I'll push some changes soon that are similar to @nden's suggestion.
| =========== | ||
|
|
||
| Let's take a look at the shared Python interface for WCS by using a spectral | ||
| cube (two celestial axes and one spectral axis):: |
There was a problem hiding this comment.
This doesn't feel like "Basic" usage - a cube is pretty darn complex. What about starting with a simpler case of just an image and just show how world_to_pixel and pixel_to_world work (along with some of the informational bits you're demonstrating)? Then make this be "Advanced usage" or similar
|
One quick thing not directly related to the review: @nden - can you confirm the |
Co-Authored-By: astrofrog <[email protected]>
Co-Authored-By: astrofrog <[email protected]>
Co-Authored-By: astrofrog <[email protected]>
|
@eteq - I think this is ready for a final review/merge |
|
@eteq In gwcs I have a setter for |
|
Here's a potential issue with not having setters for |
|
@nden - we can easily add setters on the FITS WCS mix-in, but I think it would make more sense for you to do it in a separate PR as you know how best to set |
add shape setters
|
@eteq I added |
|
Ok so at this point this just needs a suggestion from @eteq on improving wording about the pixel convention stuff - but this can be merged without that change if it comes to it, as that can be clarified after feature freeze. |
|
Yeah, I agree with @astrofrog that it's better to merge this and we can have a follow-on clarifying PR if/when we get to it. Presumably this wording works for some people. (At the very least, people that think like @nden and @astrofrog, so it's definitely better than nothing!) |
This adds some basic usage docs for the new WCS APE 14 API
One important addition - it implements
WCS.array_shapewhich means that we'll finally be able to close e.g. #5461 or #4669 - at least I think.Hey @drdavella - I really could do with scientific-python/pytest-doctestplus#2 here 😉 (not critical for the PR as I've just put
+REMOTE_DATAeverywhere, just pointing out a good use case!)Once the CI runs, there will be a link to preview the docs (from 'giles') in the status checks below.
Direct link to docs preview