arthurdjn / gnsstools

Python tools to read and process RINEX, SP3 etc. files, for GNSS management and orbit corrections.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Project logo

Status License


Process RINEX, SP3 and other GNSS files for orbit computation and geo-localization. Retrieve precise satellites and receptors position in a few lines of code.

Table of Contents

About

Overview

This project will help you in your GNSS workflow. It provides tools for manipulating / converting GNSS dates (from datetime to Julian Day), readers for RINEX and SP3 for version 2 and 3. Last but not least, gnsstools lets you correct GNSS orbits from raw files, and compute receptors' position.

Status

Development Status Feature
GNSS Time finished
  • DateTime
  • GPS Time
  • Julian Day
  • Modified Julian Day
Rinex in progress
  • Rinex Observation
  • Rinex Navigation
  • SP3
  • Rinex Compact
Satellites in progress
  • Position
  • Clock Offset
  • Pseudo Distance

Documentation

Read The Docs

The documentation is available online on readthedocs. You will find the code documentation of the whole package, examples and tutorials. Make sure you have read the documentation before opening an issue.

Tutorials

In addition of the examples and tutorials available on readthedocs, there is a list of jupyter notebooks. Each one focuses on a specific topic: reading files, retrieving orbits, computing receptor's position etc.

Getting Started

These instructions will show you the steps on how to install and use gnsstools straight from the box.

Installing

The package is available from PyPi. To install it, use:

pip install gnsstools

Alternatively, you can install the latest version from this repository. Download the package from github, then from the root folder:

python install .

GNSS Time

To handles and convert time in different time system you should use the module gnsstime. It will create a time in the datetime.datetime format, and also process the provided arguments.

Usage

The gnsstime object behave exactly like a datetime one, as it inherits from it.

from gnsstools import gnsstime

# Create a datetime from GNSS information
# Year, Month, Day, Hour, Minute, Second, MicroSecond
date = gnsstime(18, 1, 1, 0, 0, 0)
date = gnsstime(2018, 1, 1, 0, 0, 0)

However, the gnsstime is not type sensitive: you can provide arguments as a string, float or int. If the argument is a string, it will convert it first as a float. Then, depending on the argument, it will extract the decimal and update the other arguments.
For example, if second=5.35, the number of seconds will be 5 and the number of microsecond 350000. Same for day=2.74 etc.

# Provide arguments as a string
date = gnsstime("18", "1", "1", "0", "0", "0")
date = gnsstime("2018", "01", "01", "00", "00", "00.000000")

# Provide argument as a float
date = gnsstime(2018, 1, 1, 5.933, 4.36, 33.231)

You can also retrieve the number of days of the year, seconds of the day / weeks etc:

date = gnsstime(2018, 1, 1, 0, 0, 0)

doy = date.doy # Day of the year
woy = date.woy # Week of the year
sod = date.sod # Second of the day
sow = date.sow # Second of the week

GPS Time

You can retrieve the number of seconds, days and weeks from a the GPS origin (GPS0) with:

date = gnsstime(2018, 1, 1, 0, 0, 0)

# From GPS0 defined at 1980-01-06T00:00:00 (UTC)
seconds0 = date.seconds0
days0 = date.days0
weeks0 = date.weeks0

Julian Day

You can also retrieved the Julian Day:

date = gnsstime(2000, 1, 1, 0, 0, 0)

# Julian Day for year 2000
jd = date.jd
# Julian Day for year 1950
jd50 = date.jd50

You can also create a gnsstime object from a Julian Day:

jd = 2451545.0
date = gnsstime.fromjd(jd)

jd50 = 2433282.5
date = gnsstime.fromjd50(jd50)

Modified Julian Day

Finally, you can extract modified Julian Day:

date = gnsstime(2000, 1, 1, 0, 0, 0)

# Modified Julian Day
mjd = date.mjd

Again, you can create a gnsstime object from a modified Julian Day:

mjd = 51544.5
date = gnsstime.frommjd(mjd)

Rinex

Load GNSS navigation and observation data as a pandas.DataFrame.

The supported format are:

  • .**o : Rinex 2 Observation,
  • *O.rnx : Rinex 3 Observation,
  • .**n, .**g : Rinex 2 Navigation,
  • *N.rnx : Rinex 3 Navigation,
  • .SP3 : SP3

Observation

from gnsstools import rinex

filename = "data/edf1285b.18o"
df = rinex.load(filename)

Rinex2 Obs

Navigation

from gnsstools import rinex

filename = "data/BRDC00IGS_R_20182850000_01D_MN.rnx"
df = rinex.load(filename)

Rinex3 Nav

Once loaded, you select an ephemeris / satellite for a specific date with:

from gnsstools import gnsstime

date = gnsstime(2018, 10, 12, 0, 40, 15)
satellite = df.select("G", 2, date)

If date is not part of the dataset df, it will return the closest satellite.

SP3

from gnsstools import rinex

filename = "data/COM20225_15M.SP3"
df = rinex.load(filename)

Rinex3 SP3

Compact

Work in Progress

Satellites

Work in Progress

Contributing

Authors

Acknowledgements

  • Hat tip to anyone whose code was used
  • Inspiration
  • References

About

Python tools to read and process RINEX, SP3 etc. files, for GNSS management and orbit corrections.

License:MIT License


Languages

Language:Python 100.0%