Dennis Milbert

Updated:  2008-apr-13

RINEX files are interesting animals. The identity of columns varies from file to file. The satellites are in any order, and can change order from epoch to epoch. And, of course, data can start and stop at any time, and be logged at different rates at different sites. RINEX is easy to write, but it takes work to read.

The program, gmerge, takes two RINEX files, and merges them into a single file in a format that I like. Its ASCII in, and ASCII out. Also, a position file, pos, and an antenna file, ant, are read to set up the file header.



The program operates in the DOS window. Alternatively, you can simply run "gmerge.exe" with a double click or with "Run..." in your "Start" menu. (I use the DOS window myself.)

Four files are needed for input. One file is generated as output. The names are fixed. The files must be in the subdirectory where you are working.

Input Files:

point1.rnx -- ASCII, RINEX format. This point is treated as a base station by my some of my programs.

point2.rnx -- ASCII, RINEX format. This point is treated as a rover or unknown station by my some of my programs.

pos -- ASCII, special format, described below. This file holds reference coordinates for known stations. For example, one could put coordinates for local CORS stations in this file. If gmerge.exe doesn't find a 4 character ID in the pos file, it will use the coordinate in the RINEX header, instead. But, while gmerge.exe is not picky, it is mandatory to have a pos file.

ant -- ASCII, NGS format, described below. This file holds antenna phase center (ARP/L1/L2) relations and phase center variations with vertical angle. This file is an exact copy of ant_info.003, maintained by the National Geodetic Survey. If gmerge.exe doesn't find an antenna ID in the ant file, it will assume that the L1 (and L2) phase centers are coincident with the Antenna Reference Point (ARP) and that there is no phase center variation with vertical angle. As before, gmerge.exe is not picky, but it is mandatory to have an ant file.

Output File:

gmerge.out -- ASCII, "gmerge" format. This is merged pseudorange and carrier phase, at a common interval and data rate. The header is generated with the best available information on coordinates and antenna properties.


The program is pretty straightforward. It reformats data from two different RINEX inputs. The WGS84 ellipsoid is used; but it can be considered the same as the GRS80 ellipsoid at the sub-millimeter level. Nothing is done about reference frame origins. The ITRF frames are not the same as the NAD 83 frame (to the tune of a couple of meters). So, don't mix and match ITRF and NAD 83 in your "pos" file unless you know what you are doing.

A note on operation: gmerge will preferentially output the P(Y) pseudorange over a C/A pseudorange on L1.

I am in a gradual (very gradual) process of converting my software to work with the gmerge format, instead of directly with RINEX files.

RINEX Format

The RINEX version 2.10 format (25jan2002) can be obtained from the International GPS Service and the 8jun2001 version from the National Geodetic Survey.

pos Format

This is a simple ASCII, flat file. Two records per station. The file name is very simple, "pos" -- no extention. This file functions as a mini-database of authoritative coordinates. The file is mandatory. However, if a given station is not found in the pos file, then the RINEX header is used for station coordinates instead.

The format is a simple adaptation of the National Geodetic Survey "Blue Book" format.

ASCII, 2 records per station.

Record 1
01-04  4 character station ID, case sensitive.  Must match ID in RINEX header
05-06  blank
07-10  *80*
11-14  blank
15-44  station name
11-45  blank
46-47  geodetic latitude, degrees
48-49     "        "    , minutes
50-55     "        "    , units of 0.00001 arc-seconds
56-56  (N/S) -- "N" positive north, "S" positive south
57-59  geodetic longitude, degrees
60-61     "         "    , minutes
62-68     "         "    , units of 0.00001 arc-seconds
69-69  (W/E) -- "W" positive west, "E" positive east

Record 2
01-06  blank
07-10  *86*
11-45  blank
46-52  ellipsoidal height, units of millimeters

Here is an example pos file.

ant Format

This is a simple ASCII, flat file. The file name is very simple, "ant" -- no extention. This file is a database of GPS receiver antenna information. It provides the relations of the L1 and L2 phase centers to the ARP (antenna reference point), and it shows the variation of the phase centers relative to vertical angle. The file is mandatory. However, if a given antenna is not found in the ant file, then zero relations are used instead (for example, antenna "NONE").

The ant file is an exact copy of the National Geodetic Survey "ant_info.003" relative antenna calibration file.

The ant_info.003 file is also here: ant. Just put it into a file named ant.

gmerge Format

This is a simple ASCII, flat file. The header contains exactly 14 records. The 14-th record indicates how many epoch sets follow.

Each epoch set consists of an epoch header and a number of data records. There is one data record for each satellite in the epoch.

Here is the detailed gmerge format file.

Here is a sample gmerge.out file. It was generated between two CORS stations, SEAT to SEAW, for 3 epochs of data. Note the null values (99999999.999) generated whenever a given data element is not available. Time is in seconds from midnight (GPS time) of the day in the first record of the file (20jan2002).


This is "no frills" software. There are no warranties of any sort. No Windows GUI. Just the core function.

You must have the 4 input files with the names above. The program will overwrite any existing "gmerge.out" file in the working directory.

There is no support for GLONASS satellites. No more than 12 GPS satellites are assumed in view at any time. No more than 2 RINEX obs records per satellite are allowed (i.e. 10 observation types). Does not support WAAS transmitted pseudoranges. Epochs considered synchronized using a tolerance of 0.3 seconds.

Source Code and Binary Executable

The Fortran source code is gmerge.for.

The compiled executable (zipped) is gmerge.exe.

Fixed a coordinate conversion bug for southern hemisphere (2005-sep-17).

Fixed a longitude header display bug for eastern hemisphere (2005-dec-16).

Truncate high-order phase cycles that exceed null (99999999.999) (2008-apr-13).

Links to Other Pages

Sources of RINEX GPS base station data and coordinates

To Contact Me

My e-mail user name is the first initial of my first name followed by all the letters of my last name (see above). My ISP is "comcast", and it is a "dot-net", not a "dot-com". Sorry for not spelling out my e-mail address, but I try to keep the spam-bots from fingering me. But, just so the spam-bots don't feel left out, they can always go to

Back To Home