Go to the documentation of this file.
30 #ifndef COORDINATES_DIRECTIONCOORDINATE_H
31 #define COORDINATES_DIRECTIONCOORDINATE_H
33 #include <casacore/casa/aips.h>
34 #include <casacore/coordinates/Coordinates/Coordinate.h>
35 #include <casacore/coordinates/Coordinates/Projection.h>
36 #include <casacore/casa/Arrays/Vector.h>
37 #include <casacore/measures/Measures/MDirection.h>
38 #include <casacore/measures/Measures/MeasConvert.h>
39 #include <casacore/casa/Quanta/RotMatrix.h>
40 #include <wcslib/wcs.h>
51 template<
class T>
class Quantum;
278 const ::wcsprm& wcs,
Bool oneRel=
True);
537 Int defPrecScientific,
539 Int defPrecTime)
const;
568 const String &fieldName)
const;
657 Bool absolute)
const;
677 Bool longIsWorld)
const;
Bool hasSquarePixels() const
Are the pixels square?
void toCurrent(Vector< Double > °rees) const
Interconvert between the current units and wcs units (degrees)
DirectionCoordinate()
The default constructor creates a J2000 DirectionCoordinate with a CARtesion projection with longitud...
String formatLatitude(String &units, MVAngle &mVA, Bool absolute, Coordinate::formatType form, Int prec) const
Format a latitude.
Interface for converting between world and pixel coordinates.
MDirection::Types conversionType_p
A Vector of integers, for indexing into Array<T> objects.
MDirection::Convert * pConversionMachineFrom_p
String formatLongitude(String &units, MVAngle &mVA, MDirection::GlobalTypes gtype, Bool absolute, Coordinate::formatType form, Int prec) const
Format a longitude.
Quantity getPixelArea() const
get the pixel area.
Projection projection() const
virtual uInt nWorldAxes() const
virtual Vector< String > worldAxisNames() const
Return the requested attributed.
void fromCurrent(Vector< Double > ¤t) const
Vector of three direction cosines.
virtual Bool setReferenceValue(const Vector< Double > &refval)
Interconvert pixel positions and directions (e.g. RA/DEC).
virtual Coordinate * makeFourierCoordinate(const Vector< Bool > &axes, const Vector< Int > &shape) const
Find the Coordinate for when we Fourier Transform ourselves.
DirectionCoordinate convert(Quantity &angle, MDirection::Types directionType) const
Convert this coordinate to another reference frame by rotating it about the reference pixel so the th...
Double putLongInPiRange(Double lon, const String &unit) const
virtual Bool setIncrement(const Vector< Double > &inc)
Vector< Double > longLatPoles() const
Fish out the ref and non-native poles (refLong, refLat, longPole, latPole) Not for general use.
void initializeFactors()
Initialize unit conversion vectors and units.
MDirection::Types directionType(Bool showConversion=False) const
Recover the requested attribute.
virtual Coordinate * clone() const
Make a copy of the DirectionCoordinate using new.
virtual Bool setLinearTransform(const Matrix< Double > &xform)
virtual Bool toWorld(Vector< Double > &world, const Vector< Double > &pixel, Bool useConversionFrame=True) const
Convert a pixel position to a world position or vice versa.
virtual uInt nPixelAxes() const
Always returns 2.
virtual String showType() const
Always returns the String "Direction".
void normalizePCMatrix()
Normalize each row of the PC matrix such that increment() will return the actual angular increment an...
Type
This enum lists the types of the derived classes.
void makeConversionMachines()
Set up conversion machine.
void setReferenceConversion(MDirection::Types type)
Set extra conversion type.
Geometric parameters needed for a sky projection to a plane.
virtual ~DirectionCoordinate()
Destructor.
virtual Vector< Double > increment() const
formatType
This enum is used for formatting world values into Strings.
virtual Vector< Double > referenceValue() const
virtual Bool toWorldMany(Matrix< Double > &world, const Matrix< Double > &pixel, Vector< Bool > &failures) const
Batch up a lot of transformations.
virtual Bool setReferencePixel(const Vector< Double > &refPix)
virtual Vector< Double > referencePixel() const
void setRotationMatrix()
Set up the offset coordinate rotation matrix.
void makeWCS(::wcsprm &wcs, const Matrix< Double > &xform, const Projection &proj, MDirection::Types directionType, Double refPixLong, Double refPixLat, Double refLong, Double refLat, Double incLong, Double incLat, Double longPole, Double latPole)
virtual void convertFrom(Vector< Double > &world) const
Vector< String > units_p
Current units.
Class to handle angle type conversions and I/O.
virtual void getPrecision(Int &precision, Coordinate::formatType &format, Bool showAsAbsolute, Int defPrecScientific, Int defPrecFixed, Int defPrecTime) const
Format a DirectionCoordinate coordinate world value nicely through the common format interface.
Bool isNCP() const
Is the projection equivalent to NCP?
RotMatrix rot_p
Rotation matrix used to handle relative coordinates.
virtual Bool setWorldAxisUnits(const Vector< String > &units)
Change the world axis units.
virtual Bool near(const Coordinate &other, Double tol=1e-6) const
Comparison function.
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape.
Vector< Double > to_degrees_p
WCS computes in degrees - use this to convert back and forth between current DirectionCoordinate unit...
virtual void setDefaultWorldMixRanges()
virtual void makeWorldRelative(Vector< Double > &world) const
Make absolute world coordinates relative and vice-versa (relative to the reference value).
virtual Vector< String > worldAxisUnits() const
virtual Bool toPixel(Vector< Double > &pixel, const Vector< Double > &world) const
world values must have units equivalent to the world axis units.
A Measure: astronomical direction.
void copy(const DirectionCoordinate &other)
Copy private data.
this file contains all the compiler specific defines
mutable ::wcsprm wcs_p
WCS structure.
virtual void convertTo(Vector< Double > &world) const
Convert from type_p -> conversionType_p.
const Vector< Double > toCurrentFactors() const
Return unit conversion vector for converting to current units.
Bool toMix2(Vector< Double > &out, const Vector< Double > &in, const Vector< Double > &minWorld, const Vector< Double > &maxWorld, Bool longIsWorld) const
Mixed pixel/world coordinate conversion.
static Vector< String > axisNames(MDirection::Types type, Bool FITSName=False)
Return canonical axis names for the given MDirection type, giving FITS names if desired.
void getReferenceConversion(MDirection::Types &type) const
virtual Bool setWorldMixRanges(const IPosition &shape)
Compute and retrieve the world min and max ranges, for use in function toMix, for a lattice of the gi...
virtual Bool toMix(Vector< Double > &worldOut, Vector< Double > &pixelOut, const Vector< Double > &worldIn, const Vector< Double > &pixelIn, const Vector< Bool > &worldAxes, const Vector< Bool > &pixelAxes, const Vector< Double > &worldMin, const Vector< Double > &worldMax) const
Mixed pixel/world coordinate conversion.
void setReferenceFrame(const MDirection::Types rf)
Set the base (as opposed to conversion) reference frame.
virtual Bool toPixelMany(Matrix< Double > &pixel, const Matrix< Double > &world, Vector< Bool > &failures) const
MDirection::Types type_p
Direction type.
const Double e
e and functions thereof:
Abstract base class for Record classes.
virtual Coordinate::Type type() const
Return Coordinate::DIRECTION.
static DirectionCoordinate * restore(const RecordInterface &container, const String &fieldName)
Recover the DirectionCoordinate from a record.
MDirection::Convert * pConversionMachineTo_p
Conversion machines.
void setProjection(const Projection &)
Set the projection.
Bool cylindricalFix(Int shapeLong, Int shapeLat)
Fix cylindrical coordinates to put the longitude in [-180,180] range.
virtual void makeWorldAbsoluteRef(Vector< Double > &world, const Vector< Double > &refVal) const
Make absolute coordinates relative and vice versa with respect to the given reference value.
Projection projection_p
Projection parameters.
Vector< String > names_p
Axis names.
String: the storage and methods of handling collections of characters.
DirectionCoordinate & operator=(const DirectionCoordinate &other)
Assignment (copy semantics).
bool Bool
Define the standard types used by Casacore.
Types
Types of known MDirections Warning: The order defines the order in the translation matrix FromTo in ...
virtual Bool save(RecordInterface &container, const String &fieldName) const
Save the DirectionCoordinate into the supplied record using the supplied field name.
virtual void makeWorldAbsolute(Vector< Double > &world) const
virtual Bool setWorldAxisNames(const Vector< String > &names)
Set the value of the requested attribute.
void checkFormat(Coordinate::formatType &format, Bool absolute) const
Check formatting types.
void makeDirectionCoordinate(MDirection::Types directionType, const Projection &proj, Double refLong, Double refLat, Double incLong, Double incLat, const Matrix< Double > &xform, Double refX, Double refY, Double longPole, Double latPole)
Helper functions interfacing to WCS.
virtual Matrix< Double > linearTransform() const
virtual String format(String &units, Coordinate::formatType format, Double worldValue, uInt axis, Bool isAbsolute, Bool showAsAbsolute, Int precision=-1, Bool usePrecForMixed=False) const
Vector< Double > to_radians_p