From 85377da7c7c3ff629d79b7193f99b0bd7171f591 Mon Sep 17 00:00:00 2001 From: bert hubert Date: Tue, 21 Jul 2020 11:18:31 +0200 Subject: [PATCH] add rinjoin tool that parses rinex files and emits a joined up CVS file of af0 parameters --- Makefile | 7 +++++-- rinjoin.cc | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 rinjoin.cc diff --git a/Makefile b/Makefile index a008e1b..b606090 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ endif CHEAT_ARG := $(shell ./update-git-hash-if-necessary) PROGRAMS = navparse ubxtool navnexus navcat navrecv navdump testrunner navdisplay tlecatch reporter sp3feed \ - galmonmon rinreport rtcmtool gndate + galmonmon rinreport rinjoin rtcmtool gndate all: navmon.pb.cc $(PROGRAMS) @@ -117,6 +117,10 @@ tlecatch: tlecatch.o $(patsubst %.cc,%.o,$(wildcard ext/sgp4/libsgp4/*.cc)) gith rinreport: rinreport.o rinex.o githash.o navmon.o ext/fmt-6.1.2/src/format.o ephemeris.o osen.o $(CXX) -std=gnu++17 $^ -o $@ -lz -pthread +rinjoin: rinjoin.o rinex.o githash.o navmon.o ext/fmt-6.1.2/src/format.o ephemeris.o osen.o + $(CXX) -std=gnu++17 $^ -o $@ -lz -pthread + + rtcmtool: rtcmtool.o navmon.pb.o githash.o ext/fmt-6.1.2/src/format.o bits.o nmmsender.o $(SIMPLESOCKETS) navmon.o rtcm.o zstdwrap.o $(CXX) -std=gnu++17 $^ -o $@ -L/usr/local/lib -lz -pthread -lprotobuf -lzstd @@ -129,7 +133,6 @@ testrunner: navmon.pb.o testrunner.o ubx.o bits.o ext/fmt-6.1.2/src/format.o gal gndate: gndate.o githash.o ext/fmt-6.1.2/src/format.o navmon.o $(CXX) -std=gnu++17 $^ -o $@ -L/usr/local/lib - check: testrunner ./testrunner diff --git a/rinjoin.cc b/rinjoin.cc new file mode 100644 index 0000000..85814bd --- /dev/null +++ b/rinjoin.cc @@ -0,0 +1,50 @@ +#include +#include "rinex.hh" +#include +#include +using namespace std; + +struct Value +{ + optional af0Inav; + optional af0Fnav; + int af1; + optional BGDE1E5a; + optional BGDE1E5b; +}; + +map, Value> satmap; + +int main(int argc, char** argv) +{ + for(int n = 1; n < argc; ++n) { + RINEXReader rr(argv[n]); + RINEXEntry e; + while(rr.get(e)) { + if(e.gnss != 2) + continue; + // cout << e.t <<" " << e.sv <<" " << (int64_t)(rint(ldexp(e.af0,34))) <<" " << (int64_t)(rint(ldexp(e.BGDE1E5a,32)))<<" " << (int64_t)(rint(ldexp(e.BGDE1E5b,32))) <<" "<