5.2.11.1.2. eqcorrscan.utils.pre_processing.process

eqcorrscan.utils.pre_processing.process(tr, lowcut, highcut, filt_order, samp_rate, starttime=False, clip=False, length=86400, seisan_chan_names=False, ignore_length=False, fill_gaps=True, ignore_bad_data=False, fft_threads=1)[source]

Basic function to process data, usually called by dayproc or shortproc.

Functionally, this will bandpass, downsample and check headers and length of trace to ensure files start when they should and are the correct length. This is a simple wrapper on obspy functions, we include it here to provide a system to ensure all parts of the dataset are processed in the same way.

Note

Usually this function is called via dayproc or shortproc.

Parameters
  • tr (obspy.core.trace.Trace) – Trace to process

  • lowcut (float) – Low cut in Hz, if set to None and highcut is set, will use a lowpass filter.

  • highcut (float) – High cut in Hz, if set to None and lowcut is set, will use a highpass filter.

  • filt_order (int) – Number of corners for filter.

  • samp_rate (float) – Desired sampling rate in Hz.

  • starttime (obspy.core.utcdatetime.UTCDateTime) – Desired start of trace

  • clip (bool) – Whether to expect, and enforce a set length of data or not.

  • length (float) – Use to set a fixed length for data from the given starttime.

  • seisan_chan_names (bool) – Whether channels are named like seisan channels (which are two letters rather than SEED convention of three) - defaults to True.

  • ignore_length (bool) – See warning in dayproc.

  • fill_gaps (bool) – Whether to pad any gaps found with zeros or not.

  • ignore_bad_data (bool) – If False (default), errors will be raised if data are excessively gappy or are mostly zeros. If True then no error will be raised, but an empty trace will be returned.

  • fft_threads (int) – Number of threads to use for pyFFTW FFT in resampling

Returns

Processed trace.

Type

obspy.core.stream.Trace

Note

If your data contain gaps you should NOT fill those gaps before using the pre-process functions. The pre-process functions will fill the gaps internally prior to processing, process the data, then re-fill the gaps with zeros to ensure correlations are not incorrectly calculated within gaps. If your data have gaps you should pass a merged stream without the fill_value argument (e.g.: tr = tr.merge()).