obspy.signal.spectral_estimation.PPSD.__init__

PPSD.__init__(stats, metadata, skip_on_gaps=False, db_bins=(-200, -50, 1.0), ppsd_length=3600.0, overlap=0.5, special_handling=None, period_smoothing_width_octaves=1.0, period_step_octaves=0.125, period_limits=None, **kwargs)[source]

Initialize the PPSD object setting all fixed information on the station that should not change afterwards to guarantee consistent spectral estimates. The necessary instrument response information can be provided in several ways using the metadata keyword argument:

  • Providing an Inventory object (e.g. read from a StationXML file using read_inventory() or fetched from a FDSN webservice).
  • Providing an obspy.io.xseed Parser, (e.g. containing metadata from a Dataless SEED file).
  • Providing the filename/path to a local RESP file.
  • Providing a dictionary containing poles and zeros information. Be aware that this leads to wrong results if the instrument’s response is changing over the timespans that are added to the PPSD. Use with caution!
Note:

When using special_handling=”ringlaser” the applied processing steps are changed. Differentiation of data (converting velocity to acceleration data) will be omitted and a flat instrument response is assumed, leaving away response removal and only dividing by metadata[‘sensitivity’] specified in the provided metadata dictionary (other keys do not have to be present then). For scaling factors that are usually multiplied to the data remember to use the inverse as metadata[‘sensitivity’].

Parameters:
  • stats (Stats) Stats of the station/instrument to process
  • metadata (Inventory or xseed Parser or str or dict) Response information of instrument. See above notes for details.
  • skip_on_gaps (bool, optional) Determines whether time segments with gaps should be skipped entirely. [McNamara2004] merge gappy traces by filling with zeros. This results in a clearly identifiable outlier psd line in the PPSD visualization. Select skip_on_gaps=True for not filling gaps with zeros which might result in some data segments shorter than ppsd_length not used in the PPSD.
  • db_bins (tuple of three ints/floats) Specify the lower and upper boundary and the width of the db bins. The bin width might get adjusted to fit a number of equally spaced bins in between the given boundaries.
  • ppsd_length (float, optional) Length of data segments passed to psd in seconds. In the paper by [McNamara2004] a value of 3600 (1 hour) was chosen. Longer segments increase the upper limit of analyzed periods but decrease the number of analyzed segments.
  • overlap (float, optional) Overlap of segments passed to psd. Overlap may take values between 0 and 1 and is given as fraction of the length of one segment, e.g. ppsd_length=3600 and overlap=0.5 result in an overlap of 1800s of the segments.
  • special_handling (str, optional) Switches on customized handling for data other than seismometer recordings. Can be one of: ‘ringlaser’ (no instrument correction, just division by metadata[“sensitivity”] of provided metadata dictionary), ‘hydrophone’ (no differentiation after instrument correction).
  • period_smoothing_width_octaves (float) Determines over what period/frequency range the psd is smoothed around every central period/frequency. Given in fractions of octaves (default of 1 means the psd is averaged over a full octave at each central frequency).
  • period_step_octaves (float) Step length on frequency axis in fraction of octaves (default of 0.125 means one smoothed psd value on the frequency axis is measured every 1/8 of an octave).
  • period_limits (tuple/list of two float) Set custom lower and upper end of period range (e.g. (0.01, 100)). The specified lower end of period range will be set as the central period of the first bin (geometric mean of left/right edges of smoothing interval). At the upper end of the specified period range, no more additional bins will be added after the bin whose center frequency exceeds the given upper end for the first time.