mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Loading...
Searching...
No Matches
astroDynamics_test.cpp
Go to the documentation of this file.
1/** \file astroDynamics_test.cpp
2 */
3
4#include "../../catch2/catch.hpp"
5
6#include "../../../include/astro/astroDynamics.hpp"
7
8/** Scenario: calculating parallactic angles
9 *
10 * Compares par. ang. calc vs. an actual observation.
11 *
12 * \anchor tests_astrodynamics_parang
13 */
14SCENARIO( "calculating parallactic angles", "[astroDynamics::parang]" )
15{
16 GIVEN( "a typical target" )
17 {
18 // Using an actual obervation of beta Pic and FITS headers.
19
20 double dec = -51.06575; // beta Pic.
21 double lat = -29.015; // LCO
22 WHEN( "before transit" )
23 {
24 double ha = -0.739167 / 24. * 360.;
25
26 double parang = mx::astro::parAngDeg( ha, dec, lat, true );
27 double diff = fabs( parang - ( -24.903 ) ); // The result from the TCS.
28
29 REQUIRE( parang < 0 );
30 REQUIRE( diff <=
31 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 <=
43 1e-1 ); // This is just a roughly close enough test -- don't have exact precision of TCS, etc.
44 }
45 }
46}
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.