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
* \brief Tests astrodynamics calculations.
3
*/
4
5
#include "../../catch2/catch.hpp"
6
7
#include "
../../../include/astro/astroDynamics.hpp
"
8
9
/** calculating parallactic angles
10
*
11
* Compares par. ang. calc vs. an actual observation.
12
*
13
*/
14
/**
15
* \ingroup astroDynamics_unit_tests
16
*/
17
TEST_CASE
(
"calculating parallactic angles"
,
"[astroDynamics::parang]"
)
18
{
19
GIVEN(
"a typical target"
)
20
{
21
// Using an actual obervation of beta Pic and FITS headers.
22
23
double
dec = -51.06575;
// beta Pic.
24
double
lat = -29.015;
// LCO
25
WHEN(
"before transit"
)
26
{
27
double
ha = -0.739167 / 24. * 360.;
28
29
double
parang =
mx::astro::parAngDeg
( ha, dec, lat,
true
);
30
double
diff = fabs( parang - ( -24.903 ) );
// The result from the TCS.
31
32
REQUIRE( parang < 0 );
33
REQUIRE( diff <=
34
1e-1 );
// This is just a roughly close enough test -- don't have exact precision of TCS, etc.
35
}
36
37
WHEN(
"after transit"
)
38
{
39
double
ha = 2.008889 / 24. * 360.;
40
41
double
parang =
mx::astro::parAngDeg
( ha, dec, lat,
true
);
42
double
diff = fabs( parang - ( 57.1241 ) );
// The result from the TCS.
43
44
REQUIRE( parang > 0 );
45
REQUIRE( diff <=
46
1e-1 );
// This is just a roughly close enough test -- don't have exact precision of TCS, etc.
47
}
48
}
49
}
astroDynamics.hpp
Various utilities for astrodynamics.
TEST_CASE
TEST_CASE("calculating parallactic angles", "[astroDynamics::parang]")
Definition
astroDynamics_test.cpp:17
mx::astro::parAngDeg
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.
Definition
astroDynamics.hpp:258
tests
include
astro
astroDynamics_test.cpp
Generated on
for mxlib by
1.15.0