|
CppEphem
|
CESkyCoord class is responsible for doing all of the celestial coordinate conversions. Command line tools are also available for "on the fly" conversions.
The different coordinate systems used:
Definition at line 49 of file CESkyCoord.h.
Public Member Functions | |
| virtual CEAngle | AngularSeparation (const CESkyCoord &coords) const |
| Get the angular separation between the coordinates represented by this object and another coordinate object. More... | |
| CESkyCoord () | |
| Default constructor. More... | |
| CESkyCoord (const CEAngle &xcoord, const CEAngle &ycoord, const CESkyCoordType &coord_type=CESkyCoordType::ICRS) | |
| Primary constructor. More... | |
| CESkyCoord (const CECoordinates &other) | |
| Copy constructor. More... | |
| CESkyCoord (const CESkyCoord &other) | |
| Copy constructor. More... | |
| CESkyCoord | ConvertTo (const CESkyCoordType &output_coord_type, const CEDate &date=CEDate(), const CEObserver &observer=CEObserver()) |
| Convert these coordinates to another coordinate system NOTE: If this object is not OBSERVED coordinates, only JD is needed. More... | |
| CESkyCoord | ConvertToCIRS (const CEDate &date=CEDate(), const CEObserver &observer=CEObserver()) |
| Convert this coordinate to CIRS coordinates. More... | |
| CESkyCoord | ConvertToEcliptic (const CEDate &date=CEDate(), const CEObserver &observer=CEObserver()) |
| Convert this coordinate to ECLIPTIC coordinates. More... | |
| CESkyCoord | ConvertToGalactic (const CEDate &date=CEDate(), const CEObserver &observer=CEObserver()) |
| Convert this coordinate to GALACTIC coordinates. More... | |
| CESkyCoord | ConvertToICRS (const CEDate &date=CEDate(), const CEObserver &observer=CEObserver()) |
| Convert this coordinate to ICRS coordinates. More... | |
| CESkyCoord | ConvertToObserved (const CEDate &date=CEDate(), const CEObserver &observer=CEObserver()) |
| Convert this coordinate to OBSERVED coordinates. More... | |
| CESkyCoordType | GetCoordSystem (void) const |
| Return coordinate system. More... | |
| CESkyCoord & | operator= (const CESkyCoord &other) |
| Overloaded '=' (assignment) operator. More... | |
| std::string | print (void) const |
| Generate a message string that specifies the information about this coordinate. More... | |
| virtual void | SetCoordinates (const CEAngle &xcoord, const CEAngle &ycoord, const CESkyCoordType &coord_type=CESkyCoordType::ICRS) const |
| Set the coordinates of this object. More... | |
| virtual void | SetCoordinates (const CESkyCoord &coords) |
| Set the coordinates from another CESkyCoord object. More... | |
| virtual CEAngle | XCoord (const CEDate &jd=CppEphem::julian_date_J2000()) const |
| Return x coordinate at given Julian date. More... | |
| virtual CEAngle | YCoord (const CEDate &jd=CppEphem::julian_date_J2000()) const |
| Return y coordinate at given Julian date. More... | |
| virtual | ~CESkyCoord () |
| Destructor. More... | |
Static Public Member Functions | |
| static CEAngle | AngularSeparation (const CEAngle &xcoord_first, const CEAngle &ycoord_first, const CEAngle &xcoord_second, const CEAngle &ycoord_second) |
| Get the angular separation between two sets of coordinates. More... | |
| static CEAngle | AngularSeparation (const CESkyCoord &coords1, const CESkyCoord &coords2) |
| Get the angular separation between two coordinate objects. More... | |
| static void | CIRS2Ecliptic (const CESkyCoord &in_cirs, CESkyCoord *out_ecliptic, const CEDate &date=CEDate()) |
| Convert CIRS to ECLIPTIC coordinates. More... | |
| static void | CIRS2Galactic (const CESkyCoord &in_cirs, CESkyCoord *out_galactic, const CEDate &date=CEDate()) |
| Convert CIRS to Galactic coordinates. More... | |
| static void | CIRS2ICRS (const CESkyCoord &in_cirs, CESkyCoord *out_icrs, const CEDate &date=CEDate()) |
| Convert CIRS to ICRS coordinates. More... | |
| static void | CIRS2Observed (const CESkyCoord &in_cirs, CESkyCoord *out_observed, const CEDate &date, const CEObserver &observer, CESkyCoord *observed_cirs=nullptr, CEAngle *hour_angle=nullptr) |
| CIRS -> Observed (or observer specific) coordinate conversion. More... | |
| static void | Ecliptic2CIRS (const CESkyCoord &in_ecliptic, CESkyCoord *out_cirs, const CEDate &date=CEDate()) |
| ECLIPTIC -> CIRS coordinate conversion. More... | |
| static void | Ecliptic2Galactic (const CESkyCoord &in_ecliptic, CESkyCoord *out_galactic, const CEDate &date=CEDate()) |
| ECLIPTIC -> GALACTIC coordinate conversion. More... | |
| static void | Ecliptic2ICRS (const CESkyCoord &in_ecliptic, CESkyCoord *out_icrs, const CEDate &date=CEDate()) |
| ECLIPTIC -> ICRS coordinate conversion. More... | |
| static void | Ecliptic2Observed (const CESkyCoord &in_ecliptic, CESkyCoord *out_observed, const CEDate &date, const CEObserver &observer) |
| ECLIPTIC -> OBSERVED coordinate conversion. More... | |
| static void | Galactic2CIRS (const CESkyCoord &in_galactic, CESkyCoord *out_cirs, const CEDate &date=CEDate()) |
| GALACTIC -> CIRS coordinate conversion. More... | |
| static void | Galactic2Ecliptic (const CESkyCoord &in_galactic, CESkyCoord *out_ecliptic, const CEDate &date=CEDate()) |
| GALACTIC -> ECLIPTIC coordinate conversion. More... | |
| static void | Galactic2ICRS (const CESkyCoord &in_galactic, CESkyCoord *out_icrs) |
| GALACTIC -> ICRS coordinate conversion. More... | |
| static void | Galactic2Observed (const CESkyCoord &in_galactic, CESkyCoord *out_observed, const CEDate &date, const CEObserver &observer, CESkyCoord *observed_galactic=nullptr, CEAngle *hour_angle=nullptr) |
| GALACTIC -> OBSERVED coordinate conversion. More... | |
| static void | ICRS2CIRS (const CESkyCoord &in_icrs, CESkyCoord *out_cirs, const CEDate &date=CEDate()) |
| ICRS -> CIRS coordinate conversion. More... | |
| static void | ICRS2Ecliptic (const CESkyCoord &in_icrs, CESkyCoord *out_ecliptic, const CEDate &date=CEDate()) |
| ICRS -> ECLIPTIC coordinate conversion. More... | |
| static void | ICRS2Galactic (const CESkyCoord &in_icrs, CESkyCoord *out_galactic) |
| ICRS -> GALACTIC coordinate conversion. More... | |
| static void | ICRS2Observed (const CESkyCoord &in_icrs, CESkyCoord *out_observed, const CEDate &date, const CEObserver &observer, CESkyCoord *observed_cirs=nullptr, CEAngle *hour_angle=nullptr) |
| ICRS -> OBSERVED coordinate conversion. More... | |
| static void | Observed2CIRS (const CESkyCoord &in_observed, CESkyCoord *out_cirs, const CEDate &date, const CEObserver &observer) |
| OBSERVED -> CIRS coordinate conversion. More... | |
| static void | Observed2Ecliptic (const CESkyCoord &in_observed, CESkyCoord *out_ecliptic, const CEDate &date, const CEObserver &observer) |
| OBSERVED -> ECLIPTIC coordinate conversion. More... | |
| static void | Observed2Galactic (const CESkyCoord &in_observed, CESkyCoord *out_galactic, const CEDate &date, const CEObserver &observer) |
| OBSERVED -> GALACTIC coordinate conversion. More... | |
| static void | Observed2ICRS (const CESkyCoord &in_observed, CESkyCoord *out_icrs, const CEDate &date, const CEObserver &observer) |
| OBSERVED -> ICRS coordinate conversion. More... | |
Private Member Functions | |
| void | copy_members (const CESkyCoord &other) |
| Copy data members from another CESkyCoord object. More... | |
| void | free_members (void) |
| Cleanup data members that need to be freed or cleared. More... | |
| void | init_members (void) |
| Set initial values and allocate memory for data members. More... | |
Private Attributes | |
| CESkyCoordType | coord_type_ |
| CEAngle | xcoord_ |
| CEAngle | ycoord_ |
Friends | |
| bool | operator!= (const CESkyCoord &lhs, const CESkyCoord &rhs) |
| Compare two coordinate objects. More... | |
| bool | operator== (const CESkyCoord &lhs, const CESkyCoord &rhs) |
| Compare two coordinate objects. More... | |
#include <CESkyCoord.h>


