tiskitpy.Decimator

class tiskitpy.Decimator(decimates: list, verbose: bool = False)

Bases: object

Class to decimate obspy stream intelligenty

Can also update the station inventory with the used filter responses

Parameters:
  • decimates (list) – list of decimation factors to use (integers between 2 and 7, will be applied in order)

  • verbose (bool) – Be chatty

decimate(data, keep_dtype=True)

Apply decimator to data

Parameters:
  • data (obspy.Stream or obspy.Trace) – waveform data

  • keep_dformat (bool) – force output data format to be the same as the input data_format

decimates: list
property decimation_factor

Total decimation (product of decimates)

static get_band_code(in_band_code, sample_rate)

Return the channel band code based on an input band_code

Parameters:
  • in_band_code – input band code (‘B’ if cutoff > 10s, ‘S’ otherwise)

  • sample_rate – input sample rate (sps)

update_inventory(inv, st=None, normalize_firs=False, quiet=False, inv_force_overwrite=False)

Update inventory for channels found in stream

Parameters:
  • inv (obspy.core.events.inventory.Inventory) – inventory

  • st (obspy.core.stream.Stream) – data stream (used to determine net/sta/chan/loc codes). If None, will update every channel

  • normalize_firs (bool) – normalize FIR channels that aren’t already

  • inv_force_overwrite (bool) – If the target channel seed_id already exists (and it’s not the source channel seed_id), overwrite it

Returns:

obspy inventory with new channels

update_inventory_from_nslc(inv, network='*', station='*', channel='*', location='*', quiet=False, normalize_firs=False)

Update inventory based on network, station, channel and location codes

Parameters:
  • inv (obspy.core.events.inventory.Inventory) – inventory

  • network (str) – FDSN network code

  • station (str) – station code

  • channel (str) – channel code

  • location (str) – FDSN location code

  • quiet (bool) – Do not say what channel(s) was changed

  • normalize_firs (bool) – normalize FIR channesl that aren’t already

Returns:

inv (obspy.core.events.inventory.Inventory):

updated inventory

Return type:

newinv

network, station, channel and location codes are ‘*’ by default, may include wildcards as specified in obspy.core.stream.Stream.select

verbose: bool = False