TimeSpans

A class to cut out “undesired” data.

Constructor

  • TimeSpans: create a TimeSpans object using lists of [start_time, end_time]s.

  • TimeSpans.from_eqs: create an object of TimeSpans to avoid, based on an earthquake catalog.

Properties

  • start_times: returns list of span start_times

  • end_times: returns list of span end_times

  • spans: returns list of spans

Methods

Modify a Trace or Stream

  • cutout: cuts out data in the time spans

  • interp: linearly interpolate values within the time spans from their value at the span start to their value at the span end

  • zero: set values within the time spans to zero

Other

  • combine: combines two TimeSpans` objects

  • invert: return inverted time spans

  • has_zeros: Returns a bool indicating if the given time range intersects any of the TimeSpans.

  • plot: Make a stream or trace plot with highlighted time spans.

Example

TimeSpans example code