Skip to content

Formatting

Since gnss-calendar converts all epoch strings to a Python datetime 1 object, you can perform any operations supported by this package directly on the epoch property. Additionally you are able to receive the following formats.

Initialize an Object

Initialize Datetime Object
obj = GnssCalendar(epoch_str="2022-01-01")

Modified Julian Date (MJD)

The MJD therefore gives the number of days since midnight on November 17, 1858. This date corresponds to 2400000.5 days after day 0 of the Julian calendar.

When called with the parameter full=True it includes the fraction of the day.

MJD (int)
obj.mjd()
#>> 59580
MJD (float)
obj.mjd(full=True)
#>> 59580.00000

GPS Week and Day

The continious count of GPS weeks started on Jan 6, 1980. A GPS week starts on Sunday (GPSD=0) at 00:00 GPS time and ends on Saturday (GPSD=6) at 23:59 GPS time.

GPS Week
obj.wwww()
#>> gpsw, gpsd, gpswsec
#>> (2190, 6, 518400)

obj.gpsw()
#>> 2190

obj.gpsd()
#>> 6

obj.gpswsec()
#>> 518400

The method gpswsec can be called with a modulo operand to determine the seconds per hour or day.

GPS Day Seconds
obj.gpswsec(86400)
#>> 0

SINEX Format

Datetime as used in the SINEX (Solution INdependent EXchange Format) format 2.

SINEX
obj.sinex()
#>> 2022:001:00000

RINEX Epoch

A datetime string as used in the RINEX epoch lines.

RINEX v.3 Epoch
obj.rinex_epoch_date()
#>> 2022 01 01 00 00 00.0000000
RINEX v.2 Epoch
obj.rinex_epoch_date()
#>> 22 01 01 00 00 00.0000000

RINEX Filenames

Currently, RINEX v.3 and RINEX v.2 filenames are supported. If you like to substitute a specific pattern, please refer to Usage::Operations.

RINEX v.3
obj.rinex3()
#>> 20220010000
RINEX v.2 daily
obj.rinex2("D")
#>> 0010.22
RINEX v.2 hourly
obj.rinex2("H")
#>> 001a.22
RINEX v.2 sub-hourly
obj.rinex2("Q")
#>> 001a00.22

GFZ CHAMP Filenames

A GFZ internal filename that was defined in the era of the CHAMP satellite mission (2000).

CHAMP
obj.champ()
#>> 21906az0000

When called with a parameter interval the datetime will be rounded to the seconds given.

CHAMP (rounded)
obj = GnssCalendar(epoch_str="2022-01-01 00:17:00")
obj.champ(900) # quaterly
#>> 21906az0900

ISO Datetimes

ISO 8601
obj.iso_8601()
#>> 2022-01-01T00:00:00Z

UNIX Seconds

Converts to seconds since Jan 1, 1970 UTC.

UNIX
obj.unix()
#>> 1640995200

  1. https://docs.python.org/3/library/datetime.html 

  2. https://files.igs.org/pub/data/format/sinex_v210_proposal.pdf