[AstroPy] API question: Instantiating of time/coord and similar

David Berry d.berry at jach.hawaii.edu
Thu May 3 14:44:34 EDT 2012


For illustration I've attached the AST class hierarchy. There are a
few idiosyncrasies, like "why does Frame inherits from Mapping?", and
"what on earth is a "NormMap"?", but it should give a general feel for
the facilities.

David



On 3 May 2012 19:19, Perry Greenfield <perry at stsci.edu> wrote:
> I didn't mean to say that it should be mostly or entirely different. I would
> like to see  a great deal of commonality actually (preferably sharing the
> same base class for coordinate transformations for example).
>
> I'd like to expand on what I would like to see, but I'm not sure I will have
> time today. Perhaps tomorrow.
>
> Perry
>
>
> On May 3, 2012, at 1:39 PM, David Berry wrote:
>
>> What you say is reasonable, but I don't see that it follows that they need
>> to be handled differently. Considered as a class, coordinate systems have a
>> lot of common properties and methods no matter what they describe. Getting a
>> sufficiently generic base class allows you to extend the system easily.
>> That's why it was so easy to add support for spectral and time to AST. In
>> practice it all works out very smoothly.
>>
>> David
>>
>> On Thursday, 3 May 2012, Perry Greenfield <perry at stsci.edu> wrote:
>> >
>> > On May 3, 2012, at 11:45 AM, David Berry wrote:
>> >
>> >> On 3 May 2012 16:39, Wolfgang Kerzendorf <wkerzendorf at gmail.com> wrote:
>> >>>
>> >>> Hi all,
>> >>>
>> >>> This topic has expanded a lot;-)
>> >>>
>> >>> So adressing point 1: Yes, you're technically right. That both of
>> >>> these things do coordinate transformations. But there are many coordinate
>> >>> transformations in astronomy and in astropy we don't have a one-size
>> >>> fits-all mentality about them (in my sense for good reason). For example,
>> >>> switching between different units, doppler-shifting spectra , etc... all are
>> >>> technically coordinate transformations, but we treat them differently and
>> >>> not through one coordinate transformer.
>> >>
>> >> Is there a reason for that?
>> >
>> > I agree that they are both identical in some respects (and it is worth
>> > considering a common api for at least a good part of both). To me the main
>> > difference is that one is standards focused (dealing with well known
>> > coordinate  systems and the transformations between them, whereas wcs is
>> > dealing more with instrumental effects and transforming from that to world
>> > coordinates (which may be one of the standard systems, but it may not). In
>> > one most of the transforms are simple, as is the geometry. In the other they
>> > can be quite complex. The former usually transforms few distinct coordinates
>> > (yes, you can do big catalogs too), and the latter transforms large numbers
>> > of pixel coordinates in many case.
>> >
>> > So I'm not surprised that people come from different directions when
>> > approaching these two issues.
>> >
>> >
>> > Perr
>> >
>> >
>
>
-------------- next part --------------
Object             - Base class for all AST Objects
   Axis            - Store axis information
      SkyAxis      - Store celestial axis information
   Channel         - Basic (textual) I/O channel
      FitsChan     - I/O Channel using FITS header cards
      XmlChan      - I/O Channel using XML
      StcsChan     - I/O Channel using IVOA STC-S descriptions
   KeyMap          - Store a set of key/value pairs
      Table        - Store a 2-dimensional table of values
   Mapping         - Inter-relate two coordinate systems
      CmpMap       - Compound Mapping
      DssMap       - Map points using Digitised Sky Survey plate solution
      Frame        - Coordinate system description
         CmpFrame  - Compound Frame
            SpecFluxFrame - Observed value versus spectral position
         FluxFrame - Observed value at a given fixed spectral position
         FrameSet  - Set of inter-related coordinate systems
            Plot   - Provide facilities for graphical output
         Region    - Specify areas within a coordinate system
            Box    - A box region with sides parallel to the axes of a Frame
            Circle - A circular or spherical region within a Frame
            CmpRegion  - A combination of two regions within a single Frame
            Ellipse    - An elliptical region within a 2-dimensional Frame
            Interval   - Intervals on one or more axes of a Frame.
            NullRegion - A boundless region within a Frame
            PointList  - A collection of points in a Frame
            Polygon    - A polygonal region within a 2-dimensional Frame
            Prism  - An extrusion of a Region into orthogonal dimensions
            Stc    - Represents an generic instance of an IVOA STC-X description
               StcResourceProfile - Represents an an IVOA STC-X ResourceProfile
               StcSearchLocation  - Represents an an IVOA STC-X SearchLocation
               StcCatalogEntryLocation - Represents an an IVOA STC-X CatalogEntryLocation
               StcObsDataLocation - Represents an an IVOA STC-X ObsDataLocation
         SkyFrame  - Celestial coordinate system description
         SpecFrame - Spectral coordinate system description
            DSBSpecFrame - Dual sideband spectral coordinate system description
         TimeFrame - Time coordinate system description
      GrismMap     - Models the spectral dispersion produced by a grism
      IntraMap     - Map points using a private transformation function
      LutMap       - Transform 1-dimensional coordinates using a lookup table
      MathMap      - Transform coordinates using mathematical expressions
      MatrixMap    - Map positions by multiplying them by a matrix
      NormMap      - Normalise coordinates using a supplied Frame
      PcdMap       - Apply 2-dimensional pincushion/barrel distortion
      PermMap      - Coordinate permutation Mapping
      PolyMap      - General N-dimensional polynomial Mapping
      RateMap      - Calculates an element of a Mapping's Jacobian matrix
      SelectorMap  - Locates positions within a set of Regions
      ShiftMap     - Shifts each axis by a constant amount
      SlaMap       - Sequence of celestial coordinate conversions
      SpecMap      - Sequence of spectral coordinate conversions
      SphMap       - Map 3-d Cartesian to 2-d spherical coordinates
      SwitchMap    - Encapuslates a set of alternate Mappings
      TimeMap      - Sequence of time coordinate conversions
      TranMap      - Combine fwd. and inv. transformations from two Mappings
      UnitMap      - Unit (null) Mapping
      WcsMap       - Implement a FITS-WCS sky projection
      WinMap       - Match windows by scaling and shifting each axis
      ZoomMap      - Zoom coordinates about the origin


More information about the AstroPy mailing list