DOcoordsys.h

Classes

coordsys -- Implementation of the coordinate system functionality (full description)

class coordsys : public ApplicationObject

Types

enum methods

ADDCOORDINATE
AXESMAP
AXISCOORDINATETYPES
COORDINATETYPE
CONVERSIONTYPE
CONVERT
CONVERTMANY
EPOCH
FINDAXIS
FINDCOORDINATE
FREQUENCYTOFREQUENCY
FREQUENCYTOVELOCITY
FROMRECORD
INCREMENT
LINEARTRANSFORM
NAMES
NAXES
NCOORDINATES
OBSERVER
PARENTNAME
PROJECTION
REFERENCECODE
REFERENCEPIXEL
REFERENCEVALUE
REPLACECOORDINATE
REORDER
RESTFREQUENCY
SETCONVERSIONTYPE
SETDIRECTION
SETEPOCH
SETINCREMENT
SETLINEARTRANSFORM
SETNAMES
SETOBSERVER
SETPARENTNAME
SETPROJECTION
SETREFERENCECODE
SETREFERENCEPIXEL
SETREFERENCEVALUE
SETRESTFREQUENCY
SETSPECTRAL
SETSTOKES
SETTABULAR
SETTELESCOPE
SETUNITS
STOKES
SUMMARY
TELESCOPE
TOABS
TOABSMANY
TOPIXEL
TOPIXELMANY
TORECORD
TOREL
TORELMANY
TOWORLD
TOWORLDMANY
UNITS
VELOCITYTOFREQUENCY
NUM_METHODS

Interface

