rinex.h File Reference


Detailed Description

GNSS core 'c' function library: RINEX VERSION 2.11 related functions.

Author:
Glenn D. MacGougan (GDM)
Date:
2007-12-02
Since:
2007-12-02
REFERENCES

"LICENSE INFORMATION"
Copyright (c) 2007, refer to 'author' doxygen tags
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file rinex.h.

#include "basictypes.h"
#include "gnss_types.h"
#include "gps.h"

Go to the source code of this file.

Data Structures

struct  RINEX_structRawHeader
 NOT USED - A container for RINEX observation file header data. Each parameter is the string (multiline is some cases) of columns 1-60 that corresponds to a record descriptor from columns 61-80. More...
struct  RINEX_TIME
 RINEX VERSION 2.11: A container for a RINEX time. More...
struct  RINEX_structDecodedHeader
 RINEX VERSION 2.11: A container required information from a decode RINEX header. More...

Enumerations

enum  RINEX_enumFileType {
  RINEX_FILE_TYPE_OBS = 'O',
  RINEX_FILE_TYPE_GPS_NAV = 'N',
  RINEX_FILE_TYPE_MET = 'M',
  RINEX_FILE_TYPE_GLO_NAV = 'G',
  RINEX_FILE_TYPE_GEO_NAV = 'H',
  RINEX_FILE_TYPE_GAL_NAV = 'L',
  RINEX_FILE_TYPE_MIXED_NAV = 'P',
  RINEX_FILE_TYPE_SBAS = 'B',
  RINEX_FILE_TYPE_CLK = 'C',
  RINEX_FILE_TYPE_SUMMARY = 'S'
}
 RINEX VERSION 2.11: An enumeration for RINEX file types. More...
enum  RINEX_enumSatelliteSystemType {
  RINEX_SATELLITE_SYSTEM_GPS = 'G',
  RINEX_SATELLITE_SYSTEM_GLO = 'R',
  RINEX_SATELLITE_SYSTEM_GEO = 'S',
  RINEX_SATELLITE_SYSTEM_GAL = 'E',
  RINEX_SATELLITE_SYSTEM_NSS = 'T',
  RINEX_SATELLITE_SYSTEM_MIXED = 'M'
}
 RINEX VERSION 2.11: An enumeration for the letter denoting the GPS satellite system. Used when determining which satellite observations are present. More...
enum  RINEX_enumObservationType {
  RINEX_OBS_TYPE_L1,
  RINEX_OBS_TYPE_L2,
  RINEX_OBS_TYPE_L5,
  RINEX_OBS_TYPE_L6,
  RINEX_OBS_TYPE_L7,
  RINEX_OBS_TYPE_L8,
  RINEX_OBS_TYPE_C1,
  RINEX_OBS_TYPE_C2,
  RINEX_OBS_TYPE_C5,
  RINEX_OBS_TYPE_C6,
  RINEX_OBS_TYPE_C7,
  RINEX_OBS_TYPE_C8,
  RINEX_OBS_TYPE_P1,
  RINEX_OBS_TYPE_P2,
  RINEX_OBS_TYPE_P5,
  RINEX_OBS_TYPE_P6,
  RINEX_OBS_TYPE_P7,
  RINEX_OBS_TYPE_P8,
  RINEX_OBS_TYPE_D1,
  RINEX_OBS_TYPE_D2,
  RINEX_OBS_TYPE_D5,
  RINEX_OBS_TYPE_D6,
  RINEX_OBS_TYPE_D7,
  RINEX_OBS_TYPE_D8,
  RINEX_OBS_TYPE_T1,
  RINEX_OBS_TYPE_T2,
  RINEX_OBS_TYPE_S1,
  RINEX_OBS_TYPE_S2,
  RINEX_OBS_TYPE_S5,
  RINEX_OBS_TYPE_S6,
  RINEX_OBS_TYPE_S7,
  RINEX_OBS_TYPE_S8
}
 RINEX VERSION 2.11: An enumeration for the various types of obsevations allowed. More...
enum  RINEX_enumWavelenthFactorL1_L2
 RINEX VERSION 2.11: An enumeration for wavelength factors. More...
