Repository navigation
Change a few method names in astropy.wcs - #210
Conversation
|
(another possibility would be to use |
|
+1 This seems more understandable... |
|
We had a discussion way back when all this was first written. It was decided to be take this more explicit approach because the SIP and distortion image transformations are not invertible (they could be iteratively, but at present the code doesn't allow that), and it was deemed confusing that I think the naming change from |
|
Ok - I'll defer to you regarding keeping the methods separate or combining, as I don't feel too strongly about that. I guess I'm trying to think more about what will happen when we want to start implementing other WCS types, as we'll probably want a common API for all WCS objects. What would the lowest common denominator be for all these classes - the presence of |
Since the old `wcs_pix2sky` and `wcs_sky2pix` methods are being retained for backward compatibility, the `@deprecated` decorator was moved from `io.fits` to `utils.misc` and all mentions of it from `io.fits` were updated.
|
If we implement other WCS types, they won't be WCS any longer, right? I tend to think of WCS as the format defined in the FITS WCS documents -- there's lots of other ways to transform to/from world coordinates, but I wouldn't want to call them WCS for the sake of confusion. Maybe what we need to think of is a "Transformation" ABC that has |
|
Regarding other transformation classes, the current implementation of NDData (https://github.com/astropy/astropy/blob/master/astropy/nddata/nddata.py) has a For example, one could imagine having a tool to plot a Spectrum1D object. Would that tool need to test for the type of transformation, and call different methods depending on whether it's e.g. FITS WCS, or a table or function-based transformation? Or could we provide a common API, so that tools that such tools can remain agnostic about the type of transformation? I understand that this would be possible if the full (FITS) WCS transformation was easily reversible, but I'm wondering whether the fact it's not stops us from being able to provide a common API? |
|
Just a quick thought - if we do want to reserve the name On the other hand, can we actually think of concrete examples of non-WCS transformations we might need? For instance, after digging around a bit, it does look like WCS supports table lookup transformations? |
|
@astrofrog I would have a wcs package and a subpackage called fits-wcs. What do you think? |
|
@astrofrog: I'm all for a common API to transformations -- I think we should just use the generic term "transformation" rather than "wcs". I think we agree on that, if I follow correctly. pywcs does support table lookup transformations, but it's not part of wcslib itself and I'm not aware of any other tools that support it. (Most of Paper IV remains unimplemented anywhere, but we implemented the table lookup part of it ourselves). |
|
@mdboom: I see where you're coming from with transformation (isn't that what it's called in matplotlib as well). I like world coordinate system as it specifically relates to coordinates and that's what we're implementing. Maybe "mapping" is a more appropriate term. |
|
@wkerzendorf: |
|
I agree that mapping means more a 1-to-1 relation (which is more of a specific type of transformation). After thinking about this some more, (FITS) WCS is such an integral part of astronomy that one possibility is just to keep it where it is for now, and implement more generic transformation wrapping at the level of NDData for example (since that is where it would be used). In any case, wherever we do implement the more generic transformations, I agree that Maybe we can just merge this PR for now, and open a new issue to discuss more generic transformations once there is a need for them? (so that we actually have some use cases) |
|
Agreed. Merging this and created new Issue #211. |
Change a few method names in astropy.wcs
Change a few method names in astropy.wcs
…rowding Place x ticks on major axis of elliptical frames
Provides a fix for astropy#209
Update poliastro website
As I was using pywcs/astropy.wcs this week, I realized that the main two methods are actually mis-named. Specifically, methods including
sky2pixandpix2skyare mis-named, because WCS transformations (even just for the subset of FITS-based WCS) includes e.g. spectral or time transformations, and allows for any other quantities too. Therefore,worldwould be a better name thansky.I also wonder whether we should remove the distinction between
all_pix2skyandwcs_pix2sky, and instead have two methods calledpixel2worldandworld2pixel(which gets rid of the mention ofsky), withpixel2worldhaving adistortion=True/Falsekeyword argument that can be used to switch between the behavior orall_pix2skyandwcs_pix2sky? Of course, this is easy to keep backward compatible, but I think it might be worth switching to a new API ahead of the 0.1 release since this would be easy to do, and so we don't have to change later (and we don't even have to deprecate the old methods yet, but just not document them).This new API would of course also be more suitable if we implement other kinds of WCS objects.