Go to the documentation of this file.
84 std::cout <<
"\nTesting CESkyCoord:\n";
111 test_double(test1.
XCoord().
Rad(), 0.0, __func__, __LINE__);
112 test_double(test1.
YCoord().
Rad(), 0.0, __func__, __LINE__);
118 test_double(test2.
XCoord(), testx, __func__, __LINE__);
119 test_double(test2.
YCoord(), testy, __func__, __LINE__);
124 test_double(test4.XCoord(), testx, __func__, __LINE__);
125 test_double(test4.YCoord(), testy, __func__, __LINE__);
126 test_int(
int(test4.GetCoordSystem()),
int(test2.
GetCoordSystem()), __func__, __LINE__);
135 test_double(test6.
XCoord(), testx, __func__, __LINE__);
136 test_double(test6.
YCoord(), testy, __func__, __LINE__);
140 test_greaterthan(test4.print().size(), 0, __func__, __LINE__);
399 test_double(angsep.
Deg(), 2.0, __func__, __LINE__);
403 test_double(angsep.Deg(), 2.0, __func__, __LINE__);
408 test_double(angsep.Deg(), 2.0, __func__, __LINE__);
411 test((test1 != test2), __func__, __LINE__);
416 test(
false, __func__, __LINE__);
417 }
catch (std::exception &e) {
418 test(
true, __func__, __LINE__);
465 const std::string& func,
469 bool pass = test_bool((test == expected),
true, func, line);
471 std::printf(
" CoordSys (1 v 2): %d v %d\n",
473 std::printf(
" XCoords: %3.15e : %3.15e (deg), diff = %e arcsec\n",
476 std::printf(
" YCoords: %3.15e : %3.15e (deg), diff = %e arcsec\n",
479 std::printf(
" AngSep: %e arcsec\n",
489 int main(
int argc,
char** argv)
CESkyCoord ConvertToEcliptic(const CEDate &date=CEDate(), const CEObserver &observer=CEObserver())
Convert this coordinate to ECLIPTIC coordinates.
virtual bool test_copy(void)
Test ability to copy coordinates.
virtual ~test_CESkyCoord()
Destructor.
RA, Dec (referenced at the barycenter of the solarsystem)
virtual bool test_ConvertTo(void)
Tests the CESkyCoord::ConvertTo methods.
static void Galactic2ICRS(const CESkyCoord &in_galactic, CESkyCoord *out_icrs)
GALACTIC -> ICRS coordinate conversion.
CESkyCoord ConvertToCIRS(const CEDate &date=CEDate(), const CEObserver &observer=CEObserver())
Convert this coordinate to CIRS coordinates.
static void Ecliptic2ICRS(const CESkyCoord &in_ecliptic, CESkyCoord *out_icrs, const CEDate &date=CEDate())
ECLIPTIC -> ICRS coordinate conversion.
RA, Dec (referenced at the center of the Earth)
Galacitc longitude, latitude.
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.
virtual bool test_Convert2Icrs(void)
Test ability to convert to ICRS.
int main(int argc, char **argv)
Main method that actually runs the tests.
static void CIRS2ICRS(const CESkyCoord &in_cirs, CESkyCoord *out_icrs, const CEDate &date=CEDate())
Convert CIRS to ICRS coordinates.
virtual CEAngle AngularSeparation(const CESkyCoord &coords) const
Get the angular separation between the coordinates represented by this object and another coordinate ...
virtual bool test_construct(void)
Test generic constructors.
static void ICRS2Galactic(const CESkyCoord &in_icrs, CESkyCoord *out_galactic)
ICRS -> GALACTIC coordinate conversion.
static void CIRS2Galactic(const CESkyCoord &in_cirs, CESkyCoord *out_galactic, const CEDate &date=CEDate())
Convert CIRS to Galactic coordinates.
Galacitc longitude, latitude.
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.
virtual bool test_Convert2Cirs(void)
Test ability to set coordinates as CIRS.
void SetRelativeHumidity(const double &humidity=0.0)
Set the observer's relative humidity.
void SetWavelength_um(const double &new_wavelength_um)
Set the observer's observing wavelength (micrometers)
virtual bool test_Convert2Galactic(void)
Test ability to convert to Galactic.
void SetPressure_hPa(const double &pressure=CppEphem::EstimatePressure_hPa(CppEphem::SeaLevelTemp_C()))
Set the observer's pressure.
static void ICRS2Ecliptic(const CESkyCoord &in_icrs, CESkyCoord *out_ecliptic, const CEDate &date=CEDate())
ICRS -> ECLIPTIC coordinate conversion.
CEObserver base_observer_
static void ICRS2CIRS(const CESkyCoord &in_icrs, CESkyCoord *out_cirs, const CEDate &date=CEDate())
ICRS -> CIRS coordinate conversion.
static void Ecliptic2CIRS(const CESkyCoord &in_ecliptic, CESkyCoord *out_cirs, const CEDate &date=CEDate())
ECLIPTIC -> CIRS coordinate conversion.
void SetTemperature_C(const double &temp_C=CppEphem::SeaLevelTemp_C())
Set the observer's temperature (Celsius)
double julian_date_J2000()
Julian Date corresponding to J2000.
static CEAngle Rad(const double &angle)
Return angle constructed from a radians angle.
CESkyCoordType GetCoordSystem(void) const
Return coordinate system.
virtual bool runtests()
Run tests.
static void Ecliptic2Galactic(const CESkyCoord &in_ecliptic, CESkyCoord *out_galactic, const CEDate &date=CEDate())
ECLIPTIC -> GALACTIC coordinate conversion.
CESkyCoord ConvertToObserved(const CEDate &date=CEDate(), const CEObserver &observer=CEObserver())
Convert this coordinate to OBSERVED coordinates.
virtual bool test_coords(const CESkyCoord &test, const CESkyCoord &expected, const std::string &func, const int &line)
Tests two coordinates are equal and print some help if they aren't.
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.
static void Observed2CIRS(const CESkyCoord &in_observed, CESkyCoord *out_cirs, const CEDate &date, const CEObserver &observer)
OBSERVED -> CIRS coordinate conversion.
virtual bool test_AngularSeparation(void)
Test computation of angular separation.
static void CIRS2Ecliptic(const CESkyCoord &in_cirs, CESkyCoord *out_ecliptic, const CEDate &date=CEDate())
Convert CIRS to ECLIPTIC coordinates.
virtual bool test_Convert2Ecliptic(void)
Test ability to convert to Ecliptic.
CESkyCoord ConvertToGalactic(const CEDate &date=CEDate(), const CEObserver &observer=CEObserver())
Convert this coordinate to GALACTIC coordinates.
test_CESkyCoord()
Default constructor.
virtual bool test_Convert2Observed(void)
Test ability to convert to Observed.
double Deg(void) const
Return angle in degrees as a double.
void CorrectionsInterp(bool set_interp)
Set the corrections object to use interpolation.
static void Observed2Galactic(const CESkyCoord &in_observed, CESkyCoord *out_galactic, const CEDate &date, const CEObserver &observer)
OBSERVED -> GALACTIC coordinate conversion.
static void Ecliptic2Observed(const CESkyCoord &in_ecliptic, CESkyCoord *out_observed, const CEDate &date, const CEObserver &observer)
ECLIPTIC -> OBSERVED coordinate conversion.
virtual void SetCoordinates(const CEAngle &xcoord, const CEAngle &ycoord, const CESkyCoordType &coord_type=CESkyCoordType::ICRS) const
Set the coordinates of this object.
void SetReturnType(CEDateType return_type)
Set the return type from the overloaded 'operator double'.
static void Observed2ICRS(const CESkyCoord &in_observed, CESkyCoord *out_icrs, const CEDate &date, const CEObserver &observer)
OBSERVED -> ICRS coordinate conversion.
static void Observed2Ecliptic(const CESkyCoord &in_observed, CESkyCoord *out_ecliptic, const CEDate &date, const CEObserver &observer)
OBSERVED -> ECLIPTIC coordinate conversion.
Ecliptic longitude, latitude.
static void Galactic2CIRS(const CESkyCoord &in_galactic, CESkyCoord *out_cirs, const CEDate &date=CEDate())
GALACTIC -> CIRS coordinate conversion.
static CEAngle Deg(const double &angle)
Return angle (radians) constructed from a degree angle.
CESkyCoord ConvertToICRS(const CEDate &date=CEDate(), const CEObserver &observer=CEObserver())
Convert this coordinate to ICRS coordinates.
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 coordinat...
virtual CEAngle XCoord(const CEDate &jd=CppEphem::julian_date_J2000()) const
Return x coordinate at given Julian date.
Azimuth, Zenith (requires additional observer information)
virtual CEAngle YCoord(const CEDate &jd=CppEphem::julian_date_J2000()) const
Return y coordinate at given Julian date.