[AstroPy] Determining when world and pixel axes are independent

Chris Beaumont beaumont at hawaii.edu
Tue Jan 14 08:43:59 EST 2014


Hi David,

Thanks, your first point is precisely the use case I'm interested in. I
will take a look at how AST accomplishes this (alas, I need an
implementation that uses astropy WCS objects)

Cheers,
Chris


On Tue, Jan 14, 2014 at 2:47 AM, David Berry <d.berry at jach.hawaii.edu>wrote:

> Generalising a bit to an arbitrary mapping from an input N-dimensional
> coordinate system to an output M-dimensional coordinate system, I
> think the two issues here are:
>
> 1) Can the mapping be split into two or more mappings applied in
> parallel. This would usually (although not necessarily always) be the
> case for instance for a mapping from 3D pixel coordinates to a
> (ra,dec,freq) cube - the mapping could be split into two mappings, a
> 2D mapping for the spatial axes and an independent 1D mapping for the
> frequency axis.
>
> 2) If you move the input position a small distance along each input
> axis in turn, are the corresponding increments in output position
> parallel to the output axes?
>
> From experience with AST, having a method that will analyse a mapping
> into independent parallel mappings (case 1) above)  is a very useful
> tool. Issue 2) is less useful because it only tells you about the
> properties of the mapping at the specific point at which you do the
> test. There is no a priori reason why doing the test at a different
> point may not give you different answers. But if you really want to do
> this test, it's not hard to code up given a way of transforming
> arbitrary points.
>
> Regarding 1), which is much harder to code, AST has the astMapSplit
> method - see
> http://starlink.jach.hawaii.edu/devdocs/sun211.htx/node331.html
>
> The caller specifies the indicies of one or more input axes and
> astMapSplit attempt to find a mapping from the selected inputs to a
> subset of the available outputs, where each output depends only on the
> selected inputs. If the selected inputs do not form an independent
> subset, then astMapSplit  returns a null mapping.
>
> Each subclass of mapping provides its own implementation of this
> method. So for instance the MatrixMap class knows how and when a
> matrix can be split into two independent matrices, and the WcsMap (a
> class of spherical projections)   knows that no spherical projection
> can be split. Crucially, the CmpMap class (a compound mapping that
> joins other mappings together in series or parallel) provides an
> implementation of astMapSplit that knows how to apply astMapSplit to
> its component mappings and combine the results.
>
> David
>
> On 13 January 2014 20:20, Chris Beaumont <beaumont at hawaii.edu> wrote:
> > I'd be willing to accept a method which returns either "definitely
> > independent" or "might be dependent". I have a much lower tolerance for
> > accidentally saying two axes are independent if they're not.
> >
> > Tom: is there a definitive property (analogous to w.wcs.get_pc) that
> > indicates whether distortions are present, regardless of how they might
> be
> > encoded in a header?
> >
> > Regarding Perry's last point: This is probably true for images right
> from a
> > detector, but less often true for images that have been mosaiced in some
> > way. Likewise, the spectral axis in spectral image cubes is often (but
> not
> > always) independent of the spatial axis.
> >
> >
> > On Mon, Jan 13, 2014 at 3:04 PM, Perry Greenfield <stsci.perry at gmail.com
> >
> > wrote:
> >>
> >>
> >> On Jan 13, 2014, at 2:56 PM, Phil Hodge wrote:
> >>
> >> > Tom,
> >> >
> >> > On 01/13/2014 02:46 PM, Thomas Robitaille wrote:
> >> >> Just to clarify, I think we are agreeing here - I mentioned:
> >> >>
> >> >> "- check that the projection for that axis is not a spherical
> >> >> projection, unless it's -CAR in which case it's also fine"
> >> >>
> >> >> In the example you and Phil gave, if the non-diagonal elements are
> >> >> zero but the projection is TAN, this violates the rule above. My
> point
> >> >> was that if any of the the diagonal elements are non-zero, or if the
> >> >> projection is one of the projections of a sphere, i.e. any
> projections
> >> >> from paper 2, (except CAR), then this means the axes are coupled, but
> >> >> should one be ok if all non-diagonal elements are zero*and*  the
> >> >> projection is CAR or a projection that is not one of the spherical
> >> >> projections (but could be e.g. a spectral projection convention). Is
> >> >> this correct?
> >> >
> >> > Well, the Mercator projection should be OK, as spherical projections
> go,
> >> > and there are others.  But if there are distortions in addition to any
> >> > projection, that would make it pretty hard to determine whether the
> axes
> >> > were independent just by looking at the WCS attributes.
> >> >
> >> > Phil
> >>
> >> Right. But I think we all essentially agree. It's the details of the
> >> specific cases that takes all the work. For the most part, one could
> >> practically assume that spatial coordinate are coupled given the
> arbitrary
> >> orientation of the detectors and that we are mapping to the sky. The
> number
> >> of real uses of an aligned separable spatial system is so rare as to
> make it
> >> a waste of time to handle specially.
> >>
> >> Perry
> >>
> >>
> >> _______________________________________________
> >> AstroPy mailing list
> >> AstroPy at scipy.org
> >> http://mail.scipy.org/mailman/listinfo/astropy
> >
> >
> >
> >
> > --
> > ************************************
> > Chris Beaumont
> > Graduate Student
> > Institute for Astronomy
> > University of Hawaii at Manoa
> > 2680 Woodlawn Drive
> > Honolulu, HI 96822
> > www.ifa.hawaii.edu/~beaumont
> > ************************************
> >
> > _______________________________________________
> > AstroPy mailing list
> > AstroPy at scipy.org
> > http://mail.scipy.org/mailman/listinfo/astropy
> >
>



-- 
************************************
Chris Beaumont
Graduate Student
Institute for Astronomy
University of Hawaii at Manoa
2680 Woodlawn Drive
Honolulu, HI 96822
www.ifa.hawaii.edu/~beaumont
************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20140114/232b57f2/attachment.html>


More information about the AstroPy mailing list