30 #ifndef COORDINATES_DIRECTIONCOORDINATE_H
31 #define COORDINATES_DIRECTIONCOORDINATE_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;
A Vector of integers, for indexing into Array<T> objects.
A Measure: astronomical direction.
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.
virtual ~DirectionCoordinate()
Destructor.
virtual Vector< String > worldAxisNames() const
Return the requested attributed.
Quantity getPixelArea() const
get the pixel area.
virtual Bool setReferencePixel(const Vector< Double > &refPix)
void setProjection(const Projection &)
Set the projection.
Vector< Double > longLatPoles() const
Fish out the ref and non-native poles (refLong, refLat, longPole, latPole) Not for general use...
Vector< Double > to_radians_p
virtual String format(String &units, Coordinate::formatType format, Double worldValue, uInt axis, Bool isAbsolute, Bool showAsAbsolute, Int precision=-1, Bool usePrecForMixed=False) const
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
Bool isNCP() const
Is the projection equivalent to NCP?
virtual Bool near(const Coordinate &other, Double tol=1e-6) const
Comparison function.
Geometric parameters needed for a sky projection to a plane.
Bool hasSquarePixels() const
Are the pixels square?
virtual Bool setWorldAxisUnits(const Vector< String > &units)
Change the world axis units.
DirectionCoordinate & operator=(const DirectionCoordinate &other)
Assignment (copy semantics).
void setReferenceFrame(const MDirection::Types rf)
Set the base (as opposed to conversion) reference frame.
virtual Bool setWorldAxisNames(const Vector< String > &names)
Set the value of the requested attribute.
Projection projection() const
virtual void makeWorldAbsolute(Vector< Double > &world) const
virtual void makeWorldRelative(Vector< Double > &world) const
Make absolute world coordinates relative and vice-versa (relative to the reference value)...
MDirection::Convert * pConversionMachineTo_p
Conversion machines.
virtual Coordinate * clone() const
Make a copy of the DirectionCoordinate using new.
virtual Coordinate::Type type() const
Return Coordinate::DIRECTION.
void copy(const DirectionCoordinate &other)
Copy private data.
virtual Bool setIncrement(const Vector< Double > &inc)
formatType
This enum is used for formatting world values into Strings.
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...
String formatLatitude(String &units, MVAngle &mVA, Bool absolute, Coordinate::formatType form, Int prec) const
Format a latitude.
void initializeFactors()
Initialize unit conversion vectors and units.
virtual uInt nPixelAxes() const
Always returns 2.
MDirection::Types type_p
Direction type.
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...
Types
Types of known MDirections Warning: The order defines the order in the translation matrix FromTo in ...
virtual Vector< Double > referencePixel() const
const Vector< Double > toCurrentFactors() const
Return unit conversion vector for converting to current units.
virtual Coordinate * makeFourierCoordinate(const Vector< Bool > &axes, const Vector< Int > &shape) const
Find the Coordinate for when we Fourier Transform ourselves.
Bool cylindricalFix(Int shapeLong, Int shapeLat)
Fix cylindrical coordinates to put the longitude in [-180,180] range.
void normalizePCMatrix()
Normalize each row of the PC matrix such that increment() will return the actual angular increment an...
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.
Projection projection_p
Projection parameters.
Interconvert pixel positions and directions (e.g. RA/DEC).
Interface for converting between world and pixel coordinates.
void setRotationMatrix()
Set up the offset coordinate rotation matrix.
virtual Bool setLinearTransform(const Matrix< Double > &xform)
MDirection::Types conversionType_p
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.
bool Bool
Define the standard types used by Casacore.
static DirectionCoordinate * restore(const RecordInterface &container, const String &fieldName)
Recover the DirectionCoordinate from a record.
virtual Bool toPixel(Vector< Double > &pixel, const Vector< Double > &world) const
world values must have units equivalent to the world axis units.
virtual String showType() const
Always returns the String "Direction".
virtual Vector< Double > referenceValue() const
virtual uInt nWorldAxes() const
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.
virtual Vector< String > worldAxisUnits() const
virtual Bool setReferenceValue(const Vector< Double > &refval)
void checkFormat(Coordinate::formatType &format, Bool absolute) const
Check formatting types.
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
Vector< String > names_p
Axis names.
void getReferenceConversion(MDirection::Types &type) const
Type
This enum lists the types of the derived classes.
virtual void convertTo(Vector< Double > &world) const
Convert from type_p -> conversionType_p.
DirectionCoordinate()
The default constructor creates a J2000 DirectionCoordinate with a CARtesion projection with longitud...
void toCurrent(Vector< Double > °rees) const
Interconvert between the current units and wcs units (degrees)
const Double e
e and functions thereof:
static Vector< String > axisNames(MDirection::Types type, Bool FITSName=False)
Return canonical axis names for the given MDirection type, giving FITS names if desired.
MDirection::Types directionType(Bool showConversion=False) const
Recover the requested attribute.
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...
void makeConversionMachines()
Set up conversion machine.
Vector< Double > to_degrees_p
WCS computes in degrees - use this to convert back and forth between current DirectionCoordinate unit...
virtual void setDefaultWorldMixRanges()
void setReferenceConversion(MDirection::Types type)
Set extra conversion type.
String: the storage and methods of handling collections of characters.
Vector of three direction cosines.
void fromCurrent(Vector< Double > ¤t) const
Abstract base class for Record classes.
virtual Bool toPixelMany(Matrix< Double > &pixel, const Matrix< Double > &world, Vector< Bool > &failures) const
Vector< String > units_p
Current units.
Class to handle angle type conversions and I/O.
MDirection::Convert * pConversionMachineFrom_p
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...
virtual Bool toWorldMany(Matrix< Double > &world, const Matrix< Double > &pixel, Vector< Bool > &failures) const
Batch up a lot of transformations.
mutable::wcsprm wcs_p
WCS structure.
virtual Bool save(RecordInterface &container, const String &fieldName) const
Save the DirectionCoordinate into the supplied record using the supplied field name.
virtual Vector< Double > increment() const
String formatLongitude(String &units, MVAngle &mVA, MDirection::GlobalTypes gtype, Bool absolute, Coordinate::formatType form, Int prec) const
Format a longitude.
RotMatrix rot_p
Rotation matrix used to handle relative coordinates.
virtual Matrix< Double > linearTransform() const
Double putLongInPiRange(Double lon, const String &unit) const