Public Members
coordsys(Bool direction, Bool spectral, const Vector<String>& stokes, Int linear, Bool tabular)
coordsys(const CoordinateSystem& cSys)
coordsys(const coordsys& other)
coordsys& operator=(const coordsys& other)
~coordsys()
void addCoordinate (Bool direction, Bool spectral, const Vector<String>& stokes, Int linear, Bool tabular)
Vector<Int> axesMap (Bool toWorld) const
Vector<String> axisCoordinateTypes (Bool world) const
Vector<String> coordinateType (Index which) const
Bool findAxis (Int& coordinate, Int& axisInCoordinate, Bool isWorld, Int axis) const
Bool findCoordinate (Vector<Int>& pixelAxes, Vector<Int>& worldAxes, const String& coordType, Index which) const
GlishRecord toGlishRecord () const
void fromGlishRecord (const GlishRecord& rec)
Vector<Double> frequencyToFrequency (const Vector<Double>& frequency, const String& freqUnit, const String& doppler, const Quantum<Double>& velUnit) const
Vector<Double> frequencyToVelocity (const Vector<Double>& frequency, const String& freqUnit, const String& doppler, const String& velUnit) const
Vector<Double> velocityToFrequency (const Vector<Double>& velocity, const String& freqUnit, const String& doppler, const String& velUnit) const
Int nAxes (Bool world) const
Int nCoordinates () const
MEpoch epoch () const
void setEpoch (const MEpoch& epoch)
Vector<String> referenceCode (const String& coordinateType) const
void setReferenceCode (const String& coordinateType, const String& code, Bool adjust)
GlishRecord increment (const String& type, const String& format)
void setIncrement (const String& coordinateType, const GlishRecord& incr)
String observer () const
void setObserver (const String& observer)
String parentImageName () const
void setParentImageName (const String& name)
GlishRecord projection (const String& type) const
void setProjection (const String& type, const Vector<Double>& pars)
Vector<Double> referencePixel() const
void setReferencePixel (const String& coordinateType, const Vector<Double>& refPix)
GlishRecord referenceValue(const String& type, const String& format)
void setReferenceValue (const String& coordinateType, const GlishRecord& gRec)
Array<Double> linearTransform (const String& type)
void setLinearTransform (const String& coordinateType, const Array<Double>& value)
Quantum<Vector<Double> > restFrequency () const
void setRestFrequency (const Quantum<Vector<Double> >& restFrequency, Index which, Bool append)
Vector<String> stokes () const
void setStokes (const Vector<String>& stokes)
Bool setConversionType (const String& direction, const String& spectral)
String getConversionType (const String& type)
void setDirectionCoordinate (const String& ref, const String& proj, const Vector<Double>& projPar, const Vector<Double>& refPix, const GlishRecord& refVal, const GlishRecord& incr, const GlishRecord& poles, const Array<Double>& xform)
void setSpectralCoordinate (const String& ref, const Quantum<Double>& restFrequency, const Quantum<Vector<Double> >& frequencies, const String& doppler, const Quantum<Vector<Double> >& velocities, Bool dofreq, Bool dovel)
void setTabularCoordinate (const Vector<Double>& pixel, const Vector<Double>& world, Index which)
void replaceCoordinate (const GlishRecord& cSys, Index in, Index out)
String telescope () const
void setTelescope (const String& telescope)
Vector<String> worldAxisNames () const
void setWorldAxisNames (const String& coordinateType, const Vector<String>& names)
Vector<String> worldAxisUnits() const
void setWorldAxisUnits (const String& coordinateType, const Vector<String>& units, Bool overwrite, Index which)
Vector<String> summary (const String& velocity, Bool list) const
Vector<Double> toPixel (const GlishRecord& gRec) const
Array<Double> toPixelMany (const Array<Double>& world) const
GlishRecord toWorld (const Vector<Double>& pixel, const String& format)
Array<Double> toWorldMany (const Array<Double>& coordIn) const
GlishRecord absoluteToRelative (const GlishRecord& absolute, Bool isWorld)
Array<Double> absoluteToRelativeMany (const Array<Double>& absolute, Bool isWorld)
GlishRecord relativeToAbsolute (const GlishRecord& relative, Bool isWorld)
Array<Double> relativeToAbsoluteMany (const Array<Double>& absolute, Bool isWorld)
Vector<Double> convert (const Vector<Double>& coordIn, const Vector<Bool>& absIn, const Vector<String>& unitsIn, const String& dopplerIn, const Vector<Bool>& absOut, const Vector<String>& unitsOut, const String& dopplerOut, const Vector<Int>& shape)
Array<Double> convertMany (const Array<Double>& coordIn, const Vector<Bool>& absIn, const Vector<String>& unitsIn, const String& dopplerIn, const Vector<Bool>& absOut, const Vector<String>& unitsOut, const String& dopplerOut, const Vector<Int>& shape)
void reorder (const Vector<Index>& order)
virtual String className() const
virtual Vector<String> methods() const
virtual Vector<String> noTraceMethods() const
virtual MethodResult runMethod(uInt which, ParameterSet &inputRecord, Bool runMethod)
Private Members
GlishRecord absRel (LogIO& os, const RecordInterface& recIn, Bool isWorld, Bool absToRel)
Record absRelRecord (LogIO& os, const RecordInterface& recIn, Bool isWorld, Bool absToRel)
void addCoordinate (CoordinateSystem& cSys, Bool direction, Bool spectral, const Vector<String>& stokes, Int linear, Bool tabular)
void copyWorldAxes (Vector<Double>& out, const Vector<Double>& in, Int c) const
Vector<Double> measuresToWorldVector (const RecordInterface& rec) const
Record worldVectorToMeasures(const Vector<Double>& world, Int c, Bool abs) const
Int findCoordinate (Coordinate::Type type, Bool warn) const
void recordToWorldVector (Vector<Double>& world, String& type, Int c, const RecordInterface& rec) const
Record worldVectorToRecord (const Vector<Double>& world, Int c, const String& format, Bool isAbsolute, Bool showAsAbsolute)
Record quantumToRecord (LogIO& os, const Quantum<Double>& value) const
void setDirectionCode (const String& code, Bool adjust)
void setSpectralCode (const String& code, Bool adjust)
Vector<Double> stringToWorldVector (LogIO& os, const Vector<String>& world, const Vector<String>& worldAxisUnits) const
Coordinate::Type stringToType(const String& typeIn) const
Record toWorldRecord (const Vector<Double>& pixel, const String& format)
void trim (Vector<Double>& in, const Vector<Double>& replace) const
Vector<Double> quantumVectorRecordToVectorDouble (const RecordInterface& recQ, const Vector<String>& units) const

Description

or

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

This implements the functionality for the coordinate system Distributed Object

Synopsis

The functionality that is bound to Glish and available via the coordinate system DO is implemented here.

Example

Motivation

Template Type Argument Requirements (T)

Thrown Exceptions

To Do

Member Description

coordsys(Bool direction, Bool spectral, const Vector<String>& stokes, Int linear, Bool tabular)

"coordsys" constructor

coordsys(const CoordinateSystem& cSys)