| CESkyCoord::CESkyCoord | ( | ) |
Default constructor.
Definition at line 38 of file CESkyCoord.cpp.
| CESkyCoord::CESkyCoord | ( | const CEAngle & | xcoord, |
| const CEAngle & | ycoord, | ||
| const CESkyCoordType & | coord_type = CESkyCoordType::ICRS |
||
| ) |
Primary constructor.
| [in] | xcoord | X-Coordinate |
| [in] | ycoord | Y-Coordinate |
| [in] | coord_type | Coordinate type (see CESkyCoordType) |
Definition at line 51 of file CESkyCoord.cpp.
|
explicit |
Copy constructor.
Definition at line 67 of file CESkyCoord.cpp.
| CESkyCoord::CESkyCoord | ( | const CESkyCoord & | other | ) |
Copy constructor.
Definition at line 79 of file CESkyCoord.cpp.
|
virtual |
Destructor.
Definition at line 90 of file CESkyCoord.cpp.
|
static |
Get the angular separation between two sets of coordinates.
Method utilizes the SOFA 'iauSeps' algorithm. NOTE: The coordinates are both expected to be in the same coordinate system!
| [in] | xcoord_first | X-value for first set of coordinates |
| [in] | ycoord_first | Y-value for first set of coordinates |
| [in] | xcoord_second | X-value for second set of coordiantes |
| [in] | ycoord_second | Y-value for second set of coordinates |
Note that the x-coordinates are expected in the range [0, 2pi] and the y-coordinates are expected in the range [-pi, pi]. Because of this, you need to pass:
Definition at line 183 of file CESkyCoord.cpp.
|
virtual |
Get the angular separation between the coordinates represented by this object and another coordinate object.
NOTE: The coordinates are both expected to be in the same coordinate system! If they are in different coordinate systems, use "ConvertTo()" first.
| [in] | coords | Another set of coordinates |
Definition at line 119 of file CESkyCoord.cpp.
|
static |
Get the angular separation between two coordinate objects.
NOTE: The coordinates are both expected to be in the same coordinate system! If they are in different coordinate systems, use "ConvertTo()" first.
| [in] | coords1 | First set of coordinates |
| [in] | coords2 | Second set of coordinates |
| [in] | return_angle_type | Specify whether to return angle as DEGREES or RADIANS |
Note that the x-coordinates are expected in the range [0, 2pi] and the y-coordinates are expected in the range [-pi, pi]. Because of this, OBSERVED coordinates first convert the zenith angle to altitude
Definition at line 140 of file CESkyCoord.cpp.
|
static |
Convert CIRS to ECLIPTIC coordinates.
| [in] | in_cirs | Input CIRS coordinates |
| [out] | out_ecliptic | Output ECLIPTIC coordinates |
| [in] | date | Date for conversion |
Definition at line 322 of file CESkyCoord.cpp.
|
static |
Convert CIRS to Galactic coordinates.
| [in] | in_cirs | Input CIRS coordinates |
| [out] | out_galactic | Output Galactic coordinates |
| [in] | date | Date for conversion |
Definition at line 235 of file CESkyCoord.cpp.
|
static |
Convert CIRS to ICRS coordinates.
| [in] | in_cirs | Input CIRS coordinates |
| [out] | out_icrs | Output ICRS coordinates |
| [in] | date | Date for conversion |
Definition at line 201 of file CESkyCoord.cpp.
|
static |
CIRS -> Observed (or observer specific) coordinate conversion.
| [in] | in_cirs | Input CIRS coordinates |
| [out] | out_observed | Output Observed coordinates |
| [in] | date | Date for conversion |
| [in] | observer | Observer information |
| [out] | observed_cirs | 'Observed' CIRS coordinates |
| [out] | hour_angle | Hour angle of coordinates for observer |
Definition at line 258 of file CESkyCoord.cpp.
| CESkyCoord CESkyCoord::ConvertTo | ( | const CESkyCoordType & | output_coord_type, |
| const CEDate & | date = CEDate(), |
||
| const CEObserver & | observer = CEObserver() |
||
| ) |
Convert these coordinates to another coordinate system NOTE: If this object is not OBSERVED coordinates, only JD is needed.
NOTE: If 'observer' is not nulltr then 'jd' will be ignored and the date will instead be derived from the observers date.
| [in] | output_coord_type | Output coordinate type (see CESkyCoordType) |
| [in] | observer | If these coordinates are OBSERVED, then observer represents the observer for these coordinates. Otherwise they represent the observer to convert the coordinates to. |
| [in] | date | Julian date for conversion |
Definition at line 786 of file CESkyCoord.cpp.
| CESkyCoord CESkyCoord::ConvertToCIRS | ( | const CEDate & | date = CEDate(), |
| const CEObserver & | observer = CEObserver() |
||
| ) |
Convert this coordinate to CIRS coordinates.
| [in] | date | Date for conversion |
| [in] | observer | Observer information |
Note that the date and observer parameters are only necessary if they are need to convert this object
Definition at line 817 of file CESkyCoord.cpp.
| CESkyCoord CESkyCoord::ConvertToEcliptic | ( | const CEDate & | date = CEDate(), |
| const CEObserver & | observer = CEObserver() |
||
| ) |
Convert this coordinate to ECLIPTIC coordinates.
| [in] | date | Date for conversion |
| [in] | observer | Observer information |
Note that the date and observer parameters are only necessary if they are need to convert this object
Definition at line 965 of file CESkyCoord.cpp.
| CESkyCoord CESkyCoord::ConvertToGalactic | ( | const CEDate & | date = CEDate(), |
| const CEObserver & | observer = CEObserver() |
||
| ) |
Convert this coordinate to GALACTIC coordinates.
| [in] | date | Date for conversion |
| [in] | observer | Observer information |
Note that the date and observer parameters are only necessary if they are need to convert this object
Definition at line 891 of file CESkyCoord.cpp.
| CESkyCoord CESkyCoord::ConvertToICRS | ( | const CEDate & | date = CEDate(), |
| const CEObserver & | observer = CEObserver() |
||
| ) |
Convert this coordinate to ICRS coordinates.
| [in] | date | Date for conversion |
| [in] | observer | Observer information |
Note that the date and observer parameters are only necessary if they are need to convert this object
Definition at line 854 of file CESkyCoord.cpp.
| CESkyCoord CESkyCoord::ConvertToObserved | ( | const CEDate & | date = CEDate(), |
| const CEObserver & | observer = CEObserver() |
||
| ) |
Convert this coordinate to OBSERVED coordinates.
| [in] | date | Date for conversion |
| [in] | observer | Observer information |
Note that the date and observer parameters are only necessary if they are need to convert this object
Definition at line 928 of file CESkyCoord.cpp.
|
private |
Copy data members from another CESkyCoord object.
| [in] | other | Another coordinates objec to copy |
Definition at line 1041 of file CESkyCoord.cpp.
|
static |
ECLIPTIC -> CIRS coordinate conversion.
| [in] | in_ecliptic | Input ECLIPTIC coordinates |
| [out] | out_cirs | Output CIRS coordinates |
| [in] | date | Date for conversion |
Definition at line 686 of file CESkyCoord.cpp.
|
static |
ECLIPTIC -> GALACTIC coordinate conversion.
| [in] | in_ecliptic | Input ECLIPTIC coordinates |
| [out] | out_galactic | Output GALACTIC coordinates |
| [in] | date | Date for conversion |
Definition at line 737 of file CESkyCoord.cpp.
|
static |
ECLIPTIC -> ICRS coordinate conversion.
| [in] | in_ecliptic | Input ECLIPTIC coordinates |
| [out] | out_icrs | Output ICRS coordinates |
| [in] | date | Date for conversion |
Definition at line 706 of file CESkyCoord.cpp.
|
static |
ECLIPTIC -> OBSERVED coordinate conversion.
| [in] | in_ecliptic | Input ECLIPTIC coordinates |
| [out] | out_observed | Output OBSERVED coordinates |
| [in] | date | Date for conversion |
| [in] | observer | Observer information |
Definition at line 758 of file CESkyCoord.cpp.
|
private |
Cleanup data members that need to be freed or cleared.
Definition at line 1052 of file CESkyCoord.cpp.
|
static |
GALACTIC -> CIRS coordinate conversion.
| [in] | in_galactic | Input GALACTIC coordinates |
| [out] | out_cirs | Output CIRS coordinates |
| [in] | date | Date for conversion |
Definition at line 471 of file CESkyCoord.cpp.
|
static |
GALACTIC -> ECLIPTIC coordinate conversion.
| [in] | in_galactic | Input GALACTIC coordinates |
| [out] | out_ecliptic | Output ECLIPTIC coordinates |
| [in] | date | Date for conversion |
Definition at line 552 of file CESkyCoord.cpp.
|
static |
GALACTIC -> ICRS coordinate conversion.
| [in] | in_galactic | Input GALACTIC coordinates |
| [out] | out_icrs | Output ICRS coordinates |
Definition at line 492 of file CESkyCoord.cpp.
|
static |
GALACTIC -> OBSERVED coordinate conversion.
| [in] | in_galactic | Input GALACTIC coordinates |
| [out] | out_observed | Output OBSERVED coordinates |
| [in] | date | Date for conversion |
| [in] | observer | Observer information |
| [out] | observed_galactic | 'Observed' GALACTIC coordinates |
| [out] | hour_angle | Hour angle of coordinates for observer |
This method takes in an optional observed_galactic parameter that stores the GALACTIC coordinates of a given object as they would be observed
Definition at line 520 of file CESkyCoord.cpp.
|
inline |
Return coordinate system.
Definition at line 251 of file CESkyCoord.h.
|
static |
ICRS -> CIRS coordinate conversion.
| [in] | in_icrs | Input ICRS coordinates |
| [out] | out_cirs | Output CIRS coordinates |
| [in] | date | Date for conversion |
Definition at line 342 of file CESkyCoord.cpp.
|
static |
ICRS -> ECLIPTIC coordinate conversion.
| [in] | in_icrs | Input ICRS coordinates |
| [out] | out_ecliptic | Output ECLIPTIC coordinates |
| [in] | date | Date for conversion |
Definition at line 440 of file CESkyCoord.cpp.
|
static |
ICRS -> GALACTIC coordinate conversion.
| [in] | in_icrs | Input ICRS coordinates |
| [out] | out_galactic | Output GALACTIC coordinates |
Definition at line 379 of file CESkyCoord.cpp.
|
static |
ICRS -> OBSERVED coordinate conversion.
| [in] | in_icrs | Input ICRS coordinates |
| [out] | out_observed | Output OBSERVED coordinates |
| [in] | date | Date for conversion |
| [in] | observer | Observer information |
| [out] | observed_cirs | 'Observed' CIRS coordinates |
| [out] | hour_angle | Hour angle of coordinates for observer |
This method takes in an optional observed_cirs parameter that stores the CIRS coordinates of a given object as they would be observed
Definition at line 407 of file CESkyCoord.cpp.
|
private |
Set initial values and allocate memory for data members.
Definition at line 1061 of file CESkyCoord.cpp.
|
static |
OBSERVED -> CIRS coordinate conversion.
| [in] | in_observed | Input OBSERVED coordinates |
| [out] | out_cirs | Output CIRS coordinates |
| [in] | date | Date for conversion |
| [in] | observer | Observer information |
Definition at line 573 of file CESkyCoord.cpp.
|
static |
OBSERVED -> ECLIPTIC coordinate conversion.
| [in] | in_observed | Input OBSERVED coordinates |
| [out] | out_ecliptic | Output ECLIPTIC coordinates |
| [in] | date | Date for conversion |
| [in] | observer | Observer information |
Definition at line 665 of file CESkyCoord.cpp.
|
static |
OBSERVED -> GALACTIC coordinate conversion.
| [in] | in_observed | Input OBSERVED coordinates |
| [out] | out_galactic | Output GALACTIC coordinates |
| [in] | date | Date for conversion |
| [in] | observer | Observer information |
Definition at line 643 of file CESkyCoord.cpp.
|
static |
OBSERVED -> ICRS coordinate conversion.
| [in] | in_observed | Input OBSERVED coordinates |
| [out] | out_icrs | Output ICRS coordinates |
| [in] | date | Date for conversion |
| [in] | observer | Observer information |
Definition at line 621 of file CESkyCoord.cpp.
| CESkyCoord & CESkyCoord::operator= | ( | const CESkyCoord & | other | ) |
Overloaded '=' (assignment) operator.
Definition at line 99 of file CESkyCoord.cpp.
| std::string CESkyCoord::print | ( | void | ) | const |
Generate a message string that specifies the information about this coordinate.
Definition at line 1026 of file CESkyCoord.cpp.
|
virtual |
Set the coordinates of this object.
| [in] | xcoord | X-coordinate |
| [in] | ycoord | Y-coordinate |
| [in] | coord_type | Coordinate type (see CESkyCoordType) |
Definition at line 1000 of file CESkyCoord.cpp.
|
virtual |
Set the coordinates from another CESkyCoord object.
| [in] | coords | Another coordinates object to copy |
Definition at line 1015 of file CESkyCoord.cpp.
|
inlinevirtual |
Return x coordinate at given Julian date.
| [in] | jd | Julian date (used only by derived classes) |
Definition at line 227 of file CESkyCoord.h.
|
inlinevirtual |
Return y coordinate at given Julian date.
| [in] | jd | Julian date (used only by derived classes) |
Definition at line 240 of file CESkyCoord.h.
|
friend |
Compare two coordinate objects.
Definition at line 1102 of file CESkyCoord.cpp.
|
friend |
Compare two coordinate objects.
Definition at line 1074 of file CESkyCoord.cpp.
|
mutableprivate |
Definition at line 210 of file CESkyCoord.h.
|
mutableprivate |
Definition at line 208 of file CESkyCoord.h.
|
mutableprivate |
Definition at line 209 of file CESkyCoord.h.
1.8.16