29 #ifndef DISPLAY_COORDINATESYSTEM_H_
30 #define DISPLAY_COORDINATESYSTEM_H_
93 {
return cs_.
near(other,excludePixelAxes,tol); }
148 {
cs_.
findWorldAxis( coordinate, axisInCoordinate, axisInCoordinateSystem ); }
150 {
cs_.
findPixelAxis( coordinate, axisInCoordinate, axisInCoordinateSystem ); }
168 bool isAbsolute=
true,
bool showAsAbsolute=
true,
int precision=-1,
bool usePrecForMixed=
false )
const;
193 {
return cs_.
save(container,fieldName); }
A Vector of integers, for indexing into Array<T> objects.
DisplayCoordinateSystem()
virtual uInt nWorldAxes() const
virtual Bool near(const Coordinate &other, Double tol=1e-6) const
Comparison function.
const LinearCoordinate & linearCoordinate(uInt which) const
Return the given Coordinate.
const QualityCoordinate & qualityCoordinate(uInt which) const
Int qualityAxisNumber() const
what number is the quality axis? Returns -1 if no quality axis exists.
virtual Vector< Double > referencePixel() const
bool removeWorldAxis(unsigned int axis, double replacement)
virtual Vector< Double > referenceValue() const
const casacore::DirectionCoordinate & directionCoordinate(int which=-1) const
casacore::Vector< casacore::String > worldAxisUnits() const
virtual ~DisplayCoordinateSystem()
const TabularCoordinate & tabularCoordinate(uInt which) const
Bool hasSpectralAxis() const
Does this coordinate system have a spectral axis?
bool setReferencePixel(const casacore::Vector< double > &refPix)
static void setNiceAxisLabelUnits(CoordinateSystem &cSys)
Set the world axis units in the CS to 'deg' for Direction.
const StokesCoordinate & stokesCoordinate() const
Int polarizationAxisNumber(Bool doWorld=False) const
What is the number of the polarization/stokes axis? If doWorld=True, the world axis number is returne...
void findWorldAxis(Int &coordinate, Int &axisInCoordinate, uInt axisInCoordinateSystem) const
Given an axis number (pixel or world) in the CoordinateSystem, find the corresponding coordinate numb...
Table lookup 1-D coordinate, with interpolation.
bool setIncrement(const casacore::Vector< double > &inc)
bool toWorld(casacore::Vector< double > &world, const casacore::Vector< double > &pixel) const
const casacore::TabularCoordinate & tabularCoordinate(unsigned int which) const
virtual Vector< Double > worldMixMin() const
void makePixelRelative(casacore::Vector< double > &pixel) const
transposition_log_t transposition_log
static Bool setVelocityState(String &errorMsg, CoordinateSystem &cSys, const String &unit, const String &spcquant)
Set velocity state of SpectralCoordinate in CoordinateSystem.
static Bool setDirectionUnit(CoordinateSystem &cSys, const String &unit, Int which=-1)
Set a unit for all unremoved world axes in the DirectionCoordinate in the CS.
const casacore::QualityCoordinate & qualityCoordinate(unsigned int which) const
const String & errorMessage() const
If the last conversion to world or pixel coordinates resulted in an error, report that error...
ObsInfo obsInfo() const
Miscellaneous information related to an observation, for example the observation date.
String showType(uInt whichCoordinate) const
Returns the type of the given Coordinate as a string.
const casacore::Coordinate & coordinate(unsigned int which) const
void setObsInfo(const casacore::ObsInfo &obsinfo)
bool setWorldAxisUnits(const casacore::Vector< casacore::String > &units)
bool hasSpectralAxis() const
bool toMix(casacore::Vector< double > &worldOut, casacore::Vector< double > &pixelOut, const casacore::Vector< double > &worldIn, const casacore::Vector< double > &pixelIn, const casacore::Vector< bool > &worldAxes, const casacore::Vector< bool > &pixelAxes, const casacore::Vector< double > &worldMin, const casacore::Vector< double > &worldMax) const
static Bool setSpectralState(String &errorMsg, CoordinateSystem &cSys, const String &unit, const String &spcquant)
Set spectral state of SpectralCoordinate in CoordinateSystem.
Interconvert between pixel and a linear world coordinate.
Int spectralAxisNumber(Bool doWorld=False) const
What number is the spectral axis? If doWorld=True, the world axis number is returned.
virtual Bool setReferenceValue(const Vector< Double > &refval)
const DirectionCoordinate & directionCoordinate() const
DisplayCoordinateSystem(const DisplayCoordinateSystem &o)
void findPixelAxis(Int &coordinate, Int &axisInCoordinate, uInt axisInCoordinateSystem) const
casacore::Int polarizationAxisNumber(casacore::Bool doWorld=false) const
Interconvert between pixel and Quality value.
ostream-like interface to creating log messages.
bool setVelocityState(casacore::String &errorMsg, const casacore::String &unit, const casacore::String &spcquant)
bool near(const casacore::Coordinate &other, const casacore::Vector< casacore::Int > &excludePixelAxes, casacore::Double tol=1e-6) const
int findCoordinate(casacore::Coordinate::Type type, int afterCoord=-1) const
casacore::String showType(casacore::uInt whichCoordinate) const
unsigned int nWorldAxes() const
formatType
This enum is used for formatting world values into Strings.
Coordinate::Type type(uInt whichCoordinate) const
Return the type of the given Coordinate.
const casacore::String & errorMessage() const
coordinate mapping...
virtual uInt nPixelAxes() const
Sums the number of axes in the Coordinates that the CoordinateSystem contains, allowing for removed a...
bool isDirectionAbscissaLongitude() const
is the first direction axis RA or Dec...
Store miscellaneous information related to an observation.
bool removePixelAxis(unsigned int axis, double replacement)
bool removeAxes(casacore::Vector< double > &worldReplacement, const casacore::Vector< int > &worldAxes, bool remove)
Bool setRestFrequency(String &errorMsg, const Quantity &freq)
Set rest frequency of SpectralCoordinate in CoordinateSystem.
std::vector< std::pair< casacore::Vector< int >, casacore::Vector< int > > > transposition_log_t
void setNiceAxisLabelUnits()
virtual Bool save(RecordInterface &container, const String &fieldName) const
Save the CoordinateSystem into the supplied record using the supplied field name. ...
casacore::uInt nCoordinates() const
int spectralAxisNumber(bool doWorld=false) const
bool hasPolarizationCoordinate() const
virtual Vector< Double > increment() const
void addCoordinate(const casacore::Coordinate &coord)
bool setSpectralFormatting(casacore::String &errorMsg, const casacore::String &unit, const casacore::String &spcquant)
const casacore::LinearCoordinate & linearCoordinate(unsigned int which) const
const casacore::StokesCoordinate & stokesCoordinate(int which=-1) const
casacore::CoordinateSystem cs_
bool setReferenceValue(const casacore::Vector< double > &refval)
bool setRestFrequency(casacore::String &errorMsg, const casacore::String &unit, const casacore::Double &value)
casacore::CoordinateUtil wrappers...
static Bool removePixelAxes(CoordinateSystem &cSys, Vector< Double > &pixelReplacement, const Vector< Int > &pixelAxes, const Bool remove)
Remove a list of pixel axes but not their associated world axes from a CoordinateSystem.
Interconvert pixel positions and directions (e.g. RA/DEC).
Interface for converting between world and pixel coordinates.
Bool hasDirectionCoordinate() const
void setObsInfo(const ObsInfo &obsinfo)
void subImageInSitu(const casacore::Vector< float > &originShift, const casacore::Vector< float > &incrFac, const casacore::Vector< int > &newShape)
bool toPixel(casacore::Vector< double > &pixel, const casacore::Vector< double > &world) const
bool setSpectralConversion(casacore::String &errorMsg, const casacore::String frequencySystem)
uInt nCoordinates() const
Returns the number of Coordinates that this CoordinateSystem contains.
casacore::Vector< double > referencePixel() const
virtual Bool setReferencePixel(const Vector< Double > &refPix)
bool replaceCoordinate(const casacore::Coordinate &newCoordinate, unsigned int whichCoordinate)
static Bool removeAxes(CoordinateSystem &cSys, Vector< Double > &worldReplacement, const Vector< Int > &worldAxes, const Bool remove)
Remove a list of world axes and their associated pixel axes from a CoordinateSystem.
Bool isDirectionAbscissaLongitude() const
Is the abscissa in the DirectionCoordinate the longitude axis? Throws exception if there is no Direct...
bool setDirectionUnit(const string &unit, casacore::Int which=-1)
const Coordinate & coordinate(uInt which) const
Return the given Coordinate as a reference to the base class object.
int worldAxisToPixelAxis(unsigned int worldAxis) const
bool setWorldMixRanges(const casacore::IPosition &shape)
bool Bool
Define the standard types used by Casacore.
Bool removeWorldAxis(uInt axis, Double replacement)
Remove a world or pixel axis.
void makeWorldAbsolute(casacore::Vector< double > &world) const
Int findCoordinate(Coordinate::Type type, Int afterCoord=-1) const
Find the Coordinate number that corresponds to the given type.
bool save(casacore::RecordInterface &container, const casacore::String &fieldName) const
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
Type
This enum lists the types of the derived classes.
unsigned int nPixelAxes() const
static void worldWidthsToPixel(casacore::Vector< casacore::Double > &dParameters, const casacore::Vector< casacore::Quantum< casacore::Double > > ¶meters, const casacore::CoordinateSystem &cSys, const casacore::IPosition &pixelAxes, casacore::Bool doRef=false)
Convert 2d shape from world (world parameters=x, y, major axis, minor axis, position angle) to pixel ...
casacore::ObsInfo obsInfo() const
Interconvert pixel and frequency values.
DisplayCoordinateSystem(const casacore::CoordinateSystem &c)
bool near(const casacore::Coordinate &other, casacore::Double tol=1e-6) const
static Bool setSpectralFormatting(String &errorMsg, CoordinateSystem &cSys, const String &unit, const String &spcquant)
Set default format unit and doppler velocity state of SpectralCoordinate in CoordinateSystem.
int qualityAxisNumber() const
casacore::Coordinate::Type type(unsigned int whichCoordinate) const
void addCoordinate(const Coordinate &coord)
Add another Coordinate to this CoordinateSystem.
Bool removePixelAxis(uInt axis, Double replacement)
virtual Vector< Double > worldMixMax() const
int pixelAxisToWorldAxis(unsigned int pixelAxis) const
void makeWorldRelative(casacore::Vector< double > &world) const
casacore::Vector< double > worldMixMax() const
const Double e
e and functions thereof:
Interconvert between pixel and Stokes value.
const Double c
Fundamental physical constants (SI units):
const SpectralCoordinate & spectralCoordinate(uInt which) const
casacore::Vector< casacore::String > worldAxisNames() const
const casacore::SpectralCoordinate & spectralCoordinate(int which=-1) const
casacore::Vector< int > directionAxesNumbers() const
String: the storage and methods of handling collections of characters.
bool setSpectralState(casacore::String &errorMsg, const casacore::String &unit, const casacore::String &spcquant)
void worldWidthsToPixel(casacore::LogIO &, casacore::Vector< double > &dParameters, const casacore::Vector< casacore::Quantum< casacore::Double > > ¶meters, const casacore::IPosition &pixelAxes, bool doRef=false) const
from ImageUtilities...
casacore::Vector< int > pixelAxes(casacore::uInt whichCoord) const
const DisplayCoordinateSystem & operator=(const DisplayCoordinateSystem &o)
casacore::Vector< double > referenceValue() const
casacore::String format(casacore::String &units, casacore::Coordinate::formatType format, double worldValue, unsigned int worldAxis, bool isAbsolute=true, bool showAsAbsolute=true, int precision=-1, bool usePrecForMixed=false) const
void subImageInSitu(const Vector< Float > &originShift, const Vector< Float > &incrFac, const Vector< Int > &newShape)
bool hasDirectionCoordinate() const
bool setWorldAxisNames(const casacore::Vector< casacore::String > &names)
void makePixelAbsolute(casacore::Vector< double > &pixel) const
Bool replaceCoordinate(const Coordinate &newCoordinate, uInt whichCoordinate)
Replace one Coordinate with another.
static DisplayCoordinateSystem restore(const casacore::RecordInterface &container, const casacore::String &fieldName)
Abstract base class for Record classes.
casacore::Vector< int > transposeShape(const casacore::Vector< int > &original_shape, bool world=true)
casacore::Vector< double > increment() const
void match(const DisplayCoordinateSystem &other)
adjust this coordinate system to match the 'other' coordinate system
void findPixelAxis(int &coordinate, int &axisInCoordinate, unsigned int axisInCoordinateSystem) const
virtual Bool setIncrement(const Vector< Double > &inc)
casacore::Vector< double > worldMixMin() const
Int worldAxisToPixelAxis(uInt worldAxis) const
Find the pixel axis for the given world axis in a CoordinateSystem.
Bool setSpectralConversion(String &errorMsg, const String frequencySystem)
Set Spectral conversion layer of SpectralCoordinate in CoordinateSystem so that pixel<->world go to t...
void transpose(const casacore::Vector< int > &newWorldOrder, const casacore::Vector< int > &newPixelOrder)
bool removePixelAxes(casacore::Vector< casacore::Double > &pixelReplacement, const casacore::Vector< casacore::Int > &pixelAxes, const casacore::Bool remove)
Int pixelAxisToWorldAxis(uInt pixelAxis) const
Find the world axis for the given pixel axis in a CoordinateSystem.
Interconvert pixel and world coordinates.
void findWorldAxis(int &coordinate, int &axisInCoordinate, unsigned int axisInCoordinateSystem) const
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
casacore::Vector< int > worldAxes(casacore::uInt whichCoord) const
virtual Bool setWorldMixRanges(const IPosition &shape)
Compute and recover the world min and max ranges, for use in function toMix, for a lattice of the giv...
Bool hasPolarizationCoordinate() const
does this coordinate system have a polarizaion/stokes coordinate?