Mondaic
This API reference is not for the latest stable Salvus version.

salvus.flow.collections.types

Types for the SalvusFlow collection objects.

Classes

TimeAxis

class TimeAxis(builtins.object):
    def __init__(
        self,
        start_time: float,
        reference_time: float,
        number_of_samples: int,
        dt: float,
        improper_last_sample: bool = False,
    ) -> None: ...

A time axis representation.

Parameters
  • start_time float — The start time in seconds.
  • reference_time float — The reference time in seconds, e.g. what time zero refers to.
  • number_of_samples int — The number of samples.
  • dt float — The sampling interval in seconds.
  • improper_last_sample bool — Whether or not the final sample lies on the regular grid of the time axis, or if it is the product of writing a final time step regardless of subsampling.
Attributes
end_time float

The end time in seconds.

sampling_rate float

The sampling rate in Hz.

Methods
from_start_end_dt()
def from_start_end_dt(
    start_time: float,
    end_time: float,
    dt: float,
    reference_time: float,
    improper_last_sample: bool = False,
) -> TimeAxis: ...

Construct a time axis object from the start and end time as well as the sampling interval.

Will place at least a sample at or beyond the final time step

Parameters
  • start_time float — The start time in seconds.
  • end_time float — The end time in seconds.
  • dt float — The sampling interval in seconds.
  • reference_time float — The reference time.
  • improper_last_sample bool — Whether or not the final sample lies on the regular grid of the time axis, or if it is the product of writing a final time step regardless of subsampling.
Returns TimeAxis
to_array()
def to_array(self) -> numpy.ndarray: ...

Return the time axis as a numpy array.

Returns numpy.ndarray