enum  RINEX_enumTimeSystem {
  RINEX_TIME_SYSTEM_GPS = 0,
  RINEX_TIME_SYSTEM_GLO = 1,
  RINEX_TIME_SYSTEM_GAL = 1
}
 RINEX VERSION 2.11: An enumeration for the GNSS time system. More...
enum  RINEX_enumEpochFlag {
  RINEX_EPOCH_FLAG_OK = 0,
  RINEX_EPOCH_FLAG_PWR_FAIL = 1,
  RINEX_EPOCH_FLAG_MOVING_ANT = 2,
  RINEX_EPOCH_FLAG_NEW_SITE = 3,
  RINEX_EPOCH_FLAG_HEADER_FOLLOWS = 4,
  RINEX_EPOCH_FLAG_EXTERNAL_EVENT = 5,
  RINEX_EPOCH_FLAG_CYCLE_SLIP = 6
}
 RINEX VERSION 2.11: An enumeration for the epoch flag. More...

Functions

BOOL RINEX_GetHeader (const char *filepath, char *buffer, const unsigned buffer_max_size, unsigned *buffer_size, double *version, RINEX_enumFileType *file_type)
 RINEX VERSION 2.11: Get the RINEX header, as a buffer, from the specified file path. Determine the RINEX version and file type.
BOOL RINEX_DecodeHeader_ObservationFile (const char *header_buffer, const unsigned header_buffer_size, RINEX_structDecodedHeader *header)
 RINEX VERSION 2.11: Decode the parts of the RINEX Observation file header that are essential to.
BOOL RINEX_GetNextObservationSet (FILE *fid, RINEX_structDecodedHeader *RINEX_header, BOOL *wasEndOfFileReached, BOOL *wasObservationFound, unsigned *filePosition, GNSS_structMeasurement *obsArray, const unsigned char maxNrObs, unsigned *nrObs, unsigned short *rx_gps_week, double *rx_gps_tow)
 RINEX VERSION 2.11: Decode the next set of observations from the RINEX Observation file. Deal with any header information changes that arise from special records.
BOOL RINEX_DecodeGPSNavigationFile (const char *filepath, GNSS_structKlobuchar *iono_model, GPS_structEphemeris *ephemeris_array, const unsigned int max_length_ephemeris_array, unsigned int *length_ephemeris_array)
 RINEX VERSION 2.11: Completely decode a RINEX GPS Navigation file into an array of GPS ephemeris structs.
BOOL RINEX_DecodeFileName (const char *filepath, char *station_name, unsigned short *dayofyear, unsigned char *file_sequence_nr, unsigned short *year, RINEX_enumFileType *filetype)
 RINEX VERSION 2.11: Decode a RINEX file name.
BOOL RINEX_GetKlobucharIonoParametersFromNavFile (const char *filepath, GNSS_structKlobuchar *iono_model)
 RINEX VERSION 2.11: Decode the ionospheric parameters from a RINEX GPS Navigation file.


Enumeration Type Documentation

enum RINEX_enumEpochFlag

RINEX VERSION 2.11: An enumeration for the epoch flag.

Enumerator:
RINEX_EPOCH_FLAG_OK  OK.
RINEX_EPOCH_FLAG_PWR_FAIL  power failure between previous and current epoch.
RINEX_EPOCH_FLAG_MOVING_ANT  start moving antenna.
RINEX_EPOCH_FLAG_NEW_SITE  new site occupation (end of kinem. data) (at least MARKER NAME record follows)
RINEX_EPOCH_FLAG_HEADER_FOLLOWS  header information follows
RINEX_EPOCH_FLAG_EXTERNAL_EVENT  external event (epoch is significant, same time frame as observation time tags).
RINEX_EPOCH_FLAG_CYCLE_SLIP  cycle slip records follow to optionally report detected and repaired cycle slips (same format as OBSERVATIONS records; slip instead of observation; LLI and signal strength blank or zero)

Definition at line 199 of file rinex.h.

enum RINEX_enumFileType

