A Python tool for merging multiple RINEX (Receiver Independent Exchange Format) observation files into a single file. Supports both RINEX version 2 and version 3 observation files, including compressed RINEX format (.crx).
- Merge multiple RINEX files into a single output file
- Automatic version detection for RINEX v2 and v3 files
- Chronological sorting of epochs (configurable)
- Duplicate timestamp handling with multiple strategies
- Header merging with proper time range updates
- Compressed RINEX support (
.crxfiles)
- Python 3.12 or higher
- uv (recommended for dependency management)
- georinex (dependency)
This project uses uv for dependency management. If you have uv installed, simply run:
uv syncThis will install all required dependencies as specified in pyproject.toml.
If you prefer not to use uv, you can install the dependency manually:
pip install georinex>=1.16.2Merge multiple RINEX files into one:
uv run merge_rinex.py -i file1.rnx file2.rnx file3.rnx -o merged.obsOn Linux/macOS, you can use shell glob patterns:
uv run merge_rinex.py -i /path/to/rinex/dir/*.rnx -o merged.obsOn Windows, use PowerShell's Get-Item:
uv run merge_rinex.py -i (get-item rinex\*.crx) -o merged.obs| Option | Description |
|---|---|
-i, --input |
Input RINEX files (required). Accepts multiple files. |
-o, --output |
Output merged RINEX file path (required). |
--no-sort |
Preserve original epoch order instead of sorting chronologically. |
--duplicates |
Strategy for duplicate timestamps: keep_first (default), keep_last, or keep_all. |
-q, --quiet |
Suppress progress output. |
Merge with default settings (sorted, keep first duplicate):
uv run merge_rinex.py -i file1.crx file2.crx file3.crx -o merged.obsMerge without sorting epochs:
uv run merge_rinex.py -i file1.rnx file2.rnx -o merged.rnx --no-sortMerge keeping last occurrence of duplicates:
uv run merge_rinex.py -i *.crx -o merged.obs --duplicates keep_lastMerge in quiet mode (no progress output):
uv run merge_rinex.py -i file1.rnx file2.rnx -o merged.obs -q- File compatibility: Input files must share the same marker name, receiver, and antenna for a clean merge.
- Epoch sorting: Epochs are sorted chronologically by default. Use
--no-sortto preserve the original order. - Duplicate epochs: Duplicate timestamps (same epoch time) are handled based on the
--duplicatesstrategy:keep_first: Keep the first occurrence (default)keep_last: Keep the last occurrencekeep_all: Keep every occurrence
- Mixed versions: The tool will warn if mixed RINEX major versions (v2 and v3) are detected. The output may not be spec-compliant in such cases. Consider converting all files to the same version first.
rinex-merger/
├── merge_rinex.py # Main script
├── pyproject.toml # Project configuration and dependencies
├── uv.lock # Dependency lock file
├── README.md # This file
└── test_data/ # Sample RINEX files for testing
See LICENSE file for details.