[AstroPy] Changing dimensionality of WCS

James Turner jturner at gemini.edu
Tue Sep 24 16:39:19 EDT 2013

> Keep in mind that something like this will only work if the coordinates being sliced are separable. For example, if the WCS involve a rotation of x,y, it doesn't make much sense to extract the wcs for x only since it requires as input both coordinates.
> Given that, I'm not sure slicing is a good approach. This would need some careful thought as far as a user interface goes (sure, you can raise an exception when it doesn't work, but is there a simple way to see what coordinates are coupled?)

Hmmm, yes, but it seems to me that the right behaviour is still
well defined in that case (you have to keep any World co-ordinates
that vary along the remaining axes, convert any dependence on axes
that no longer exist into constants and update the zero points
according to that and what subsections were used). Presumably you
can scan the WCS coefficients to find out which axes each world
co-ordinate depends on and I suppose if you eliminate an axis
parallel to a World co-ordinate then you could retain that World
co-ordinate as a constant value until asked to reduce it?

Maybe I'm oversimplifying something but if I were to slice an
nddata object and the WCS didn't get updated accordingly (like
happens in IRAF, at least most of the time) I'd be disappointed!
(I expect this will be relevant to our work at some point, so
maybe I'll get to contribute something more than suggestions).
That doesn't mean that slicing should be the only way to get a
lower-dimensional WCS though.



> Perry
> On Sep 24, 2013, at 4:06 PM, James Turner wrote:
>> I don't know the answer re. astropy.wcs but it would be good if
>> one could ultimately slice an nddata object and have the
>> dimensionality and WCS reduced automatically if applicable (a bit
>> like in IRAF but, hopefully, better) :-). It seems that an NDData
>> can already be sliced directly but "support for WCS and units is
>> not yet implemented". Maybe some more WCS manipulation routines
>> are needed first...
>> Cheers,
>> James.
>> On 24/09/13 15:49, David Berry wrote:
>>> On 24 September 2013 19:23, Adam Ginsburg <adam.ginsburg at colorado.edu> wrote:
>>>> When working with data cubes, I often need to extract WCS information
>>>> for 1 or 2 of the WCS dimensions.   The docs
>>>> (http://docs.astropy.org/en/latest/wcs/index.html) give decent
>>>> examples of how to generate a WCS from scratch, but I don't see any
>>>> obvious way to extract a lower-dimensional WCS from a WCS.  Does such
>>>> functionality exist?  If not, does it make sense to generate a WCS
>>>> from scratch and copy over just the relevant parameters?
>>> This is an example of the general problem - given two arbitrary
>>> coordinate systems, one with N axes and one with M axes, is there a
>>> transformation between them, and if so, what is it? It is addressed in
>>> pyast by the "convert" method. If you need ideas for an API see
>>> http://starlink.jach.hawaii.edu/docs/sun211.htx/node245.html
>>> Implementing this sort of feature in a general way is tricky but can
>>> be done. For simpler cases where you just want to pick a specified
>>> subset or superset of axes from a coordinate system, pyast uses
>>> "pickaxes". See
>>> http://starlink.jach.hawaii.edu/docs/sun211.htx/node348.html
>>> I know pyast is not astropy, but I point these out in case ideas are
>>> need for how to approach these issues.
>>> David
>>> _______________________________________________
>>> AstroPy mailing list
>>> AstroPy at scipy.org
>>> http://mail.scipy.org/mailman/listinfo/astropy
>> _______________________________________________
>> AstroPy mailing list
>> AstroPy at scipy.org
>> http://mail.scipy.org/mailman/listinfo/astropy

More information about the AstroPy mailing list