Construct from given CoordinateSystem

coordsys(const coordsys& other)

copy constructor

coordsys& operator=(const coordsys& other)

assignment

~coordsys()

Destructor

void addCoordinate (Bool direction, Bool spectral, const Vector<String>& stokes, Int linear, Bool tabular)

Add a new default coordinate. Only Tabular implemented presently.

Vector<Int> axesMap (Bool toWorld) const

Axes map

Vector<String> axisCoordinateTypes (Bool world) const

Axis coordinate types

Vector<String> coordinateType (Index which) const

Coordinate type

Bool findAxis (Int& coordinate, Int& axisInCoordinate, Bool isWorld, Int axis) const

Find the specified axis

Bool findCoordinate (Vector<Int>& pixelAxes, Vector<Int>& worldAxes, const String& coordType, Index which) const

Find the axes of the specified coordinate type.

GlishRecord toGlishRecord () const
void fromGlishRecord (const GlishRecord& rec)

Convert to/from a GlishRecord

Vector<Double> frequencyToFrequency (const Vector<Double>& frequency, const String& freqUnit, const String& doppler, const Quantum<Double>& velUnit) const

Convert a vector of frequencies to frequency with an offset

Vector<Double> frequencyToVelocity (const Vector<Double>& frequency, const String& freqUnit, const String& doppler, const String& velUnit) const

Convert a vector of frequencies to velocity

Vector<Double> velocityToFrequency (const Vector<Double>& velocity, const String& freqUnit, const String& doppler, const String& velUnit) const

Convert a vector of velocities to frequency

Int nAxes (Bool world) const

Number of coordinates

Int nCoordinates () const

Number of coordinates

MEpoch epoch () const
void setEpoch (const MEpoch& epoch)

Get/set the Epoch

Vector<String> referenceCode (const String& coordinateType) const
void setReferenceCode (const String& coordinateType, const String& code, Bool adjust)

Get/set reference code

GlishRecord increment (const String& type, const String& format)
void setIncrement (const String& coordinateType, const GlishRecord& incr)

Set/Get increment

String observer () const
void setObserver (const String& observer)

Get/set the Observer

String parentImageName () const
void setParentImageName (const String& name)

Set/Get parent image name

GlishRecord projection (const String& type) const
void setProjection (const String& type, const Vector<Double>& pars)

Set/Get Direction Coordinate projection

Vector<Double> referencePixel() const
void setReferencePixel (const String& coordinateType, const Vector<Double>& refPix)

Set/Get reference pixel

GlishRecord referenceValue(const String& type, const String& format)
void setReferenceValue (const String& coordinateType, const GlishRecord& gRec)

Set/Get reference value

Array<Double> linearTransform (const String& type)
void setLinearTransform (const String& coordinateType, const Array<Double>& value)

Set/Get linear transform

Quantum<Vector<Double> > restFrequency () const
void setRestFrequency (const Quantum<Vector<Double> >& restFrequency, Index which, Bool append)

Set/Get rest frequency

Vector<String> stokes () const
void setStokes (const Vector<String>& stokes)

Get/Set new StokesCOordinate info

Bool setConversionType (const String& direction, const String& spectral)
String getConversionType (const String& type)

Set/get extra conversion layers

void setDirectionCoordinate (const String& ref, const String& proj, const Vector<Double>& projPar, const Vector<Double>& refPix, const GlishRecord& refVal, const GlishRecord& incr, const GlishRecord& poles, const Array<Double>& xform)

Set new DirectionCoordinate info

void setSpectralCoordinate (const String& ref, const Quantum<Double>& restFrequency, const Quantum<Vector<Double> >& frequencies, const String& doppler, const Quantum<Vector<Double> >& velocities, Bool dofreq, Bool dovel)

Set new SpectralCoordinate info

void setTabularCoordinate (const Vector<Double>& pixel, const Vector<Double>& world, Index which)

Set new TabularCoordinate info

void replaceCoordinate (const GlishRecord& cSys, Index in, Index out)

Replace coordinates

String telescope () const
void setTelescope (const String& telescope)

Get/set the Telescope

Vector<String> worldAxisNames () const
void setWorldAxisNames (const String& coordinateType, const Vector<String>& names)

Get/set the world axis names

Vector<String> worldAxisUnits() const
void setWorldAxisUnits (const String& coordinateType, const Vector<String>& units, Bool overwrite, Index which)

