pystare.temporal#

Conversions#

from_ms_since_epoch_utc(ms_since_epoch_utc)

Converts an integer of milliseconds since unix epoch in UTC to TIV.

to_ms_since_epoch_utc(tivs)

Converts TIVs into milliseconds since epoch in UTC

Strings#

from_iso_strings(iso_strings[, forward_res, ...])

Converts an iso strings to STARE temporal index values

from_stare_timestrings(stare_timestrings[, ...])

Converts a STARE timestring to a STARE temporal index value The stare timestring is of the form "%Y-%m-%dT%H:%M:%S.%ms (f_res, b_res) (stare_type)

to_stare_timestring(tivs[, scale])

Converts a STARE temporal index value to a STARE timestring

Julian#

from_julian_date(jd1, jd2, scale[, ...])

Converts two-part Julian Dates (JD) to SIVs.

to_julian_date(tivs, scale)

Converts STARE temporal index values to two-part Julian Dates

Triples#

to_temporal_triple_ms(tiv)

from_temporal_triple(triple[, include_bounds])

Calculate a temporal index value from a low, middle, and high tiv.

Timestring manipulations#

analyze_iso8601_string(iso_string)

Returns 'has_tz' if timestring contains timezone Returns 'no_ms' if timestring does not contain milliseconds Returns 'nat' if timestring is not a ISO8601 timestring Returns 'good' if timestring contains ms but no tz

validate_iso8601_string(iso_string[, ...])

Test if string is ISO 8601 timestring.

validate_iso8601_strings(time_strings[, ...])

Validate if collection of strings all are ISO8601.

validate_stare_timestring(timestrings)

Tests if timestring has shape of STARE timestring,

validate_stare_timestrings(timestrings)

Validate if collection of strings are STARE timestrings.

force_3ms(timestamp)

Forces 3 digits for the millisecods in an ISO timestamp.

iso_to_stare_timestrings(iso_strings, ...)

Converts an ISO 8601 timestring to a STARE timestring.

Resolution functions#

coarsest_resolution_finer_or_equal_ms(ms)

Converts milliseconds to finer or equal STARE temporal resolution.

milliseconds_at_resolution(resolution)

Returns milliseconds for a given resolution.

set_reverse_resolution(tivs, resolutions)

Set the reverse resolution of STARE temporal index values

set_forward_resolution(tivs, resolutions)

Set the forward resolution of STARE temporal index values

reverse_resolution(indices)

Retrieve the reverse resolution

forward_resolution(indices)

Retrieve the forward resolution

coarsen(indices, reverse_increments, ...)

TODO: Not tested

Overlay functions#

cmp_temporal(tivs1, tivs2[, flatten])

Intersects tests between temporal index values.

temporal_value_intersection_if_overlap(...)

Calculate intersection temporal index value element-by-element if they overlap.

temporal_value_union_if_overlap(indices1, ...)

Calculate union temporal index value element-by-element if they overlap.

temporal_contains_instant(indices1, indices2)

Test if indices1 contain the instants in indices2.

N/A#

from_utc_variable(datetime, ...)

This function takes an array of datetimes and constructs temporal index values from them with forward and reverse resolutions as given in the arrays passed in.

now([forward_resolution, reverse_resolution])

Get a tiv representing current point in time.