add IERS Bulletins updater bash-script

This commit is contained in:
2026-04-03 11:36:20 +03:00
parent 2bc797b9ae
commit 6dc684bb4a
4 changed files with 526 additions and 493 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -196,14 +196,14 @@ protected:
{
if constexpr (pairKind != MccCoordPairKind::COORDS_KIND_GENERIC &&
pairKind != MccCoordPairKind::COORDS_KIND_XY) {
if constexpr (pairKind == MccCoordPairKind::COORDS_KIND_HADEC_APP ||
pairKind == MccCoordPairKind::COORDS_KIND_HADEC_OBS) {
_x = (double)MccAngle(_x).normalize<MccAngle::NORM_KIND_180_180>();
} else { // RA, AZ
_x = (double)MccAngle(_x).normalize<MccAngle::NORM_KIND_0_360>();
}
// if constexpr (pairKind == MccCoordPairKind::COORDS_KIND_HADEC_APP ||
// pairKind == MccCoordPairKind::COORDS_KIND_HADEC_OBS) {
// _x = (double)MccAngle(_x).normalize<MccAngle::NORM_KIND_180_180>();
// } else { // RA, AZ
// _x = (double)MccAngle(_x).normalize<MccAngle::NORM_KIND_0_360>();
// }
// _x = (double)MccAngle(_x).normalize<MccAngle::NORM_KIND_0_360>();
_x = (double)MccAngle(_x).normalize<MccAngle::NORM_KIND_0_360>();
// if (utils::isEqual((double)_x, MCC_TWO_PI)) {
// _x = 0.0;

View File

@@ -57,7 +57,8 @@ int main(int narg, char* argv[])
// x - degs, y -degs, diff_x - arcsecs, diff_y - arcsecs
fst >> x >> y >> diff_x >> diff_y;
std::println("\t{}\t{} {} {} {}", i++, x, y, diff_x, diff_y);
// std::println("\t{}\t{:10.6f} {:10.6f} {:8.6f} {:8.6f}", i++, x, y, diff_x, diff_y);
std::print("\t{}\t{:10.6f} {:10.6f} {:8.6f} {:8.6f}", i++, x, y, diff_x, diff_y);
tag_ha = x + diff_x / 3600.0;
tag_dec = y + diff_y / 3600.0;
@@ -67,6 +68,9 @@ int main(int narg, char* argv[])
xy = MccGenXY(MccAngleX(x, mcc_degrees), MccAngleY(y, mcc_degrees));
std::println("\t[encX = {:10.6f} encY = {:10.6f} HA = {} DEC = {}]", xy.x().degrees(), xy.y().degrees(),
hadec.x().sexagesimal(true), hadec.y().sexagesimal());
// pcm_cstr.addPoint(sp, xy);
pcm_cstr.addPoint(hadec, xy);
}

36
update_iers_data.sh Executable file
View File

@@ -0,0 +1,36 @@
#!/bin/bash
#
# $1 - output filename
#
if [[ $# -eq 0 ]]; then
res_file="mcc_ccte_iers_default.h"
else
res_file=$1
fi
echo -e '#pragma once\n
#include <string>\n
namespace mcc::ccte::iers::defaults\n
{
// https://hpiers.obspm.fr/iers/bul/bulc/Leap_Second.dat\n
static std::string MCC_DEFAULT_LEAP_SECONDS_FILE = R"--(\n' > $res_file
wget --quiet https://hpiers.obspm.fr/iers/bul/bulc/Leap_Second.dat -O - >> $res_file
echo -e ')--";\n\n' >> $res_file
echo -e '// https://datacenter.iers.org/data/latestVersion/bulletinA.txt\n
static std::string MCC_DEFAULT_IERS_BULLETIN_A_FILE = R"--(\n' >> $res_file
wget --quiet https://datacenter.iers.org/data/latestVersion/bulletinA.txt -O - >> $res_file
echo -e ')--";\n
} // namespace mcc::ccte::iers::defaults\n' >> $res_file