uk.ac.starlink.ast
Class SpecMap

java.lang.Object
  extended by uk.ac.starlink.ast.AstObject
      extended by uk.ac.starlink.ast.Mapping
          extended by uk.ac.starlink.ast.SpecMap

public class SpecMap
extends Mapping

Java interface to the AST SpecMap class - sequence of spectral coordinate conversions. A SpecMap is a specialised form of Mapping which can be used to represent a sequence of conversions between standard spectral coordinate systems.

When an SpecMap is first created, it simply performs a unit (null) Mapping. Using the astSpecAdd function, a series of coordinate conversion steps may then be added. This allows multi-step conversions between a variety of spectral coordinate systems to be assembled out of a set of building blocks.

Conversions are available to transform between standards of rest. Such conversions need to know the source position as an RA and DEC. This information can be supplied in the form of parameters for the relevant conversions, in which case the SpecMap is 1-dimensional, simply transforming the spectral axis values. This means that the same source position will always be used by the SpecMap. However, this may not be appropriate for an accurate description of a 3-D spectral cube, where changes of spatial position can produce significant changes in the Doppler shift introduced when transforming between standards of rest. For this situation, a 3-dimensional SpecMap can be created in which axes 2 and 3 correspond to the source RA and DEC The SpecMap simply copies values for axes 2 and 3 from input to output), but modifies axis 1 values (the spectral axis) appropriately.

For details of the individual coordinate conversions available, see the description of the astSpecAdd function.

Licence

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public Licence as published by the Free Software Foundation; either version 2 of the Licence, or (at your option) any later version.

This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public Licence for more details.

You should have received a copy of the GNU General Public Licence along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street,Fifth Floor, Boston, MA 02110-1301, USA

See Also:
AST SpecMap

Nested Class Summary
 
Nested classes/interfaces inherited from class uk.ac.starlink.ast.Mapping
Mapping.Interpolator, Mapping.Spreader
 
Field Summary
 
Fields inherited from class uk.ac.starlink.ast.Mapping
LINEAR_INTERPOLATOR, LINEAR_SPREADER, NEAREST_INTERPOLATOR, NEAREST_SPREADER
 
Fields inherited from class uk.ac.starlink.ast.AstObject
AST__BAD, AST__TUNULL, pointer
 
Constructor Summary
SpecMap(int nin, int flags)
          Creates a SpecMap.
 
Method Summary
 void specAdd(String cvt, double[] args)
          Add a spectral coordinate conversion to a SpecMap.
 
Methods inherited from class uk.ac.starlink.ast.Mapping
decompose, getInvert, getNin, getNout, getReport, getTranForward, getTranInverse, invert, linearApprox, mapBox, mapSplit, rate, rebin, rebinD, rebinF, rebinI, resample, resampleB, resampleD, resampleF, resampleI, resampleL, resampleS, setInvert, setReport, simplify, tran1, tran2, tranGrid, tranN, tranP
 
Methods inherited from class uk.ac.starlink.ast.AstObject
annul, clear, copy, delete, equals, finalize, getAstConstantI, getB, getC, getD, getF, getI, getID, getIdent, getL, getNobject, getObjSize, getRefCount, hashCode, isThreaded, reportVersions, sameObject, set, setB, setC, setD, setF, setI, setID, setIdent, setL, show, test, tune
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpecMap

public SpecMap(int nin,
               int flags)
Creates a SpecMap.

Parameters:
nin - The number of inputs to the Mapping (this will also equal the number of outputs). This value must be either 1 or 3. In either case, the first input and output correspoindis the spectral axis. For a 3-axis SpecMap, the second and third axes give the RA and DEC (J2000 FK5) of the source. This positional information is used by conversions which transform between standards of rest, and replaces the "RA" and "DEC" arguments for the individual conversions listed in description of the "SpecAdd" function.
flags - This parameter is reserved for future use and should currently always be set to zero.
Throws:
AstException - if an error occurred in the AST library
See Also:
specAdd(java.lang.String, double[])
Method Detail

specAdd

public void specAdd(String cvt,
                    double[] args)
Add a spectral coordinate conversion to a SpecMap. This function adds one of the standard spectral coordinate system conversions listed below to an existing SpecMap.

When a SpecMap is first created (using astSpecMap), it simply performs a unit (null) Mapping. By using astSpecAdd (repeatedly if necessary), one or more coordinate conversion steps may then be added, which the SpecMap will perform in sequence. This allows multi-step conversions between a variety of spectral coordinate systems to be assembled out of the building blocks provided by this class.

Normally, if a SpecMap's Invert attribute is zero (the default), then its forward transformation is performed by carrying out each of the individual coordinate conversions specified by astSpecAdd in the order given (i.e. with the most recently added conversion applied last).

This order is reversed if the SpecMap's Invert attribute is non-zero (or if the inverse transformation is requested by any other means) and each individual coordinate conversion is also replaced by its own inverse. This process inverts the overall effect of the SpecMap. In this case, the first conversion to be applied would be the inverse of the one most recently added.

Notes


- When assembling a multi-stage conversion, it can sometimes be difficult to determine the most economical conversion path. For example, when converting between reference frames, converting first to the heliographic reference frame as an intermediate stage is often sensible in formulating the problem, but may introduce unnecessary extra conversion steps. A solution to this is to include all the steps which are (logically) necessary, but then to use astSimplify to simplify the resulting SpecMap. The simplification process will eliminate any steps which turn out not to be needed.
- This function does not check to ensure that the sequence of coordinate conversions added to a SpecMap is physically meaningful.

