...
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "mcc_angle.h"
|
||||
#include "mcc_ccte_erfa_new.h"
|
||||
#include "mcc_defaults.h"
|
||||
#include "mcc_generics.h"
|
||||
|
||||
@@ -182,10 +183,10 @@ struct MccSkyRADEC_APP : MccNamedCoordPair<MccAngleRA_APP, MccAngleDEC_APP> {
|
||||
using MccNamedCoordPair<MccAngleRA_APP, MccAngleDEC_APP>::MccNamedCoordPair;
|
||||
};
|
||||
|
||||
|
||||
struct MccSkyRADEC_OBS : MccNamedCoordPair<MccAngleRA_OBS, MccAngleDEC_OBS> {
|
||||
using MccNamedCoordPair<MccAngleRA_OBS, MccAngleDEC_OBS>::MccNamedCoordPair;
|
||||
};
|
||||
typedef MccNamedCoordPair<MccAngleRA_OBS, MccAngleDEC_OBS> MccSkyRADEC_OBS;
|
||||
// struct MccSkyRADEC_OBS : MccNamedCoordPair<MccAngleRA_OBS, MccAngleDEC_OBS> {
|
||||
// using MccNamedCoordPair<MccAngleRA_OBS, MccAngleDEC_OBS>::MccNamedCoordPair;
|
||||
// };
|
||||
|
||||
|
||||
struct MccSkyHADEC_APP : MccNamedCoordPair<MccAngleHA_APP, MccAngleDEC_APP> {
|
||||
@@ -251,12 +252,6 @@ struct mcc_skypoint_interface_t {
|
||||
{
|
||||
return std::forward<SelfT>(self).operator PT();
|
||||
}
|
||||
|
||||
template <std::derived_from<mcc_skypoint_interface_t> SelfT, mcc_coord_pair_c PT, mcc_coord_pair_c... PTs>
|
||||
operator std::tuple<PT, PTs...>(this SelfT&& self)
|
||||
{
|
||||
return std::forward<SelfT>(self).operator std::tuple<PT, PTs...>();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
@@ -267,7 +262,7 @@ concept mcc_skypoint_c = std::derived_from<T, mcc_skypoint_interface_t> && requi
|
||||
|
||||
|
||||
|
||||
/* MCC-LIBRARY DEFAULT SKY POINT CLASS IMPLEMENTATION BASED ON ERFA-LIBRARY */
|
||||
/* MCC-LIBRARY DEFAULT GENERIC SKY POINT CLASS IMPLEMENTATION */
|
||||
|
||||
|
||||
template <typename CCTE_T>
|
||||
@@ -325,7 +320,7 @@ public:
|
||||
|
||||
|
||||
template <mcc_coord_pair_c PT, mcc_coord_pair_c... PTs>
|
||||
auto to(PT& cpair, PTs&... cpairs)
|
||||
auto to(PT& cpair, PTs&... cpairs) const
|
||||
{
|
||||
toHelper(cpair);
|
||||
|
||||
@@ -334,13 +329,23 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template <mcc_coord_pair_c PT>
|
||||
operator PT()
|
||||
{
|
||||
PT res;
|
||||
to(res);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
protected:
|
||||
double _x{0.0}, _y{0.0};
|
||||
MccCoordPairKind _pairKind{MccCoordPairKind::COORDS_KIND_RADEC_ICRS};
|
||||
MccCelestialCoordEpoch _epoch{}; // J2000.0
|
||||
|
||||
template <mcc_coord_pair_c PT>
|
||||
auto toHelper(PT& cpair)
|
||||
auto toHelper(PT& cpair) const
|
||||
{
|
||||
static constexpr double half_pi = std::numbers::pi / 2.0;
|
||||
|
||||
@@ -401,41 +406,11 @@ protected:
|
||||
static_assert(PT::pairKind != MccCoordPairKind::COORDS_KIND_UNKNOWN, "UNSUPPORTED SKY POINT TRANSFORMATION!");
|
||||
|
||||
|
||||
if (_pairKind == MccCoordPairKind::COORDS_KIND_RADEC_ICRS) {
|
||||
if constexpr (PT::pairKind ==
|
||||
MccCoordPairKind::COORDS_KIND_RADEC_ICRS) { // from ICRS to ICRS - just copy and exit
|
||||
cpair = PT(typename PT::x_t(_x), typename PT::y_t(_y));
|
||||
if (_pairKind == MccCoordPairKind::COORDS_KIND_RADEC_ICRS &&
|
||||
PT::pairKind == MccCoordPairKind::COORDS_KIND_RADEC_ICRS) { // from ICRS to ICRS - just copy and exit
|
||||
cpair = PT(typename PT::x_t(_x), typename PT::y_t(_y));
|
||||
|
||||
return;
|
||||
} else { // from ICRS to apparent or observed
|
||||
// if constexpr (mccIsAppCoordPairKind<PT::pairKind>) {
|
||||
// ccte_err = cctEngine.icrsToApp(_x, _y, cpair.epoch(), &ra, &dec, &ha, &az, &zd);
|
||||
// } else if constexpr (mccIsObsCoordPairKind<PT::pairKind>) {
|
||||
// ccte_err = cctEngine.icrsToObs(_x, _y, cpair.epoch(), &ra, &dec, &ha, &az, &zd);
|
||||
// } else {
|
||||
// static_assert(true, "UNSUPPORTED SKY POINT TRANSFORMATION!");
|
||||
// }
|
||||
|
||||
// if constexpr (PT::pairKind == MccCoordPairKind::COORDS_KIND_RADEC_APP ||
|
||||
// PT::pairKind == MccCoordPairKind::COORDS_KIND_RADEC_OBS) {
|
||||
// cpair.setX(ra);
|
||||
// cpair.setY(dec);
|
||||
// } else if constexpr (PT::pairKind == MccCoordPairKind::COORDS_KIND_HADEC_APP ||
|
||||
// PT::pairKind == MccCoordPairKind::COORDS_KIND_HADEC_OBS) {
|
||||
// cpair.setX(ha);
|
||||
// cpair.setY(dec);
|
||||
// } else if constexpr (PT::pairKind == MccCoordPairKind::COORDS_KIND_AZZD) {
|
||||
// cpair.setX(az);
|
||||
// cpair.setY(zd);
|
||||
// } else if constexpr (PT::pairKind == MccCoordPairKind::COORDS_KIND_AZALT) {
|
||||
// cpair.setX(az);
|
||||
// cpair.setY(half_pi - zd);
|
||||
// } else {
|
||||
// static_assert(true, "UNSUPPORTED SKY POINT TRANSFORMATION!");
|
||||
// }
|
||||
|
||||
// return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// just copy coordinates and exit
|
||||
@@ -636,4 +611,9 @@ protected:
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/* MCC-LIBRARY DEFAULT SKY POINT CLASS WITH ERFA-LIBRARY BASED ENGINE */
|
||||
|
||||
typedef MccGenericSkyPoint<ccte::erfa::MccCCTE_ERFA> MccSkyPoint;
|
||||
|
||||
} // end namespace mcc
|
||||
|
||||
Reference in New Issue
Block a user