RINEX VERSION 2.11: An enumeration for RINEX file types.

Enumerator:
RINEX_FILE_TYPE_OBS  'O' - Observation file.
RINEX_FILE_TYPE_GPS_NAV  'N' - GPS navigation file.
RINEX_FILE_TYPE_MET  'M' - Meteorological data file.
RINEX_FILE_TYPE_GLO_NAV  'G' - GLONASS navigation file.
RINEX_FILE_TYPE_GEO_NAV  'H' - Geostationary Navigation nile.
RINEX_FILE_TYPE_GAL_NAV  'L' - Galileo navigation message file.
RINEX_FILE_TYPE_MIXED_NAV  'P' - Mixed GNSS navigation message file.
RINEX_FILE_TYPE_SBAS  'B' - SBAS broadcast data file (separate documentation).
RINEX_FILE_TYPE_CLK  'C' - Clock file (separate documentation).
RINEX_FILE_TYPE_SUMMARY  'S' - Summary file (used e.g., by IGS, not a standard!).

Definition at line 94 of file rinex.h.

enum RINEX_enumObservationType

RINEX VERSION 2.11: An enumeration for the various types of obsevations allowed.

Enumerator:
RINEX_OBS_TYPE_L1  Phase on L1 [cycles].
RINEX_OBS_TYPE_L2  Phase on L2 [cycles].
RINEX_OBS_TYPE_L5  Phase on L5 [cycles].
RINEX_OBS_TYPE_L6  Phase on L6 [cycles].
RINEX_OBS_TYPE_L7  Phase on L7 [cycles].
RINEX_OBS_TYPE_L8  Phase on L8 [cycles].
RINEX_OBS_TYPE_C1  Pseudorange using Civil code on L1 [m].
RINEX_OBS_TYPE_C2  Pseudorange using Civil code on L2 [m].
RINEX_OBS_TYPE_C5  Pseudorange using Civil code on L5 [m].
RINEX_OBS_TYPE_C6  Pseudorange using Civil code on L6 [m].
RINEX_OBS_TYPE_C7  Pseudorange using Civil code on L7 [m].
RINEX_OBS_TYPE_C8  Pseudorange using Civil code on L8 [m].
RINEX_OBS_TYPE_P1  Pseudorange using P-Code on L1 [m].
RINEX_OBS_TYPE_P2  Pseudorange using P-Code on L2 [m].
RINEX_OBS_TYPE_P5  Pseudorange using P-Code on L5 [m].
RINEX_OBS_TYPE_P6  Pseudorange using P-Code on L6 [m].
RINEX_OBS_TYPE_P7  Pseudorange using P-Code on L7 [m].
RINEX_OBS_TYPE_P8  Pseudorange using P-Code on L8 [m].
RINEX_OBS_TYPE_D1  Doppler frequency on L1 [Hz].
RINEX_OBS_TYPE_D2  Doppler frequency on L2 [Hz].
RINEX_OBS_TYPE_D5  Doppler frequency on L5 [Hz].
RINEX_OBS_TYPE_D6  Doppler frequency on L6 [Hz].
RINEX_OBS_TYPE_D7  Doppler frequency on L7 [Hz].
RINEX_OBS_TYPE_D8  Doppler frequency on L8 [Hz].
RINEX_OBS_TYPE_T1  Transit Integrated Doppler on 150 (T1) [cycles].
RINEX_OBS_TYPE_T2  Transit Integrated Doppler on 400 MHz (T2) [cycles].
RINEX_OBS_TYPE_S1  Raw signal strengths or SNR values as given by the receiver for the L1 phase observations [receiver-dependent].
RINEX_OBS_TYPE_S2  Raw signal strengths or SNR values as given by the receiver for the L2 phase observations [receiver-dependent].
RINEX_OBS_TYPE_S5  Raw signal strengths or SNR values as given by the receiver for the L1 phase observations [receiver-dependent].
RINEX_OBS_TYPE_S6  Raw signal strengths or SNR values as given by the receiver for the L2 phase observations [receiver-dependent].
RINEX_OBS_TYPE_S7  Raw signal strengths or SNR values as given by the receiver for the L1 phase observations [receiver-dependent].
RINEX_OBS_TYPE_S8  Raw signal strengths or SNR values as given by the receiver for the L2 phase observations [receiver-dependent].

