gnssrefl.karnak_libraries module

gnssrefl.karnak_libraries.filename_plus(station9ch, year, doy, srate, stream)

function to create RINEX 3 filenames for one day files.

Parameters:
  • station9ch (str) – 9 character station name

  • year (int) – full year

  • doy (int) – day of year

  • srate (int) – receiver sample rate

  • stream (str) – R or S ; latter means the file was streamed.

  • output (str) – compliant filename with crx.gz on the end as this is how the files are stored at GNSS archives as far as I know.

Returns:

  • file_name (str) – filename of the RINEX 3 file

  • cyyyy (str) – 4ch year

  • cdoy (str) – 3ch day of year

gnssrefl.karnak_libraries.ga_stuff(station, year, doy, rinexv=3)

GA API requirements to download a Rinex 3 file

Parameters:
  • station (str) – 9 character station name

  • year (integer) – full year

  • doy (int) – day of year

  • rinexv (int) – rinex version

Returns:

  • QUERY_PARAMS (dict) – I think

  • headers (dict) – I think

gnssrefl.karnak_libraries.ga_stuff_highrate(station, year, doy, rinexv=3)

This should be merged with existing ga_stuff code

Parameters:
  • station (str) – 4 or 9 ch station name

  • year (int) – full year

  • doy (int) – day of year

  • rinexv (int) – rinex version

Returns:

  • QUERY_PARAMS (json) – i think

  • headers (json) – i think

gnssrefl.karnak_libraries.gogetit(dir1, filename, ext)

The purpose of this function is to to download RINEX 2 files. The code will try to get the file and check to see if it was successful.

Parameters:
  • dir1 (str) – the main https directory address

  • filename (str) – name of the GNSS files

  • ext (str) – kind of ending to the filename, (Z, gz etc)

Returns:

  • foundit (bool) – whether file was found

  • f (str) – name of the file

gnssrefl.karnak_libraries.gsi_data(station, year, doy)

get data from GSI, Japan

Parameters:
  • station (str) – 6 char station name

  • year (int) – full year

  • doy (int) – day of year

gnssrefl.karnak_libraries.just_bkg(cyyyy, cdoy, file_name)

looks for RINEX files at BKG in two directories

Parameters:
  • cyyyy (str) – four character year

  • cdoy (str) – three character day of year

  • file_name (str) – expected RINEX filename

gnssrefl.karnak_libraries.make_rinex2_ofiles(file_name)

take a rinex2 file, gunzip or uncompress it, and then Hatanaka decompress it

Parameters:

file_name (str) – rinex2 filename

Returns:

  • new_name (str) – filename after multiple decompression processes

  • fexist (bool) – whether file was successfully created

gnssrefl.karnak_libraries.rinex2_highrate(station, year, doy, archive, strip_snr)

kluge to download highrate data since i have revamped the rinex2 code strip_snr is boolean as to whether you want to strip out the non-SNR data it can be slow with highrate data. it requires gfzrnx

this no longer allows the all archive … which should have been stopped at rinex2snr_cl

Parameters:
  • station (str) – 4 character station ID. lowercase

  • year (int) – full year

  • doy (int) – day of year

  • archive (str) – name of GNSS archive

  • strip_snr (bool) – whether you want to strip out the observables (leaving only SNR)

gnssrefl.karnak_libraries.rinex2names(station, year, doy)

Creates the expected filename for rinex2 version files

Parameters:
  • station (str) – four character station name

  • year (int) – full year

  • doy (int) – day of year

  • Results

  • -------

  • f1 (str) – hatanaka rinex filename

  • f2 (str) – regular rinex filename

  • cyyyy (str) – four character year

  • cdoy (str) – three character day of year

gnssrefl.karnak_libraries.serial_cddis_files(dname, cyyyy, cdoy)

Looks for rinex files in the hatanaka decompression section of cddis

Parameters:
  • dname (str) – rinex2 filename without compression extension

  • cyyyy (str) – character string of full year

  • cdoy (str) – character string (3) of day of year

Returns:

  • foundit (bool) – whether file was found

  • f (str) – filename

gnssrefl.karnak_libraries.strip_rinexfile(rinexfile)

uses either teqc or gfzrnx to reduce observables, i.e. only SNR data.

Parameters:

rinexfile (str) – name of the rinex2 file

gnssrefl.karnak_libraries.swapRS(stream)

function that swaps R to S and vice versa for RINEX 3 files

Parameters:

stream (str) – RINEX 3 filename streaming acronym (S or R)

Returns:

newstream – the opposite of what was in stream

Return type:

str

gnssrefl.karnak_libraries.universal(station9ch, year, doy, archive, srate, stream, debug=False)

main code for seamless archive for RINEX 3 files …

Parameters:
  • station9ch (str) – nine character station name

  • year (int) – year

  • doy (int) – day of year

  • archive (str) – archive name

  • srate (int) – receiver samplerate

  • stream (str) – one character: R or S

  • debug (bool) – whether debugging statements printed

Returns:

  • file_name (str) – name of rinexfile (?? with gz or not? crx or rnx??)

  • foundit (boolean) – whether file was found

gnssrefl.karnak_libraries.universal_all(station9ch, year, doy, srate, stream, screenstats)

check multiple archives for RINEX 3 data

Parameters:
  • station9ch (str) – 9 character station name

  • year (int) – full year

  • doy (int) – doy of year

  • srate (int) – receiver sample rate

  • stream (str) – R or S

  • screenstats (bool) – print statements

  • Peturns

  • -------

  • file_name (str) – rinex filename

  • foundit (bool) – whether rinex file was found

gnssrefl.karnak_libraries.universal_rinex2(station, year, doy, archive, screenstats)

The long-awaited seamless archive for rinex 2 files …

Parameters:
  • station (str) – four character station name

  • year (int) – full year

  • doy (int) – day of year

  • archive (str) – name of the GNSS archive

  • screenstats (bool) – whether print statements come to scree

Returns:

  • file_name (str) – RINEX filename that was downloaded

  • foundit (bool) – whether file was found