tiskitpy.PeriodicTransient

class tiskitpy.PeriodicTransient(name, period, dp, clips, transient_starttime, freq_HP=True, freq_LP=0.05)

Bases: object

Class to determine parameters for and remove a periodic transient

The program will make transient slices starting between transient_starttime and 1/3 of self.period earlier

To include the entire transient in each trace slice, transient_starttime must not be too late. A few seconds early is OK.

Parameters:
  • name (str) – name of this periodic transient (e.g., ‘hourly’)

  • period (float) – seconds between each transient

  • dp (float) – how many seconds to change the period by when testing for better values. Should be equal to or slightly greater than the uncertainty in your estimate of period

  • clips (tuple) – clip values outside of this range (low, high). Should contain the max range of the transient

  • transient_starttime (str or ~class obspy.core.UTCDateTime) – onset time of earliest transient.

  • freq_HP (float or bool) – highpass corner frequency used for training and matching. If True, sets to 1/period. If False, do not cut off low frequencies

  • freq_LP (float) – lowpass corner frequency used for training and matching (0.05 is a good value to remove microseisms)

  • transient_model – Model of the transient

  • dirac_comb – the dirac comb to convolve with the transient

  • n_transients_used – number of transients used to calculate the model

  • self.tm – transient model shifted one left

  • self.tp – transient model shifted one right

calc_timing(trace, eq_spans=True)

Interactively calculate transient timing parameters.

The user chooses the transient period, clip levels and starttime best fitting the data.

Parameters:
  • trace (class obspy.core.Trace) – data

  • eq_spans (TimeSpans or bool) – if TimeSpans: times spans in which to zero data if True: use TimeSpans.from_eqs()

calc_transient(trace, eq_spans=True, match=True, plots=False)

Calculate transient for a given trace and transient parameters

Parameters:
  • trace (obspy.core.stream.Trace) – input data trace

  • eq_spans (TimeSpans or bool) – if TimeSpans: times spans in which to zero data if True: use TimeSpans.from_eqs()

  • plots (bool) – plot results

remove_transient(trace, match=True, plots=False)

Remove transient from trace

Parameters:
  • trace (obspy.Trace) – input data

  • match (bool) – match each transient individually. This is useful if the transient dominates the trace, not if the transient is subtle.

Returns:

output data

Return type:

(obspy.Trace)