Skip to content

Commit

Permalink
Merge pull request #25 from GeoscienceAustralia/release-v1.5.2
Browse files Browse the repository at this point in the history
Release v1.5.2
  • Loading branch information
JohnDonovanGA committed Jan 6, 2023
2 parents 0b9e613 + c9856f5 commit 329fb3b
Show file tree
Hide file tree
Showing 23 changed files with 147 additions and 67 deletions.
15 changes: 14 additions & 1 deletion CHANGELOG.md
Expand Up @@ -3,6 +3,19 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

# [1.5.2] 2022-12-28
### Added
### Changed
No longer need conda environment to run python scripts
Antenna PCO values now constellation specific

### Fixed
POD does not output clocks in the predicted part of the generated SP3 file

### Deprecated
### Removed
### Security

# [1.5.1] 2022-08-22
### Added
Beidou block ids and SRPs (type 2 and type 3)
Expand All @@ -23,7 +36,7 @@ Reading of pod sinex metadata file

# [1.5] 2022-07-26
### Added
Read/write RINEX4 compatibly
Read/write RINEX4 compatability

New pod mode: pod_data_int which uses pod_data section for integrating given IC. New example ex00_pod_test_g01.yaml

Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -8,7 +8,7 @@
: This script will install all dependencies, clone the Ginan repo into the current directory and build the Ginan toolkit.


#### `Ginan v1.5.1 release`
#### `Ginan v1.5.2 release`

## Overview

Expand Down Expand Up @@ -56,7 +56,7 @@ Ginan is supported on the following platforms

You can quickly download a ready-to-run Ginan environment using docker by running:

docker run -it -v /data:/data gnssanalysis/ginan:v1.5.1 bash
docker run -it -v /data:/data gnssanalysis/ginan:v1.5.2 bash

This command connects the `/data` directory on the host (your pc), with the `/data` directory in the container, to allow file access between the two systems, and opens a command line (`bash`) for executing commands.

Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile
Expand Up @@ -13,5 +13,5 @@ RUN mkdir -p src/build \
&& rm -rf src/build

ENV PATH "/ginan/bin:${PATH}"
RUN cd /ginan/scripts && conda run -n gn37 pip install .
COPY ./docker/.bashrc /root/.bashrc
RUN cd /ginan/scripts && pip install .
#COPY ./docker/.bashrc /root/.bashrc
4 changes: 0 additions & 4 deletions docker/run-tests-long.sh
Expand Up @@ -5,10 +5,6 @@ set -euo pipefail
#required env var $GINAN to be set to the checkout root
export PATH="$PATH:$GINAN/bin"

# activate conda environment
eval "$(/root/.miniconda3/bin/conda shell.bash hook)"
conda activate gn37

S3_PREFIX=s3://peanpod/pea/long-tests/ex31/$(date --iso-8601=seconds)/

# ginan source tree is at /ginan
Expand Down
4 changes: 0 additions & 4 deletions docker/run-tests-pea.sh
Expand Up @@ -2,10 +2,6 @@

set -euo pipefail

# activate conda environment
eval "$(/root/.miniconda3/bin/conda shell.bash hook)"
conda activate gn37

# download example tests
source /ginan/docker/tags # PEA's tag as $PEA
source /ginan/docker/run-aux.sh
Expand Down
4 changes: 0 additions & 4 deletions docker/run-tests-pod.sh
Expand Up @@ -2,10 +2,6 @@

set -euo pipefail

# activate conda environment
eval "$(/root/.miniconda3/bin/conda shell.bash hook)"
conda activate gn37

