[AstroPy] Changing dimensionality of WCS

David Berry d.berry at jach.hawaii.edu
Tue Sep 24 14:49:05 EDT 2013

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


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


I know pyast is not astropy, but I point these out in case ideas are
need for how to approach these issues.


More information about the AstroPy mailing list