...
This commit is contained in:
parent
02afd65d6f
commit
f6f040e27c
44
cxx/mcc_erfa.h
Normal file
44
cxx/mcc_erfa.h
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
/* MOUNT CONTROL COMPONENTS LIBRARY */
|
||||||
|
|
||||||
|
/* ERFA-LIBRARY WRAPPER FUNCTIONS */
|
||||||
|
|
||||||
|
#include "mcc_mount_coord.h"
|
||||||
|
|
||||||
|
namespace mcc::erfa
|
||||||
|
{
|
||||||
|
|
||||||
|
#include <erfa.h>
|
||||||
|
#include <erfam.h>
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* hour angle and declination to azimuth and altitude
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
template <std::convertible_to<MccAngleHA> HaT,
|
||||||
|
std::convertible_to<MccAngleDEC_APP> DecT,
|
||||||
|
std::convertible_to<MccAngleLAT> LatT,
|
||||||
|
std::convertible_to<MccAngleAZ> AzT,
|
||||||
|
std::convertible_to<MccAngleALT> AltT>
|
||||||
|
void hadec2azalt(const HaT& ha, const DecT& dec, const LatT& lat, AzT& az, AltT& alt)
|
||||||
|
{
|
||||||
|
double az_d, alt_d;
|
||||||
|
|
||||||
|
eraHd2ae(ha, dec, lat, &az_d, &alt_d);
|
||||||
|
az = az_d;
|
||||||
|
alt = alt_d;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <std::convertible_to<MccAngleHA> HaT,
|
||||||
|
std::convertible_to<MccAngleDEC_APP> DecT,
|
||||||
|
std::convertible_to<MccAngleLAT> LatT>
|
||||||
|
MccAngle hadec2pa(const HaT& ha, const DecT& dec, const LatT& lat)
|
||||||
|
{
|
||||||
|
return eraHd2pa(ha, dec, lat);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace mcc::erfa
|
||||||
Loading…
x
Reference in New Issue
Block a user