[AstroPy] FITS cube with Faraday depth axis

Adam Ginsburg adam.g.ginsburg at gmail.com
Fri Mar 23 20:09:22 EDT 2018

Hi Alex,
    The axis type recognition happens in the underlying wcslib library.  Is
there a standard for the RM axis in the FITS standard?  If so, we should
implement it, and you should raise an issue on spectral-cube for us to do
that (https://github.com/radio-astro-tools/spectral-cube/).
    If not, though, I think the hack approach you've taken is the best we
can do.  We could also add your hack to spectral-cube and force it to
interpret an 'RM' axis as some sort of spectral type, but I'm not sure how
to handle units and we would have to disable spectral axis conversion.

    In any case, I suggest taking this off the astropy general list to an
Issue on spectral-cube.  We can probably figure out how to solve this

On Fri, Mar 23, 2018 at 5:58 PM, Hill, Alex <ashill at astro.ubc.ca> wrote:

> Hi all,
> I’m working with Faraday depth FITS cubes, where CTYPE3 = ‘RM’ and CUNIT3
> = ‘rad/m2'. (CTYPE1=‘GLON-CAR’ and CTYPE2=‘GLAT-CAR’.)
> I would like to treat the Faraday depth cube like a spectral cube, for
> example calculating moments.
> I’m trying to load the cube using SpectralCube.read. It fails to read
> because the RM axis is not recognized as a spectral axis. Instead, the
> coordinate type for the RM axis is None:
> w.get_axis_types()
> output:
> [{'coordinate_type': 'celestial',
>  'group': 0,
>  'number': 0,
>  'scale': 'non-linear celestial'},
> {'coordinate_type': 'celestial',
>  'group': 0,
>  'number': 1,
>  'scale': 'non-linear celestial'},
> {'coordinate_type': None, 'group': 0, 'number': 0, 'scale': 'linear'}]
> I can hack it to work by loading the FITS header and changing the RM axis
> to a velocity axis:
> hdr['CTYPE3'] = 'VELO-LSR'
> hdr['CUNIT3'] = 'm/s'
> w = wcs.WCS(hdr)
> and then pass the data and hacked header to SpectralCube.
> However, is there a way to cleanly recognize a Faraday depth axis as a
> spectral axis?
> It looks to me like this would be somewhere in the WCS class, but I can’t
> find where in the code VELO-LSR, for example, gets recognized as a spectral
> axis.
> Cheers,
> Alex
> ---------
> Alex Hill
> University of British Columbia and Space Science Institute
> email: ashill at astro.ubc.ca
> Based at
> Dominion Radio Astrophysical Observatory, National Research Council Canada
> Mailing: PO Box 248, Penticton, BC V2A 6K3, Canada
> Physical: 717 White Lake Road, Kaleden, BC V0H 1K0, Canada
> phone: +1 250-497-2356
> _______________________________________________
> AstroPy mailing list
> AstroPy at python.org
> https://mail.python.org/mailman/listinfo/astropy

Adam Ginsburg
Jansky fellow, National Radio Astronomy Observatory
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20180323/96999356/attachment.html>

More information about the AstroPy mailing list