Definition at line 124 of file rinex.h.

enum RINEX_enumSatelliteSystemType

RINEX VERSION 2.11: An enumeration for the letter denoting the GPS satellite system. Used when determining which satellite observations are present.

Enumerator:
RINEX_SATELLITE_SYSTEM_GPS  'G' GPS satellite.
RINEX_SATELLITE_SYSTEM_GLO  'R' GLONASS satellite.
RINEX_SATELLITE_SYSTEM_GEO  'S' Geostationary satellite (SBAS).
RINEX_SATELLITE_SYSTEM_GAL  'E' Galileo satellite
RINEX_SATELLITE_SYSTEM_NSS  'T' NNSS Transit.
RINEX_SATELLITE_SYSTEM_MIXED  'M' Mixed.

Definition at line 111 of file rinex.h.

enum RINEX_enumTimeSystem

RINEX VERSION 2.11: An enumeration for the GNSS time system.

Enumerator:
RINEX_TIME_SYSTEM_GPS  GPS time system.
RINEX_TIME_SYSTEM_GLO  GLONASS time system.
RINEX_TIME_SYSTEM_GAL  GALILEO time system.

Definition at line 174 of file rinex.h.

enum RINEX_enumWavelenthFactorL1_L2

RINEX VERSION 2.11: An enumeration for wavelength factors.

Definition at line 164 of file rinex.h.


Function Documentation

BOOL RINEX_DecodeFileName ( const char *  filepath,
char *  station_name,
unsigned short *  dayofyear,
unsigned char *  file_sequence_nr,
unsigned short *  year,
RINEX_enumFileType filetype 
)

RINEX VERSION 2.11: Decode a RINEX file name.

Author:
Glenn D. MacGougan
Date:
2007-12-06
Since:
2007-12-06
char *filepath = "c:\\data\\CGIM3280.07N";
char station_name[5];
unsigned short dayofyear = 0;
unsigned char file_sequence_nr = 0;
unsigned short year = 0;
RINEX_enumFileType filetype = RINEX_FILE_TYPE_UNKNOWN;
BOOL result = FALSE;

result = RINEX_DecodeFileName( filepath, station_name, &dayofyear, &file_sequence_nr, &year, &filetype );
// The results are
// station_name == CGIM
// dayofyear == 328
// file_sequence_nr == 0
// year == 2007
// filetype == RINEX_FILE_TYPE_OBS

Returns:
TRUE(1) if successful, FALSE(0) otherwise.
Parameters:
filepath  (input) A full filepath.
station_name  (output) A 5 character C string. char station_name[5]. In which to place the 4-character station name designator. This must be at least 5 characters.
dayofyear  (output) The day of year.
file_sequence_nr  (output) file sequence number within day. 0: file contains all the existing data of the current day.
year  (output) The full year. e.g. 1999, 2001.
filetype  (output) The RINEX file type.

Definition at line 3050 of file rinex.c.

BOOL RINEX_DecodeGPSNavigationFile ( const char *  filepath,
GNSS_structKlobuchar iono_model,
GPS_structEphemeris ephemeris_array,
const unsigned int  max_length_ephemeris_array,
unsigned int *  length_ephemeris_array 
)

RINEX VERSION 2.11: Completely decode a RINEX GPS Navigation file into an array of GPS ephemeris structs.

Author:
Glenn D. MacGougan
Date:
2007-12-06
Since:
2007-12-06
Returns:
TRUE(1) if successful, FALSE(0) otherwise.
Parameters:
filepath  (input) The file path to the GPS Navigation message file.
iono_model  (input/output) A pointer to the ionospheric parameters struct.
ephemeris_array  (input/output) A pointer to the GPS ephemeris array.
max_length_ephemeris_array  (input) The maximum size of the GPS ephemeris array.
length_ephemeris_array  (input/output) The length of the GPS ephemeris array after decoding. The number of valid items.

