Skip to content

Commit 6e4283b

Browse files
committed
dpod extrapolate
1 parent 9019f20 commit 6e4283b

3 files changed

Lines changed: 43 additions & 144 deletions

File tree

include/utilities.hpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/** @file
2+
* Utilities: high-level functions for normal, often used operations on SINEX
3+
* files.
4+
*/
5+
6+
#ifndef __DSO_SINEX_UTILITY_FUNCTIONS_HPP__
7+
#define __DSO_SINEX_UTILITY_FUNCTIONS_HPP__
8+
9+
#include "sinex.hpp"
10+
#include "dpod.hpp"
11+
#include <vector>
12+
13+
namespace dso {
14+
int dpod_extrapolate(const std::vector<const char *> &sites_4charid);
15+
} /* namespace dso */
16+
17+
#endif

run_test_suite.py

Lines changed: 0 additions & 144 deletions
This file was deleted.

src/dpod_extrapolate.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#include "utilities.hpp"
2+
3+
int dso::dpod_extrapolate(const dso::datetime<dso::nanoseconds> &t, const std::vector<const char *> &sites_4charid, const char *dpod_snx) noexcept {
4+
/* create the sinex instance */
5+
dso::Sinex snx(dpod_snx);
6+
7+
/* a vector of SiteId's to hold (intermediate) results */
8+
std::vector<dso::sinex::SiteId> siteids;
9+
10+
/* parse the block SITE/ID to collect info for the given sites */
11+
if (snx.parse_block_site_id(sites_4charid, /*use domes=*/false, siteids)) {
12+
fprintf(stderr, "ERROR. Failed matching sites in SINEX file\n");
13+
return 1;
14+
}
15+
16+
/* hold results here */
17+
std::vector<dso::Sinex::SiteCoordinateResults> crd;
18+
19+
/* filter estimates based on date */
20+
if (snx.linear_extrapolate_coordinates(siteids, t, crd)) {
21+
fprintf(stderr, "ERROR Failed extrapolating coordinate estimates\n");
22+
return 1;
23+
}
24+
25+
return 0;
26+
}

0 commit comments

Comments
 (0)