Quality Check (QC)
==================
RINEX quality check is a special mode, activated with `--qc`.
QC is first developed for Observation files analysis, but this tool
will accept other RINEX files, for which it will compute basic statistical analysis.
QC is a well known procedure in data preprocessing.
There are a few differences people who are very familiar with `teqc` must
take into account when using our command line interface.
## Similarities with `teqc`
We share similarities with `teqc` which will prove convenient
to advanced "teqc" users. Among them:
* Quick GNSS filters (`-G`, `-R`, ...) still exist
* In augmented mode, `-no_orbit X` is feasible if you know how to operate the [preprocessor](doc/preprocessing.md)
* Similar position analysis and reporting
* Similar signals analysis and reporting
## Differences with `teqc`
Unlike teqc we are not limited to RINEX V2, V3 and V4 Observations
are fully supported.
Unlike teqc we expect the user to provide the file context
himself. We do not have the ability to browse and search for Navigation context for examples.
Although we support as many Navigation files to be specified, when the _augmented_ mode is being activated.
This allows for example Glonass and other NAV context to be correctly defined.
1. `--fp [FILE]` for the Observation file
2. `--nav [FILE1] --nav [FILE2]..` : define NAV context
3. `--sp3 [FILE1] --sp3 [FILE2]..` : pass SP3 data
We will generate products the
[workspace](https://github.com/gwbres/rinex/tree/rinex-cli/workspace)
folder, that includes QC reports.
Unlike teqc, we do not support BINEX input data/files as of today.
Unlike teqc we do not limit ourselves to the analysis of
GPS and Glonass constellations.
Unlike teqc, we have no means to detect data duplicates, therefore
such information is not reported.
Unlike teqc, we do not limit ourselves to L1/L2 analysis.
This applies for instance to MP or DCB analyses.
Unlike teqc, this tool allows accurate time description, down to 1 ns precision.
For example, this would apply to
* the receiver clock drift analysis not being limited to 1ms/hour
* precise control of averaging windows, etc..
## QC specific command line options
* `--qc-only`: ensures the tool will only perform the QCs,
other graphs or record analysis is turned off.
This command line option makes the quality checks and reporting faster.
* `--qc-cfg`: QC analysis and reporting fine tuning (see down below).
## Basic QC (No NAV)
When `--qc` is activated and `--fp` is an observation file
basically we can only study the provided signals and observations.
Preprocessing still apply, therefore all analysis are to be performed
on the data that is still left out:
```bash
rinex-cli \
--qc-only \
--fp test_resources/CRNX/V3/KMS300DNK_R_20221591000_01H_30S_MO.crx
```
With `--qc-only`, the Data QC is activated and the total report is only made of the QC analysis.
Run this configuration for the most basic QC:
```bash
rinex-cli \
-P GPS,GLO \
--qc-only \
--qc-cfg rinex-cli/config/gnss_snr30db.json \
--fp test_resources/CRNX/V3/ESBC00DNK_R_20201770000_01D_30S_MO.crx.gz
```
If you activate QC without any configuration, the default configuration is used.
## QC Configuration file
The QC configuration file allows precise control of how analysis are performed.
We provide example configurations in `rinex-cli/config`.
All parameters are optional, in a configuration file description. That means,
the default value is used if one parameter is omitted. For example, the classification
method is "mandatory" to a QC analysis. If not defined, the GNSS classification method is used.
### QC Classification method
- "GNSS": the provided context is splitted into all constellations that remain
after pre processing. You can one sub report per constellation.
It is most convenient when one or two constellations are left out, for example with `-P GLO,GPS`.
The report is designed in alphabetical order.
- "Sv" : split by Satellite vehicle. It is most convenient when a few vehicles are isolated,
for example either by retaining a single constellation : `-P GPS`, or by retaining
specific vehicles: `-P G08,G15,C19,C31,R08`.
- "Physics": split by Observable.
### Sv classification case
The Sv classification case is interesting, because the Sampling/Gap anlalysis emphasizes
when isolated vehicles go out of sight.
For example, compare the report generated by this "default" run :
```bash
./target/release/rinex-cli \
--fp test_resources/CRNX/V3/MOJN00DNK_R_20201770000_01D_30S_MO.crx.gz \
-P G08,G15,G16,R23,C19,C09 \
--qc
```
To this one :
```bash
./target/release/rinex-cli \
--fp test_resources/CRNX/V3/MOJN00DNK_R_20201770000_01D_30S_MO.crx.gz \
-P G08,G15,G16,R23,C19,C09 \
--qc --qc-cfg rinex-cli/config/sv_manual_gap.json
```
### SNR parametrization
TODO
### CS analysis
TODO
## QC with Navigation Data
Providing Navigation Data is the only way for complete QCs.
With such context, we can now use the "elevation mask" in the configuration file:
Compare these two runs. In the second one, Sv loss of sight is larger because
the go out of sight more rapidly, due to the stringent elevation criteria :
```bash
rinex-cli \
-P gps,glo \
-P G08,G15,G16,R23,C19,C09 \
--qc --qc-cfg rinex-cli/config/sv_manual_gap_ev35.json
--fp test_resources/CRNX/V3/ESBC00DNK_R_20201770000_01D_30S_MO.crx.gz \
--nav test_resources/OBS/V3/ESBC00DNK_R_20201770000_01D_MN.rnx.gz
```
## QC on other RINEX
TODO