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;
A Vector of integers, for indexing into Array<T> objects.
A Measure: astronomical direction.
virtual ~DirectionCoordinate()
Destructor.
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 setReferencePixel(const Vector< Double > &refPix)
virtual Coordinate::Type type() const
Return Coordinate::DIRECTION.
void setProjection(const Projection &)
Set the projection.
virtual Vector< Double > referencePixel() const
Vector< Double > to_radians_p
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)
MDirection::Types directionType(Bool showConversion=False) const
Recover the requested attribute.
virtual void convertTo(Vector< Double > &world) const
Convert from type_p -> conversionType_p.
Geometric parameters needed for a sky projection to a plane.
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 Bool setWorldAxisUnits(const Vector< String > &units)
Change the world axis units.
DirectionCoordinate & operator=(const DirectionCoordinate &other)
Assignment (copy semantics).
void getReferenceConversion(MDirection::Types &type) const
virtual Bool near(const Coordinate &other, Double tol=1e-6) const
Comparison function.
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
virtual Bool setWorldAxisNames(const Vector< String > &names)
Set the value of the requested attribute.
virtual void makeWorldRelative(Vector< Double > &world) const
Make absolute world coordinates relative and vice-versa (relative to the reference value)...
virtual Vector< Double > increment() const
virtual Matrix< Double > linearTransform() const
MDirection::Convert * pConversionMachineTo_p
Conversion machines.
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...
void initializeFactors()
Initialize unit conversion vectors and units.
virtual Coordinate * clone() const
Make a copy of the DirectionCoordinate using new.
MDirection::Types type_p
Direction type.
virtual void makeWorldAbsolute(Vector< Double > &world) const
Types
Types of known MDirections Warning: The order defines the order in the translation matrix FromTo in ...
void checkFormat(Coordinate::formatType &format, Bool absolute) const
Check formatting types.
Bool cylindricalFix(Int shapeLong, Int shapeLat)
Fix cylindrical coordinates to put the longitude in [-180,180] range.
virtual Bool toPixel(Vector< Double > &pixel, const Vector< Double > &world) const
world values must have units equivalent to the world axis units.
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.
virtual Coordinate * makeFourierCoordinate(const Vector< Bool > &axes, const Vector< Int > &shape) const
Find the Coordinate for when we Fourier Transform ourselves.
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.
Vector< Double > longLatPoles() const
Fish out the ref and non-native poles (refLong, refLat, longPole, latPole) Not for general use...
virtual Bool save(RecordInterface &container, const String &fieldName) const
Save the DirectionCoordinate into the supplied record using the supplied field name.
void setRotationMatrix()
Set up the offset coordinate rotation matrix.
String formatLatitude(String &units, MVAngle &mVA, Bool absolute, Coordinate::formatType form, Int prec) const
Format a latitude.
virtual Bool setLinearTransform(const Matrix< Double > &xform)
MDirection::Types conversionType_p
Quantity getPixelArea() const
get the pixel area.
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 String showType() const
Always returns the String "Direction".
virtual String format(String &units, Coordinate::formatType format, Double worldValue, uInt axis, Bool isAbsolute, Bool showAsAbsolute, Int precision=-1, Bool usePrecForMixed=False) const
void fromCurrent(Vector< Double > ¤t) const
virtual Bool setReferenceValue(const Vector< Double > &refval)
virtual Vector< String > worldAxisUnits() const
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.
Double putLongInPiRange(Double lon, const String &unit) const
Type
This enum lists the types of the derived classes.
virtual Vector< Double > referenceValue() const
Bool hasSquarePixels() const
Are the pixels square?
DirectionCoordinate()
The default constructor creates a J2000 DirectionCoordinate with a CARtesion projection with longitud...
String formatLongitude(String &units, MVAngle &mVA, MDirection::GlobalTypes gtype, Bool absolute, Coordinate::formatType form, Int prec) const
Format a longitude.
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.
virtual uInt nWorldAxes() const
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.
virtual Bool toWorldMany(Matrix< Double > &world, const Matrix< Double > &pixel, Vector< Bool > &failures) const
Batch up a lot of transformations.
Abstract base class for Record classes.
void toCurrent(Vector< Double > °rees) const
Interconvert between the current units and wcs units (degrees)
virtual void convertFrom(Vector< Double > &world) const
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...
Vector< String > units_p
Current units.
Class to handle angle type conversions and I/O.
MDirection::Convert * pConversionMachineFrom_p
this file contains all the compiler specific defines
mutable ::wcsprm wcs_p
WCS structure.
Bool isNCP() const
Is the projection equivalent to NCP?
virtual uInt nPixelAxes() const
Always returns 2.
RotMatrix rot_p
Rotation matrix used to handle relative coordinates.
Projection projection() const
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...
virtual Vector< String > worldAxisNames() const
Return the requested attributed.