Go to the documentation of this file.
80 std::cout <<
"\nTesting CECoordinates:\n";
108 test_double(test1.
XCoord(), 0.0, __func__, __LINE__);
110 test_double(test1.
YCoord(), 0.0, __func__, __LINE__);
122 test_double(test3a.XCoordinate_Rad(), testx, __func__, __LINE__);
123 test_double(test3a.YCoordinate_Rad(), testy, __func__, __LINE__);
126 test_double(test3b.XCoordinate_Rad(), testx, __func__, __LINE__);
127 test_double(test3b.YCoordinate_Rad(), testy, __func__, __LINE__);
131 test_double(test4.XCoordinate_Rad(), testx, __func__, __LINE__);
132 test_double(test4.YCoordinate_Rad(), testy, __func__, __LINE__);
133 test_int(
int(test4.GetCoordSystem()),
int(test2.
GetCoordSystem()), __func__, __LINE__);
140 test_greaterthan(test4.print().size(), 0, __func__, __LINE__);
158 test((cirs ==
base_cirs_), __func__, __LINE__);
162 test((icrs ==
base_icrs_), __func__, __LINE__);
166 test((gal ==
base_gal_), __func__, __LINE__);
170 test((obs ==
base_obs_), __func__, __LINE__);
174 test((gal == icrs), __func__, __LINE__);
275 double ra(0.0), dec(0.0);
331 double glon(0.0), glat(0.0);
487 test(
false, __func__, __LINE__);
488 }
catch (std::exception &e) {
489 test(
true, __func__, __LINE__);
505 double ang_var(45.50833333333333);
507 std::vector<double> ang_vec = {45, 30, 30, 0.0};
508 std::vector<double> hrs_vec = {3.0, 2.0, 2.0, 0.0};
511 double tol_old(DblTol());
516 test_vect(test1, ang_vec, __func__, __LINE__);
520 test_double(test2a, ang_var, __func__, __LINE__);
522 test_double(test2b, ang_rad, __func__, __LINE__);
526 test_vect(test3, hrs_vec, __func__, __LINE__);
530 test_double(test4a, ang_var, __func__, __LINE__);
532 test_double(test4b, ang_rad, __func__, __LINE__);
556 test_double(angsep.
Deg(), 2.0, __func__, __LINE__);
558 test_double(angsep.Deg(), 2.0, __func__, __LINE__);
561 test_double(angsep.Deg(), 2.0, __func__, __LINE__);
564 test((test1 != test2), __func__, __LINE__);
610 const std::string& func,
614 bool pass = test_bool((test == expected),
true, func, line);
616 std::printf(
" CoordSys (1 v 2): %d v %d\n",
618 std::printf(
" XCoords: %3.15e : %3.15e (deg), diff = %e arcsec\n",
621 std::printf(
" YCoords: %3.15e : %3.15e (deg), diff = %e arcsec\n",
624 std::printf(
" AngSep: %e arcsec\n",
634 int main(
int argc,
char** argv)
double Elevation_m() const
Return altitude in meters above sea level.
static double DMSToAngle(const std::vector< double > &angle, const CEAngleType &return_type=CEAngleType::DEGREES)
Convert a given angle vector from {degrees, minutes, seconds} to an angle.
int main(int argc, char **argv)
Main method that actually runs the tests.
static int Observed2Galactic(double az, double zen, double *glon, double *glat, const CEDate &date, const CEObserver &observer, const CEAngleType &angle_type=CEAngleType::RADIANS)
Convert Observed -> Galactic coordinates.
test_CECoordinates()
Default constructor.
virtual CEAngle AngularSeparation(const CECoordinates &coords) const
Get the angular separation between the coordinates represented by this object and another coordinate ...
virtual bool test_Convert2Cirs(void)
Test ability to set coordinates as CIRS.
Galacitc longitude, latitude.
std::vector< double > DmsVect(void) const
Return vector of doubles representing the {degrees, arcmin, arcsec, arcsec-fraction}.
static void CIRS2Galactic(double ra, double dec, double *glon, double *glat, const CEDate &date=CEDate(), const CEAngleType &angle_type=CEAngleType::RADIANS)
CIRS -> Galactic coordinate conversion.
double Temperature_C() const
Return temperature in degrees Celsius.
virtual bool test_copy(void)
Test ability to copy coordinates.
static void ICRS2Galactic(double ra, double dec, double *glon, double *glat, const CEAngleType &angle_type=CEAngleType::RADIANS)
ICRS -> Galactic coordinate conversion (uses the SOFA 'iauIcrs2g' function)
virtual double XCoordinate_Deg(double jd=CppEphem::julian_date_J2000()) const
Returns x coordinate at given julian date in degrees.
CECoordinates ConvertToICRS(double jd=CEDate::CurrentJD(), double longitude=0.0, double latitude=0.0, double elevation_m=0.0, double pressure_hPa=-1.0, double temperature_celsius=-1000, double relative_humidity=0.0, double dut1=0.0, double xp=0.0, double yp=0.0, double wavelength_um=0.5)
Convert these coordinates to ICRS coordinates.
virtual bool test_HmsDms2Angle(void)
Test conversions between HMS and DMS to angle and back.
virtual CECoordinates GetObservedCoords(const double &julian_date, const double &longitude, const double &latitude, const double &elevation_m=0.0, const double &pressure_hPa=-1.0, const double &temperature_celsius=-1000, const double &relative_humidity=0.0, const double &dut1=0.0, const double &xp=0.0, const double &yp=0.0, const double &wavelength_um=0.5) const
Return the local sky coordinates of this object as a CECoordinates object.
static void CIRS2ICRS(double input_ra, double input_dec, double *return_ra, double *return_dec, const CEDate &date=CEDate(), const CEAngleType &angle_type=CEAngleType::RADIANS)
CIRS -> ICRS coordinate conversion.
static int Observed2CIRS(double az, double zen, double *ra, double *dec, const CEDate &date, const CEObserver &observer, const CEAngleType &angle_type=CEAngleType::RADIANS)
Convert Observed -> CIRS coordinates.
virtual CEAngle YCoord(const double &jd=CppEphem::julian_date_J2000()) const
Return y coordinate at given Julian date.
virtual double XCoordinate_Rad(double jd=CppEphem::julian_date_J2000()) const
Return x coordinate at given Julian date in radians.
CECoordinates ConvertToGalactic(double jd=CEDate::CurrentJD(), double longitude=0.0, double latitude=0.0, double elevation_m=0.0, double pressure_hPa=-1.0, double temperature_celsius=-1000, double relative_humidity=0.0, double dut1=0.0, double xp=0.0, double yp=0.0, double wavelength_um=0.5)
Convert these coordinates to GALACTIC coordinates.
double RelativeHumidity() const
Return relative humidity.
virtual ~test_CECoordinates()
Destructor.
double Longitude_Rad() const
Return observer geographic longitude in radians.
virtual bool runtests()
Run tests.
void SetRelativeHumidity(const double &humidity=0.0)
Set the observer's relative humidity.
virtual double YCoordinate_Deg(double jd=CppEphem::julian_date_J2000()) const
Returns y coordinate at given Julian date in degrees.
RA, Dec (referenced at the barycenter of the solarsystem)
CECoordinates ConvertTo(CECoordinateType output_coord_type, const CEObserver &observer, const CEDate &date=CEDate::CurrentJD())
Convert these coordinates to another coordinate system NOTE: If this object is not OBSERVED coordinat...
void SetWavelength_um(const double &new_wavelength_um)
Set the observer's observing wavelength (micrometers)
CEObserver base_observer_
static int Observed2ICRS(double az, double zen, double *ra, double *dec, const CEDate &date, const CEObserver &observer, const CEAngleType &angle_type=CEAngleType::RADIANS)
Convert Observed -> ICRS coordinates.
void SetPressure_hPa(const double &pressure=CppEphem::EstimatePressure_hPa(CppEphem::SeaLevelTemp_C()))
Set the observer's pressure.
static std::vector< double > GetDMS(const double &angle, const CEAngleType &angle_type=CEAngleType::DEGREES)
Convert a given angle into degrees, arcminutes, arcseconds.
virtual bool test_Convert2Icrs(void)
Test ability to convert to ICRS.
static double ypolar(const double &date, const CEDateType &date_type=CEDateType::JD)
Polar motion (xy for a given date.
double Rad(void) const
Return angle in radians as a double.
double Pressure_hPa() const
Return atmospheric pressure in units of hPa.
CECoordinates ConvertToCIRS(double jd=CEDate::CurrentJD(), double longitude=0.0, double latitude=0.0, double elevation_m=0.0, double pressure_hPa=-1.0, double temperature_celsius=-1000, double relative_humidity=0.0, double dut1=0.0, double xp=0.0, double yp=0.0, double wavelength_um=0.5)
Convert these coordinates to CIRS coordinates.
double Wavelength_um() const
Return the wavelength in units of micrometers.
void SetTemperature_C(const double &temp_C=CppEphem::SeaLevelTemp_C())
Set the observer's temperature (Celsius)
CECoordinateType GetCoordSystem(void) const
Return coordinate system.
double julian_date_J2000()
Julian Date corresponding to J2000.
CECoordinates ConvertToObserved(double jd=CEDate::CurrentJD(), double longitude=0.0, double latitude=0.0, double elevation_m=0.0, double pressure_hPa=-1.0, double temperature_celsius=-1000, double relative_humidity=0.0, double dut1=0.0, double xp=0.0, double yp=0.0, double wavelength_um=0.5)
Convert these coordinates to observed coordinates.
virtual bool test_construct(void)
Test generic constructors.
virtual bool test_ConvertTo(void)
Tests the CECoordinates::ConvrtTo methods.
static void Galactic2CIRS(double glon, double glat, double *ra, double *dec, const CEDate &date=CEDate(), const CEAngleType &angle_type=CEAngleType::RADIANS)
Galactic -> CIRS coordinate conversion.
virtual bool test_coords(const CECoordinates &test, const CECoordinates &expected, const std::string &func, const int &line)
Tests two coordinates are equal and print some help if they aren't.
static int CIRS2Observed(double ra, double dec, double *az, double *zen, const CEDate &date, const CEObserver &observer, const CEAngleType &angle_type=CEAngleType::RADIANS, double wavelength_um=0.5, double *observed_ra=nullptr, double *observed_dec=nullptr, double *hour_angle=nullptr)
CIRS -> Observed (or observer specific) coordinate conversion This function takes in verious observat...
static int Galactic2Observed(double glon, double glat, double *az, double *zen, const CEDate &date, const CEObserver &observer, const CEAngleType &angle_type=CEAngleType::RADIANS, double wavelength_um=0.5, double *observed_glon=nullptr, double *observed_glat=nullptr, double *hour_angle=nullptr)
Galactic -> Observed (i.e.
static double HMSToAngle(const std::vector< double > &angle, const CEAngleType &return_type=CEAngleType::DEGREES)
Convert from {hours, minutes, seconds} to an angle.
static std::vector< double > GetHMS(const double &angle, const CEAngleType &angle_type=CEAngleType::DEGREES)
Convert a given angle into hours, minutes, seconds.
double Deg(void) const
Return angle in degrees as a double.
virtual bool test_Convert2Galactic(void)
Test ability to convert to Galactic.
void CorrectionsInterp(bool set_interp)
Set the corrections object to use interpolation.
virtual CEAngle XCoord(const double &jd=CppEphem::julian_date_J2000()) const
Return x coordinate at given Julian date.
RA, Dec (referenced at the center of the Earth)
static double xpolar(const double &date, const CEDateType &date_type=CEDateType::JD)
Polar motion (x) for a given date.
static void ICRS2CIRS(double input_ra, double input_dec, double *return_ra, double *return_dec, const CEDate &date=CEDate(), const CEAngleType &angle_type=CEAngleType::RADIANS)
ICRS -> CIRS coordinate conversion.
virtual void SetCoordinates(const CEAngle &xcoord, const CEAngle &ycoord, const CECoordinateType &coord_type=CECoordinateType::ICRS)
Set the coordinates of this object.
virtual double YCoordinate_Rad(double jd=CppEphem::julian_date_J2000()) const
Returns y coordinate at given Julian date in radians.
void SetReturnType(CEDateType return_type)
Set the return type from the overloaded 'operator double'.
virtual bool test_Convert2Observed(void)
Test ability to convert to Observed.
virtual double JD() const
Get the Julian date represented by this object.
double Latitude_Rad() const
Return geographic latitude in radians.
Azimuth, Zenith (requires additional observer information)
static CEAngle Deg(const double &angle)
Return angle (radians) constructed from a degree angle.
static int ICRS2Observed(double ra, double dec, double *az, double *zen, const CEDate &date, const CEObserver &observer, const CEAngleType &angle_type=CEAngleType::RADIANS, double wavelength_um=0.5, double *observed_ra=nullptr, double *observed_dec=nullptr, double *hour_angle=nullptr)
ICRS -> Observed coordinate conversion.
static void Galactic2ICRS(double glon, double glat, double *ra, double *dec, const CEAngleType &angle_type=CEAngleType::RADIANS)
Galactic -> ICRS coordinate conversion.
static double dut1(const double &date, const CEDateType &date_type=CEDateType::JD)
Return dut1 based on a given modified date.
virtual bool test_AngularSeparation(void)
Test computation of angular separation.