Get/set the world axis units

Vector<String> summary (const String& velocity, Bool list) const

Summary listing

Vector<Double> toPixel (const GlishRecord& gRec) const

absolute world to absolute pixel.

Array<Double> toPixelMany (const Array<Double>& world) const

absolute world to absolute pixel for many conversions

GlishRecord toWorld (const Vector<Double>& pixel, const String& format)

absolute pixel to absolute world

Array<Double> toWorldMany (const Array<Double>& coordIn) const

absolute pixel to absolute world for many conversions

GlishRecord absoluteToRelative (const GlishRecord& absolute, Bool isWorld)

absolute coordinate to relative coordinate

Array<Double> absoluteToRelativeMany (const Array<Double>& absolute, Bool isWorld)

absolute coordinate to relative coordinate for many conversions

GlishRecord relativeToAbsolute (const GlishRecord& relative, Bool isWorld)

relative coordinate to absolute coordinate

Array<Double> relativeToAbsoluteMany (const Array<Double>& absolute, Bool isWorld)

relative coordinate to absolute coordinate for many conversions

Vector<Double> convert (const Vector<Double>& coordIn, const Vector<Bool>& absIn, const Vector<String>& unitsIn, const String& dopplerIn, const Vector<Bool>& absOut, const Vector<String>& unitsOut, const String& dopplerOut, const Vector<Int>& shape)

General coordinate conversion

Array<Double> convertMany (const Array<Double>& coordIn, const Vector<Bool>& absIn, const Vector<String>& unitsIn, const String& dopplerIn, const Vector<Bool>& absOut, const Vector<String>& unitsOut, const String& dopplerOut, const Vector<Int>& shape)

General coordinate conversion for many conversions

void reorder (const Vector<Index>& order)

reorder

virtual String className() const

Stuff needed for distributing this class

virtual Vector<String> methods() const

virtual Vector<String> noTraceMethods() const

virtual MethodResult runMethod(uInt which, ParameterSet &inputRecord, Bool runMethod)

If your object has more than one method

GlishRecord absRel (LogIO& os, const RecordInterface& recIn, Bool isWorld, Bool absToRel)
Record absRelRecord (LogIO& os, const RecordInterface& recIn, Bool isWorld, Bool absToRel)

Inter convert absolute and relative world or pixel coordinates

void addCoordinate (CoordinateSystem& cSys, Bool direction, Bool spectral, const Vector<String>& stokes, Int linear, Bool tabular)

Add default coordinates to CS

void copyWorldAxes (Vector<Double>& out, const Vector<Double>& in, Int c) const

Copy the world axes of in to out

Vector<Double> measuresToWorldVector (const RecordInterface& rec) const

Convert record of measures to world coordinate vector

Record worldVectorToMeasures(const Vector<Double>& world, Int c, Bool abs) const

Convert world coordinate to measures and stick in record

Int findCoordinate (Coordinate::Type type, Bool warn) const

Find coordinate of desired type

void recordToWorldVector (Vector<Double>& world, String& type, Int c, const RecordInterface& rec) const

Convert a record holding some mixture of numeric, measures, quantity, string to a vector of doubles

Record worldVectorToRecord (const Vector<Double>& world, Int c, const String& format, Bool isAbsolute, Bool showAsAbsolute)

Convert a vector of world to a record holding some mixture of numeric, measures, quantity, string

Record quantumToRecord (LogIO& os, const Quantum<Double>& value) const

Convert Quantum to record

void setDirectionCode (const String& code, Bool adjust)

Set DirectionCoordinate reference code

void setSpectralCode (const String& code, Bool adjust)

Set SpectralCoordinate reference code

Vector<Double> stringToWorldVector (LogIO& os, const Vector<String>& world, const Vector<String>& worldAxisUnits) const

Convert world String to world vector double. World vector must be length cSys.nWorldAxes()

Coordinate::Type stringToType(const String& typeIn) const

Convert user coordinate type string to enum

Record toWorldRecord (const Vector<Double>& pixel, const String& format)

absolute pixel to absolute world

void trim (Vector<Double>& in, const Vector<Double>& replace) const

Add missing values or tim excessive

Vector<Double> quantumVectorRecordToVectorDouble (const RecordInterface& recQ, const Vector<String>& units) const

Convert a vector of quantum doubles in a record to a vector of double applying specified units

enum methods

Runmethod enum