diff --git a/cxx/mcc_erfa.h b/cxx/mcc_erfa.h new file mode 100644 index 0000000..0a3ea32 --- /dev/null +++ b/cxx/mcc_erfa.h @@ -0,0 +1,44 @@ +#pragma once + +/* MOUNT CONTROL COMPONENTS LIBRARY */ + +/* ERFA-LIBRARY WRAPPER FUNCTIONS */ + +#include "mcc_mount_coord.h" + +namespace mcc::erfa +{ + +#include +#include + + +/* + * hour angle and declination to azimuth and altitude + * + */ +template HaT, + std::convertible_to DecT, + std::convertible_to LatT, + std::convertible_to AzT, + std::convertible_to 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 HaT, + std::convertible_to DecT, + std::convertible_to LatT> +MccAngle hadec2pa(const HaT& ha, const DecT& dec, const LatT& lat) +{ + return eraHd2pa(ha, dec, lat); +} + + + +} // namespace mcc::erfa