# download example tests
source /ginan/docker/tags
source /ginan/docker/run-aux.sh
Expand Down
2 changes: 1 addition & 1 deletion docker/tags
@@ -1,2 +1,2 @@
PEA="0b3c6e8"
PEA="73bbcff"
POD="0c8627b"
22 changes: 22 additions & 0 deletions scripts/requirements.txt
@@ -0,0 +1,22 @@
awscli==1.27.34
sklearn==0.0
dash==2.7.1
plotly==5.3.1
tqdm==4.64.0 #useful for long processing sessions
git+https://github.com/bmatv/python-unlzw.git # memory leak patched
plotext==4.2
requests_oauthlib==1.3.1
werkzeug==2.2.2
requests==2.27.1
numpy==1.21.6 # don't care of specific numpy and pandas versions
pandas==1.1.0 #MongoDash required version
matplotlib==3.5.2
ruamel.yaml==0.17.21
boto3
# ipython==7.5.0
# notebook>=5.3
# ipywidgets>=7.2
pymongo==3.7.2
pytest==7.1.2
scipy==1.7.3
statsmodels==0.13.2
4 changes: 2 additions & 2 deletions src/cpp/brdc2sp3/brdc2sp3_main.cpp
Expand Up @@ -100,8 +100,8 @@ int BS_satantoff( GTime time, SatSys Sat, Vector3d& rs, Vector3d& dant, int gloi
for (int i = 0; i < 3; i++)
{
/* ENU to NEU */
Vector3d pcoJ = antPco(Sat.id(), j, time);
Vector3d pcoK = antPco(Sat.id(), k, time);
Vector3d pcoJ = antPco(Sat.id(), Sat.sys, j, time);
Vector3d pcoK = antPco(Sat.id(), Sat.sys, k, time);
double dant1 = pcoJ[1] * ex(i)
+ pcoJ[0] * ey(i)
+ pcoJ[2] * ez(i); //todo aaron, matrix
Expand Down
60 changes: 45 additions & 15 deletions src/cpp/common/antenna.cpp
Expand Up @@ -37,6 +37,7 @@ int decodef(char *p, int n, double *v)

bool findAntenna(
string code,
E_Sys sys,
GTime time,
Navigation& nav,
E_FType ft,
Expand All @@ -45,13 +46,21 @@ bool findAntenna(
// BOOST_LOG_TRIVIAL(debug)
// << "Searching for " << type << ", " << code;

auto it1 = nav.pcvMap.find(code);
if (it1 == nav.pcvMap.end())
auto it0 = nav.pcvMap.find(code);
if (it0 == nav.pcvMap.end())
{
return false;
}

auto& [dummyCode, pcvFreqMap] = *it1;
auto& [dummyCode, pcvSysFreqMap] = *it0;

auto it1 = pcvSysFreqMap.find(sys);
if (it1 == pcvSysFreqMap.end())
{
return false;
}

auto& [dummySys, pcvFreqMap] = *it1;

auto it2 = pcvFreqMap.find(ft);
if (it2 == pcvFreqMap.end())
Expand Down Expand Up @@ -92,14 +101,15 @@ double interp(double x1, double x2, double y1, double y2, double x)

Vector3d makeAntPco(
string id,
E_Sys sys,
E_FType ft,
GTime time)
{
if (ft == F1) return Vector3d::Zero();
if (ft == F2) return Vector3d::Zero();

Vector3d pco1 = antPco(id, F1, time);
Vector3d pco2 = antPco(id, F2, time);
Vector3d pco1 = antPco(id, sys, F1, time);
Vector3d pco2 = antPco(id, sys, F2, time);

if (pco1.isZero()) return Vector3d::Zero();
if (pco2.isZero()) return Vector3d::Zero();
Expand All @@ -123,12 +133,21 @@ Vector3d makeAntPco(
*/
Vector3d antPco(
string id,
E_Sys sys,
E_FType ft,
GTime time,
bool interp)
{
auto it1 = nav.pcoMap.find(id);
if (it1 == nav.pcoMap.end())
auto it0 = nav.pcoMap.find(id);
if (it0 == nav.pcoMap.end())
{
return Vector3d::Zero();
}

auto& [dummy0, pcoSysFreqMap] = *it0;

auto it1 = pcoSysFreqMap.find(sys);
if (it1 == pcoSysFreqMap.end())
{
return Vector3d::Zero();
}
Expand All @@ -138,7 +157,7 @@ Vector3d antPco(
auto it2 = pcoFreqMap.find(ft);
if (it2 == pcoFreqMap.end())
{
if (interp) return makeAntPco(id, ft, time);
if (interp) return makeAntPco(id, sys, ft, time);
else return Vector3d::Zero();
}

Expand All @@ -159,13 +178,22 @@ Vector3d antPco(
*/
double antPcv(
string id, ///< antenna id
E_Sys sys,
E_FType ft, ///< frequency
GTime time, ///< time
double aCos, ///< angle between target and antenna axis (radians)
double azi) ///< azimuth angle (radians)
{
auto it1 = nav.pcvMap.find(id);
if (it1 == nav.pcvMap.end())
auto it0 = nav.pcvMap.find(id);
if (it0 == nav.pcvMap.end())
{
return 0;
}

auto& [dummy0, pcvSysFreqMap] = *it0;

auto it1 = pcvSysFreqMap.find(sys);
if (it1 == pcvSysFreqMap.end())
{
return 0;
}
Expand Down Expand Up @@ -331,7 +359,8 @@ int readantexf(
string id;
GTime time;

E_FType ft = FTYPE_NONE;
E_FType ft = FTYPE_NONE;
E_Sys sys = E_Sys::NONE;

char buff[512];
while (fgets(buff, sizeof(buff), fp))
Expand Down Expand Up @@ -504,8 +533,9 @@ int readantexf(

string antexFCode;
antexFCode.assign(&buff[3], 3);

ft = antexCodes[antexFCode];

sys = SatSys::sysFromChar(antexFCode[0]);
ft = antexCodes[antexFCode];

freqPcv = recPcv;

Expand All @@ -516,8 +546,8 @@ int readantexf(
{
noazi_flag = 0;

nav.pcvMap[id][ft][time] = freqPcv;
nav.pcoMap[id][ft][time] = pco;
nav.pcvMap[id][sys][ft][time] = freqPcv;
nav.pcoMap[id][sys][ft][time] = pco;

continue;
}
Expand Down
3 changes: 3 additions & 0 deletions src/cpp/common/antenna.hpp
Expand Up @@ -68,12 +68,14 @@ Vector3d satAntOff(

Vector3d antPco(
string id,
E_Sys sys,
E_FType ft,
GTime time,
bool interp = false);

double antPcv(
string id,
E_Sys sys,
E_FType ft,
GTime time,
double aCos,
Expand All @@ -83,6 +85,7 @@ double antPcv(

bool findAntenna(
string code,
E_Sys sys,
GTime time,
Navigation& nav,
E_FType ft,
Expand Down
4 changes: 2 additions & 2 deletions src/cpp/common/navigation.hpp
Expand Up @@ -83,8 +83,8 @@ struct Navigation
{
///< navigation data type

map<string, map<E_FType, map<GTime, Vector3d, std::greater<GTime>>>> pcoMap;
map<string, map<E_FType, map<GTime, PhaseCenterData, std::greater<GTime>>>> pcvMap;
map<string, map<E_Sys, map<E_FType, map<GTime, Vector3d, std::greater<GTime>>>>> pcoMap;
map<string, map<E_Sys, map<E_FType, map<GTime, PhaseCenterData, std::greater<GTime>>>>> pcvMap;

map<int, map<GTime, Eph, std::greater<GTime>>> ephMap; /* GPS/QZS/GAL/BDS ephemeris */
map<int, map<GTime, Geph, std::greater<GTime>>> gephMap; /* GLONASS ephemeris */
Expand Down
6 changes: 3 additions & 3 deletions src/cpp/common/preceph.cpp
Expand Up @@ -654,8 +654,8 @@ void satAntOff(
double C2 = -1 / (gamma - 1);

/* iono-free LC */
Vector3d pcoJ = antPco(Sat.id(), j, time);
Vector3d pcoK = antPco(Sat.id(), k, time);
Vector3d pcoJ = antPco(Sat.id(), Sat.sys, j, time);
Vector3d pcoK = antPco(Sat.id(), Sat.sys, k, time);

for (int i = 0; i < 3; i++)
{
Expand Down Expand Up @@ -703,7 +703,7 @@ Vector3d satAntOff(
}

/* iono-free LC */
Vector3d pco = antPco(Sat.id(), ft, time);
Vector3d pco = antPco(Sat.id(), Sat.sys, ft, time);

Vector3d dAnt;

Expand Down
31 changes: 22 additions & 9 deletions src/cpp/common/satSys.hpp
Expand Up @@ -187,6 +187,23 @@ struct SatSys
operator string() const
{
return id();
}

static E_Sys sysFromChar(
char sysChar)
{
switch (sysChar)
{
case 'G': return E_Sys::GPS;
case 'R': return E_Sys::GLO;
case 'E': return E_Sys::GAL;
case 'J': return E_Sys::QZS;
case 'C': return E_Sys::BDS;
case 'L': return E_Sys::LEO;
case 'I': return E_Sys::IRN;
case 'S': return E_Sys::SBS;
default: return E_Sys::NONE;
}
}

/** Constructs a SatSys object from a c_string id
Expand All @@ -208,17 +225,13 @@ struct SatSys
int found = sscanf(id,"%c%d",&code,&prn_);
if (found > 0)
{
sys = sysFromChar(code);

switch (code)
{
case 'G': sys = E_Sys::GPS; break;
case 'R': sys = E_Sys::GLO; break;
case 'E': sys = E_Sys::GAL; break;
case 'J': sys = E_Sys::QZS; break;
case 'C': sys = E_Sys::BDS; break;
case 'L': sys = E_Sys::LEO; break;
case 'I': sys = E_Sys::IRN; break;
case 'S': sys = E_Sys::SBS; prn+=100; break;
default: sys = E_Sys::NONE; return; //todo aaron, if this returns none, bad things happen?
// case 'J': sys = E_Sys::QZS; prn_ += PRN_OFFSET_QZS; break; //todo Eugene: check if affects other code
// case 'S': sys = E_Sys::SBS; prn_ += PRN_OFFSET_SBS; break;
default: break;
}
}
if (found > 1)
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/common/tropSinex.cpp
Expand Up @@ -246,7 +246,7 @@ void setTropSiteAntCalibModelsFromNav()
{
ant.calibModel = defaultStr;
PhaseCenterData* pcd_ptr;
bool pass = findAntenna(ant.anttype, time, nav, F1, &pcd_ptr);
bool pass = findAntenna(ant.anttype, E_Sys::GPS, time, nav, F1, &pcd_ptr);
if (pass)
ant.calibModel = pcd_ptr->calibModel;
}
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/pea/main.cpp
Expand Up @@ -1258,7 +1258,7 @@ void mainOncePerEpoch(
Sat.fromHash(satId);

PhaseCenterData* pcvsat_ptr = nullptr;
findAntenna(Sat.id(), time, nav, F1, &pcvsat_ptr);
findAntenna(Sat.id(), Sat.sys, time, nav, F1, &pcvsat_ptr);
if (pcvsat_ptr)
{
Sat.setSvn(pcvsat_ptr->svn);
Expand Down

0 comments on commit 329fb3b

Please sign in to comment.