Skip to main content

ligo_hires_gps_time is a Rust crate that provides high-resolution time types that coincide with GPS time, which is seconds since Januray 6, 1980, and disregards leap seconds.

The module provides two units of time of different duration.

The structs PipInstant, and PipDuration use the "pip" unit. There are $2^{30} \cdot 5^{9} = 2,097,152,000,000,000$ pips per second.

The structs ThumpInstant and ThumpDuration use the "thump". There are $2^{19} \cdot 5^{5} = 1,638,400,000$ pips per second.

History and Motivation

Almost all LIGO channels have a data rate that is a power of two. This choice has some benefits. The data rates are exactly representable as floating point numbers. FFTs, which are more efficient with inputs with sizes that are powers of two, produce bucket-widths that are either simple fractions of 1 Hz, or multiples of 1 Hz.

At the same time, LIGO software has historically used nanosecond resolution value to represent times and durations. Since there are 1 billion nanoseconds in a second, and 1 billion is factored into $2^9 \cdot 5^9$, nanoseconds can exactly represent any rate that's a power of two, as long as it's no greater than $2^9$, or 512 Hz.

The typical LIGO fast channel is $2^{14}$ or 16384 Hz, which is too great to be represented by nanoseconds exactly.
The period of such a channel is $P = 61035.15625$ ns .

For nanosecond resolution values, the error in units of samples is $E = 1 - \lfloor{P}\rfloor/{P} = 2.56\cdot10^{-6}$ samples-per-sample.

We get into trouble when $E \cdot n \ge 0.5$, where $n$ is the number of samples. For a 16384 Hz channel, that's less than 12 seconds worth of samples.

Double-precision floating point values can help, but they will become worse than nanosecond resolution for any span greater than 52 days, and won't do much better for most of the days prior.

With care, this error can be corrected, but if the right time resolution is used, the error is zero.

Operators

Useful math operators between durations and instants are provided, as well as operators for scaling duration.

Features

nds

Include functions to convert to and from NDS time types.

hifitime

Include functions to convert to and from hifitime types.

python

Include pyo3 and use it to create a python interface

all

Include all other features

Python

We use pyO3 to create a python interface, providing these same types and operators in python.

Build and package the python using "maturin", but make sure to specify at least the 'python' feature.

maturin develop --features python
python
import gps_pip

Testing python

With python in development using maturin, run

python -m pytest

Testing

bacon can be used to speed up testing.

The repo includes a bacon.toml file with some custom jobs.

Run bacon in the project directory. Use the hotkeys 1 through 0 in order to complete a full test, including of python interface.

Metadata

Release files for ligo-hires-gps-time 0.6.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ligo-hires-gps-time 0.6.5
File Size Uploaded
ligo_hires_gps_time-0.6.5.tar.gz 21.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for ligo-hires-gps-time 0.6.5
File
ligo_hires_gps_time-0.6.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details
ligo_hires_gps_time-0.6.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
ligo_hires_gps_time-0.6.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
ligo_hires_gps_time-0.6.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
ligo_hires_gps_time-0.6.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details

Total release size: 1.6 MB

Release files / ligo_hires_gps_time-0.6.5.tar.gz

Download URL ligo_hires_gps_time-0.6.5.tar.gz
Size 21.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9a26465e2d3aae60960f8d79018500f56d07a9575e62f90468284804344bd800
BLAKE2b-256 checksum
How to use checksums
1839f9910dabf728764e86ed6c80711df84985915d1704ef10615cdfbfe8c30d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.2

Release files / ligo_hires_gps_time-0.6.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL ligo_hires_gps_time-0.6.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 325.5 kB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
e9f30bd9ddf68204d3bbe55f00a92e14c220b211d9b1ddef444042df7753dcfc
BLAKE2b-256 checksum
How to use checksums
f2873d951166ddb5fb91e606cf11035191e69643a653f52fab0a2bfce7e5b2c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.2

Release files / ligo_hires_gps_time-0.6.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL ligo_hires_gps_time-0.6.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 325.4 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
daa54cc6644ffc6577361edca47100aa270cca3a86cf609ea6da380998dd0b12
BLAKE2b-256 checksum
How to use checksums
7957bfb82ab1b85d45193cbaec0b612db0f98212dbfbe8c3a9a8b747b696cf0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.2

Release files / ligo_hires_gps_time-0.6.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL ligo_hires_gps_time-0.6.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 321.8 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
748ac06cbac881704b55e054e294487373dee21e4fb035272dc566c66ebec24d
BLAKE2b-256 checksum
How to use checksums
9dba09713815dd39849a142111ca333172d5d1b4beb228b7637165be675f9ccb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.2

Release files / ligo_hires_gps_time-0.6.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL ligo_hires_gps_time-0.6.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 322.0 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
d893a4208e8902f47d8888fe8b272ecb0683b98ba8056dd6c582a306f53bc18b
BLAKE2b-256 checksum
How to use checksums
ea00638e981eba5c3f7585efae58380107932eb5ec998304ab275124b95d4124
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.2

Release files / ligo_hires_gps_time-0.6.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL ligo_hires_gps_time-0.6.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 322.8 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
a00a1897ae40fc9e0cbfa9952f76b9ae92e58cd826d058886df4f7d218e45c4f
BLAKE2b-256 checksum
How to use checksums
d2566ce93ff749717ace981ca9aba1a1a087719e0cbb6753ad5d74244e805ad8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.2

Release history Release notifications | RSS feed

This release

0.6.5 This release

6 release files

0.6.4

6 release files

0.6.3

6 release files

0.6.0

6 release files

0.5.3

6 release files

0.5.0

6 release files

0.4.8

5 release files

0.4.7

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page