This commit is contained in:
Timur A. Fatkhullin 2025-08-09 13:25:52 +03:00
parent b99263a014
commit 22097610f9
5 changed files with 47 additions and 17 deletions

View File

@ -576,10 +576,10 @@ concept mcc_prohibited_zone_c =
{ t.timeFrom(std::declval<const TelemetryDataT&>()) } -> std::same_as<typename T::duration_t>; { t.timeFrom(std::declval<const TelemetryDataT&>()) } -> std::same_as<typename T::duration_t>;
}; };
// // an input range of prohibited zones // an input range of prohibited zones
// template <typename T, typename TelemetryDataT> template <typename T, typename TelemetryDataT>
// concept mcc_irange_of_pzones_c = mcc_mount_telemetry_data_c<TelemetryDataT> && std::ranges::input_range<T> && concept mcc_irange_of_pzones_c = mcc_mount_telemetry_data_c<TelemetryDataT> && std::ranges::input_range<T> &&
// mcc_prohibited_zone_c<std::ranges::range_value_t<T>, TelemetryDataT>; mcc_prohibited_zone_c<std::ranges::range_value_t<T>, TelemetryDataT>;
// // a concept for a callable with the first argument of type satisfied to 'mcc_prohibited_zone_c' // // a concept for a callable with the first argument of type satisfied to 'mcc_prohibited_zone_c'

View File

@ -200,6 +200,39 @@ public:
} }
} }
// compute intersection point for the case of sideral-like moving
bool intersectPoint(traits::mcc_celestial_point_c auto const& target, traits::mcc_celestial_point_c auto& int_point)
{
coord_t ha, dec, az;
_coord2coord(target.coordPairKind, target.x, target.y, target.time_point,
MccCoordPairKind::COORDS_KIND_HADEC_APP, ha, dec);
// compute HA for intersection point
double cos_ha =
(std::sin(_altLimit) - std::sin(dec) * std::sin(_latitude)) / std::cos(dec) / std::cos(_latitude);
if (cos_ha > 1.0) { // no intersection
// compute culmination points?
return false;
}
double cosA = -sin(dec) * std::cos(_latitude) + std::cos(dec) * std::sin(_latitude) * cos_ha;
cosA /= std::cos(_altLimit);
if constexpr (KIND ==
MccAltLimitKind::MIN_ALT_LIMIT) { // the closest time point is one after upper culmination
az = std::acos(cosA);
} else if constexpr (KIND == MccAltLimitKind::MAX_ALT_LIMIT) { // the closest time point is one before upper
// culmination
az = -std::acos(cosA);
}
_coord2coord(MccCoordPairKind::COORDS_KIND_AZALT, az, _altLimit, target.time_point, int_point.coordPairKind,
int_point.x, int_point.y);
return true;
}
private: private:
coord_t _altLimit, _latitude, _abs_lat, _lat_lim; coord_t _altLimit, _latitude, _abs_lat, _lat_lim;
@ -274,13 +307,14 @@ private:
} }
double ha; double ha;
// WARNING: what about south hemisphere?!!!
if (before_upper_culm) { if (before_upper_culm) {
ha = -std::acos(cos_ha); // HA before upper culmination ha = -std::acos(cos_ha); // HA before upper culmination
} else { } else {
ha = std::acos(cos_ha); // HA after upper culmination!! ha = std::acos(cos_ha); // HA after upper culmination!!
} }
MccAngle time_ang = ha - ha_app; // in sideral time scale coord_t time_ang = ha - ha_app; // in sideral time scale
if (time_ang < 0.0) { // next day if (time_ang < 0.0) { // next day
time_ang += pi2; time_ang += pi2;

View File

@ -296,7 +296,7 @@ public:
ast_err = this->_astromEngine.hadec2pa(current_data.mntHA, current_data.mntDEC, current_data.mntPA); ast_err = this->_astromEngine.hadec2pa(current_data.mntHA, current_data.mntDEC, current_data.mntPA);
if (!ast_err) { if (!ast_err) {
// target coordinates (assuming its ICRS RA-DEC are already given or computed) // target coordinates (assuming its ICRS RA-DEC are already given or computed)
typename mount_telemetry_data_t::eo_t eo; typename astrom_engine_t::eo_t eo;
ast_err = this->_astromEngine.icrs2obs(current_data.tagRA_ICRS, current_data.tagDEC_ICRS, ast_err = this->_astromEngine.icrs2obs(current_data.tagRA_ICRS, current_data.tagDEC_ICRS,
current_data.jd, current_data.tagRA, current_data.tagDEC, current_data.jd, current_data.tagRA, current_data.tagDEC,
current_data.tagHA, current_data.tagAZ, current_data.tagALT, eo); current_data.tagHA, current_data.tagAZ, current_data.tagALT, eo);

View File

@ -117,13 +117,11 @@ public:
MccMountTelemetryAstromTransform& operator=(MccMountTelemetryAstromTransform&& other) MccMountTelemetryAstromTransform& operator=(MccMountTelemetryAstromTransform&& other)
{ {
if (this == &other) { if (this != &other) {
return; _pec = other._pec;
_astromEngine = other._astromEngine;
} }
_pec = other._pec;
_astromEngine = other._astromEngine;
return *this; return *this;
} }
@ -134,13 +132,11 @@ public:
MccMountTelemetryAstromTransform& operator=(const MccMountTelemetryAstromTransform& other) MccMountTelemetryAstromTransform& operator=(const MccMountTelemetryAstromTransform& other)
{ {
if (this == &other) { if (this != &other) {
return; _pec = other._pec;
_astromEngine = other._astromEngine;
} }
_pec = other._pec;
_astromEngine = other._astromEngine;
return *this; return *this;
} }

View File

@ -163,7 +163,7 @@ int main(int argc, char* argv[])
// std::cout << "\n\n\n\n"; // std::cout << "\n\n\n\n";
using engine_t = mcc::astrom::erfa::MccMountAstromEngineERFA<>; using engine_t = mcc::astrom::erfa::MccMountAstromEngineERFA;
engine_t::engine_state_t state; engine_t::engine_state_t state;
state.lon = 41.440732_degs; state.lon = 41.440732_degs;
state.lat = 43.646711_degs; state.lat = 43.646711_degs;