Definition at line 2348 of file rinex.c.

BOOL RINEX_DecodeHeader_ObservationFile ( const char *  header_buffer,
const unsigned  header_buffer_size,
RINEX_structDecodedHeader header 
)

RINEX VERSION 2.11: Decode the parts of the RINEX Observation file header that are essential to.

Author:
Glenn D. MacGougan
Date:
2007-12-03
Since:
2007-12-03
Returns:
TRUE(1) if successful, FALSE(0) otherwise.
Parameters:
header_buffer  (input) The character buffer containing the RINEX header.
header_buffer_size  (input) The size of the character buffer containing the RINEX header [bytes]. Not the maximum size, the size of the valid data in the buffer.
header  (output) The decoded header data.

Definition at line 1189 of file rinex.c.

BOOL RINEX_GetHeader ( const char *  filepath,
char *  buffer,
const unsigned  buffer_max_size,
unsigned *  buffer_size,
double *  version,
RINEX_enumFileType file_type 
)

RINEX VERSION 2.11: Get the RINEX header, as a buffer, from the specified file path. Determine the RINEX version and file type.

Author:
Glenn D. MacGougan
Date:
2007-12-03
Since:
2007-12-03
remarks

Returns:
TRUE(1) if successful, FALSE(0) otherwise.
Parameters:
filepath  Path to the RINEX file.
buffer  (input/output) A character buffer in which to place the RINEX header.
buffer_max_size  (input) The maximum size of the buffer [bytes]. This value should be large enough to hold the entire header, (8192 to 16384).
buffer_size  (output) The length of the header data placed in the buffer [bytes].
version  (output) The RINEX version number. e.g. 1.0, 2.0, 2.2, 3.0, etc.
file_type  (output) The RINEX file type.

Definition at line 1118 of file rinex.c.

BOOL RINEX_GetKlobucharIonoParametersFromNavFile ( const char *  filepath,
GNSS_structKlobuchar iono_model 
)

RINEX VERSION 2.11: Decode the ionospheric parameters from a RINEX GPS Navigation file.

Author:
Glenn D. MacGougan
Date:
2007-12-07
Since:
2007-12-07
char *filepath = "c:\\data\\brdc3400.07n";
GNSS_structKlobuchar iono;
BOOL result;

result = RINEX_GetKlobucharIonoParametersFromNavFile( filepath, &iono );

Returns:
TRUE(1) if successful, FALSE(0) otherwise.
Parameters:
filepath  (input) The file path to the GPS Navigation message file.
iono_model  (input/output) A pointer to the ionospheric parameters struct.

Definition at line 3158 of file rinex.c.

BOOL RINEX_GetNextObservationSet ( FILE *  fid,
RINEX_structDecodedHeader RINEX_header,
BOOL *  wasEndOfFileReached,
BOOL *  wasObservationFound,
unsigned *  filePosition,
GNSS_structMeasurement obsArray,
const unsigned char  maxNrObs,
unsigned *  nrObs,
unsigned short *  rx_gps_week,
double *  rx_gps_tow 
)

RINEX VERSION 2.11: Decode the next set of observations from the RINEX Observation file. Deal with any header information changes that arise from special records.

Author:
Glenn D. MacGougan
Date:
2007-12-06
Since:
2007-12-03
Returns:
TRUE(1) if successful, FALSE(0) otherwise.
Parameters:
fid  (input) An open (not NULL) file pointer to the RINEX data.
RINEX_header  (input/output) The decoded RINEX header information. The wavelength markers can change as data is decoded.
wasEndOfFileReached  Has the end of the file been reached (output).
wasObservationFound  Was a valid observation found (output).
filePosition  The file position for the start of the message found (output).
obsArray  A pointer to a user provided array of GNSS_structMeasurement (input/output).
maxNrObs  The maximum number of elements in the array provided (input).
nrObs  The number of valid elements set in the array (output).
rx_gps_week  The receiver GPS week (0-1024+) [weeks].
rx_gps_tow  The receiver GPS time of week (0-603799.99999) [s].

Definition at line 1392 of file rinex.c.