Simplified GOX/Blackjack and TRIG data reader, version 1.24

Updates for version 1.24:

Added missing libraries (RSTools.pm and Dplib.pm) and fixed typos.  Thanks to Christian Marquardt for finding these errors.

Updates for version 1.23:

--Now reads TRIG data from the COSMIC-2 mission
--Fixed bug in C/NOFS reader:  Supplied missing parse_TIMEppst routine in BJParser.pm

-------------

Contributors:

-- Thanks to Leonid Butenko for finding a bug in the LEO satellite
   number indexing in Level1aTools::writeRinexHeader.
-- Josef Innerkofler: Debugging and GRACE reader enhancements

Includes a configuration file (SATELLIT.I14.bern) from the Bernese GNSS processing system.  The latest version
of this file is available at ftp://ftp.aiub.unibe.ch/BSWUSER52/GEN/SATELLIT.I14

-------------

This is a perl-based reader for COSMIC, CHAMP, GRACE, C/NOFS, COSMIC-2 GOX/TRIG data, as found in the
goxBin files (for COSMIC), grcLv0 files (for GRACE), chpLv0 (for CHAMP), cnfLv0 (for C/NOFS),
or trgLv0 (for COSMIC-2) available from CDAAC:

https://cdaac-www.cosmic.ucar.edu/cdaac/tar/rest.html

for COSMIC, GRACE, CHAMP, and C/NOFS (look for the champ2016 mission to get CHAMP data).

Please find COSMIC-2 (coseqrt) data here:

https://data.cosmic.ucar.edu/gnss-ro/cosmic2/nrt/



This software converts goxBin/grcLv0/chpLv0/cnfLv0/trgLv0 files to standard CDAAC level1a data types:

podCrx -- Low rate Rinex GNSS data

opnGps -- High rate occultation and reference link data (custom binary format)
 -or-
opnGns -- A more general custom binary format designed to hold arbitrary high rate GNSS data
          in an efficient and easily searchable way

goxSOH -- ASCII State of Health data
scnRaw -- Scintillation data
opnScn -- COSMIC-2 high rate scintillation data in opnGns format

This software is also useful for documenting the level 0 file formats!

For details on the output level1a formats, see:

https://cdaac-www.cosmic.ucar.edu/cdaac/doc/formats.html

----------------------------------------------------------------------------------------

This software is intended for Linux systems, but might be portable
to other UNIX-like systems such as Darwin.

These prerequisites must be installed:

1) perl version 5.10.0 or later

2) The Inline Module.  This is found at:
https://metacpan.org/pod/distribution/Inline/lib/Inline.pod
It can most easily be installed using the 'cpan' tool that comes with perl:
cpan install Inline

2) The PDL (perl data language) extension. See http://pdl.perl.org/ for how to install this.

3) The GNU Subroutine library and the PDL::GSL::INTERP package (for C/NOFS)

#---------------------------------------------------------------------------------------
# COSMIC
#---------------------------------------------------------------------------------------

Once the dependencies are installed, then change to the install directory:

cd cosmic_GOX_reader_1.21

and run:

rm *_txt *_bin *_rnx # clean up after last run
perl ./cosmicGoxZero2one.pl goxBin_2011.134.005.02.B_bj

After around one minute, this should generate several files:

goxSOH_2011.134.005.02_txt
opnGps_2011.134.005.02.01_bin
opnGps_2011.134.005.02.02_bin
opnGps_2011.134.005.02.03_bin
scnRaw_2011.134.005.02.01_txt
scnRaw_2011.134.005.02.02_txt
scnRaw_2011.134.005.02.03_txt
podCrx_2011.134.005.02.01_rnx
podCrx_2011.134.005.02.02_rnx
podCrx_2011.134.005.02.03_rnx


If these are identical to those found in cosmic_GOX_reader_1.00/comparison_results/cosmic
then things are working well for COSMIC.  You can test this with these commands:

for i in *_txt *_bin *_rnx; do cmp -i 200 $i comparison_results/cosmic/$i; done   # no output if correct
(The -i skips the first 200 bytes in the comparison to avoid the time stamp in the RINEX header)

#---------------------------------------------------------------------------------------
# GRACE
#---------------------------------------------------------------------------------------
Note:
The temporary switching of the RO experiment between GRACE-A(1) and GRACE-B(2) since
2014.208 lead to the following update in the filenameing convention at CDAAC effective
with 2014.090:
 - legacy: grcLv0_2014.089.00.53_bj (only GRACE-A)
 - current: grcLv0_2014.090.00.09.001_bj (GRACE-A)
            grcLv0_2014.208.07.58.002_bj (GRACE-B)

Now try:

rm *_txt *_bin *_rnx # clean up from COSMIC run
perl ./graceZero2one.pl grcLv0_2016.366.02.36.001_bj

This should generate several files:

goxSOH_2016.366.001.01_txt
opnGps_2016.366.001.01.03_bin
podCrx_2016.366.001.01.00_rnx
ionCrx_2016.366.001.01.00_rnx
ionCrx_2016.366.001.01.03_rnx

Compare these with correct results by:

for i in *_txt *_bin *_rnx; do cmp -i 200 $i comparison_results/grace/$i; done   # no output if correct

#---------------------------------------------------------------------------------------
# CHAMP
#---------------------------------------------------------------------------------------

rm *_txt *_bin *_rnx # clean up from CHAMP run
perl ./champZero2one.pl chpLv0_2008.001.04.58_bj

This should generate several files:

goxSOH_2008.001.001.01_txt
ionCrx_2008.001.001.01.00_rnx
podCrx_2008.001.001.01.03_rnx
opnGps_2008.001.001.01.00_bin
opnGps_2008.001.001.01.04_bin

Compare these with correct results by:

for i in *_txt *_bin *_rnx; do cmp -i 200 $i comparison_results/champ/$i; done   # no output if correct

#---------------------------------------------------------------------------------------
# C/NOFS
#---------------------------------------------------------------------------------------

rm *_txt *_bin *_rnx # clean up from C/NOFS run
perl ./cnofsZero2one.pl cnfLv0_2011.357.06.12.001.STA001_tlm

This should generate several files:

opnGps_2011.357.001.01.00_bin
podCrx_2011.357.001.01.00_rnx
ionCrx_2011.357.001.01.00_rnx
goxSOH_2011.357.001.01_txt

Compare these with correct results by:

for i in *_txt *_bin *_rnx; do cmp -i 200 $i comparison_results/cnofs/$i; done   # no output if correct

#---------------------------------------------------------------------------------------
# COSMIC-2
#---------------------------------------------------------------------------------------

rm *_bin *_txt *_rnx # clean up from COSMIC-2 run
perl ./trigZero2one.pl trgLv0_2020.200.00.08.001.HAWAII_tlm.gz

This should generate several files:
podCrx_2020.200.001.01.01_rnx
podCrx_2020.200.001.01.02_rnx
opnGns_2020.200.001.01.03_bin
opnGns_2020.200.001.01.04_bin
scnRaw_2020.200.001.01.01_txt
scnRaw_2020.200.001.01.02_txt
goxSOH_2020.200.001.01_txt
opnScn_2020.200.001.01.01_bin

Compare these with correct results by:

for i in *_txt *_bin *_rnx; do cmp -i 200 $i comparison_results/coseq/$i; done   # no output if correct

Good luck!

Doug Hunt
July 31, 2020
