mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
astroDynamics_test.cpp
Go to the documentation of this file.
1 /** \file astroDynamics_test.cpp
2  */
3 
4 #include "../../catch2/catch.hpp"
5 
6 
7 #include "../../../include/astro/astroDynamics.hpp"
8 
9 /** Scenario: calculating parallactic angles
10  *
11  * Compares par. ang. calc vs. an actual observation.
12  *
13  * \anchor tests_astrodynamics_parang
14  */
15 SCENARIO( "calculating parallactic angles", "[astroDynamics::parang]" )
16 {
17  GIVEN("a typical target")
18  {
19  //Using an actual obervation of beta Pic and FITS headers.
20 
21  double dec = -51.06575; //beta Pic.
22  double lat = -29.015; //LCO
23  WHEN("before transit")
24  {
25  double ha = -0.739167/24.*360.;
26 
27  double parang = mx::astro::parAngDeg( ha, dec, lat, true);
28  double diff = fabs( parang - (-24.903)); //The result from the TCS.
29 
30  REQUIRE(parang < 0);
31  REQUIRE(diff <= 1e-1); //This is just a roughly close enough test -- don't have exact precision of TCS, etc.
32  }
33 
34  WHEN("after transit")
35  {
36  double ha = 2.008889/24.*360.;
37 
38  double parang = mx::astro::parAngDeg( ha, dec, lat, true);
39  double diff = fabs( parang - (57.1241)); //The result from the TCS.
40 
41  REQUIRE(parang > 0);
42  REQUIRE(diff <= 1e-1); //This is just a roughly close enough test -- don't have exact precision of TCS, etc.
43  }
44 
45  }
46 }
47 
SCENARIO("calculating parallactic angles", "[astroDynamics::parang]")
realT parAngDeg(realT sinHA, realT cosHA, realT sinDec, realT cosDec, realT tanLat)
Calculate the Parallactic Angle from the pre-calculated trig functions. Result in degrees.