Skip to content

Usage

Import

The module can be imported as:

Import
from gnss_calendar.gnss_calendar import GnssCalendar

Initialize

You can initialize a gnss-calender object as:

Initialize with string
obj = GnssCalendar(epoch_str=<epoch_string>)

if not obj.epoch:
    return None

Alternatively, you can pass an already initialized datetime object to the epoch parameter.

Initialize with datetime object
import datetime as dt

epoch = dt.datetime(2022, 1, 1, 12, 0, 0)
obj = GnssCalendar(epoch=epoch)

Console Application

The application ships also with a terminal client application named gnss_calendar_cli.py:

python gnss_calendar_cli.py 2022-01-01

Note

If passed without any arguments, the current datetime in UTC will be used.

The result is as follows:

Output
   -----------------------------------------------------
   | YYYY mm DD  DDD    MJD  GPSW.D  Second  Weekday   |
   -----------------------------------------------------
   | 2021 12 26  360  59574  2190.0       0  Sunday    |
   | 2021 12 27  361  59575  2190.1   86400  Monday    |
   | 2021 12 28  362  59576  2190.2  172800  Tuesday   |
   | 2021 12 29  363  59577  2190.3  259200  Wednesday |
   | 2021 12 30  364  59578  2190.4  345600  Thursday  |
   | 2021 12 31  365  59579  2190.5  432000  Friday    |
>> | 2022 01 01  001  59580  2190.6  518400  Saturday  |
   -----------------------------------------------------

   -----------------------------------------------------
   | HH MM SS  Unix        MJDF                        |
   -----------------------------------------------------
   | 00 00 00  1640995200  59580.00000                 |
   -----------------------------------------------------