Available Conversions

The following strings (which are case-insensitive) may be supplied via the "cvt" parameter to indicate which spectral coordinate conversion is to be added to the SpecMap. Where arguments are needed by the conversion, they are listed in parentheses. Values for these arguments should be given, via the "args" array, in the order indicated. Units and argument names are described at the end of the list of conversions.


- "FRTOVL" (RF): Convert frequency to relativistic velocity.
- "VLTOFR" (RF): Convert relativistic velocity to Frequency.
- "ENTOFR": Convert energy to frequency.
- "FRTOEN": Convert frequency to energy.
- "WNTOFR": Convert wave number to frequency.
- "FRTOWN": Convert frequency to wave number.
- "WVTOFR": Convert wavelength (vacuum) to frequency.
- "FRTOWV": Convert frequency to wavelength (vacuum).
- "AWTOFR": Convert wavelength (air) to frequency.
- "FRTOAW": Convert frequency to wavelength (air).
- "VRTOVL": Convert radio to relativistic velocity.
- "VLTOVR": Convert relativistic to radio velocity.
- "VOTOVL": Convert optical to relativistic velocity.
- "VLTOVO": Convert relativistic to optical velocity.
- "ZOTOVL": Convert redshift to relativistic velocity.
- "VLTOZO": Convert relativistic velocity to redshift.
- "BTTOVL": Convert beta factor to relativistic velocity.
- "VLTOBT": Convert relativistic velocity to beta factor.
- "USF2HL" (VOFF,RA,DEC): Convert frequency from a user-defined reference frame to heliocentric.
- "HLF2US" (VOFF,RA,DEC): Convert frequency from heliocentric reference frame to user-defined.
- "TPF2HL" (OBSLON,OBSLAT,OBSALT,EPOCH,RA,DEC): Convert frequency from topocentric reference frame to heliocentric.
- "HLF2TP" (OBSLON,OBSLAT,OBSALT,EPOCH,RA,DEC): Convert frequency from heliocentric reference frame to topocentric.
- "GEF2HL" (EPOCH,RA,DEC): Convert frequency from geocentric reference frame to heliocentric.
- "HLF2GE" (EPOCH,RA,DEC): Convert frequency from heliocentric reference frame to geocentric.
- "BYF2HL" (EPOCH,RA,DEC): Convert frequency from barycentric reference frame to heliocentric.
- "HLF2BY" (EPOCH,RA,DEC): Convert frequency from heliocentric reference frame to barycentric.
- "LKF2HL" (RA,DEC): Convert frequency from kinematic LSR reference frame to heliocentric.
- "HLF2LK" (RA,DEC): Convert frequency from heliocentric reference frame to kinematic LSR.
- "LDF2HL" (RA,DEC): Convert frequency from dynamical LSR reference frame to heliocentric.
- "HLF2LD" (RA,DEC): Convert frequency from heliocentric reference frame to dynamical LSR.
- "LGF2HL" (RA,DEC): Convert frequency from local group reference frame to heliocentric.
- "HLF2LG" (RA,DEC): Convert frequency from heliocentric reference frame to local group.
- "GLF2HL" (RA,DEC): Convert frequency from galactic reference frame to heliocentric.
- "HLF2GL" (RA,DEC): Convert frequency from heliocentric reference frame to galactic.

The units for the values processed by the above conversions are as follows:


- all velocities: metres per second (positive if the source receeds from the observer).
- frequency: Hertz.
- all wavelengths: metres.
- energy: Joules.
- wave number: cycles per metre.

The arguments used in the above conversions are as follows:


- RF: Rest frequency (Hz).
- OBSALT: Geodetic altitude of observer (IAU 1975, metres).
- OBSLAT: Geodetic latitude of observer (IAU 1975, radians).
- OBSLON: Longitude of observer (radians - positive eastwards).
- EPOCH: Epoch of observation (UT1 expressed as a Modified Julian Date).
- RA: Right Ascension of source (radians, FK5 J2000).
- DEC: Declination of source (radians, FK5 J2000).
- VOFF: Velocity of the user-defined reference frame, towards the position given by RA and DEC, measured in the heliocentric reference frame.

If the SpecMap is 3-dimensional, source positions are provided by the values supplied to inputs 2 and 3 of the SpecMap (which are simply copied to outputs 2 and 3). Note, usable values are still required for the RA and DEC arguments in order to define the "user-defined" reference frame used by USF2HL and HLF2US. However, AST__BAD can be supplied for RA and DEC if the user-defined reference frame is not required.

Parameters:
cvt - Pointer to a null-terminated string which identifies the spectral coordinate conversion to be added to the SpecMap. See the "Available Conversions" section for details of those available.
args - An array containing argument values for the spectral coordinate conversion. The number of arguments required, and hence the number of array elements used, depends on the conversion specified (see the "Available Conversions" section). This array is ignored and a NULL pointer may be supplied if no arguments are needed.
Throws:
AstException - if an error occurred in the AST library


Copyright © 2017 Central Laboratory of the Research Councils. All Rights Reserved.