obspy.core.inventory.response.Response
- class Response(resource_id=None, instrument_sensitivity=None, instrument_polynomial=None, response_stages=None)[source]
Bases:
obspy.core.util.base.ComparingObject
The root response object.
Public Methods
Convert poles and zeros lists into a single-stage response. |
|
Returns frequency response and corresponding frequencies using evalresp. |
|
Returns frequency response for given frequencies using evalresp. |
|
Get Poles and Zeros stage. |
|
Returns SACPZ ASCII text representation of Response. |
|
Computes the input and output sampling rates of each stage. |
|
Show bode plot of instrument response. |
|
Recalculates the overall sensitivity. |
Private Methods
Warning
Private methods are mainly for internal/developer use and their API might change without notice.
- Response._attempt_to_fix_units()[source]
Internal helper function that will add units to gain only stages based on the units of surrounding stages.
Should be called when parsing from file formats that don’t have units for identity stages.
- Response._call_eval_resp_for_frequencies(frequencies, output='VEL', start_stage=None, end_stage=None, hide_sensitivity_mismatch_warning=False)[source]
Returns frequency response for given frequencies using evalresp.
Also returns the overall sensitivity frequency and its gain.
- Parameters
frequencies (list[float]) – Discrete frequencies to calculate response for.
output (str) –
Output units. One of:
"DISP"
displacement, output unit is meters
"VEL"
velocity, output unit is meters/second
"ACC"
acceleration, output unit is meters/second**2
"DEF"
default units, the response is calculated in output units/input units (last stage/first stage). Useful if the units for a particular type of sensor (e.g., a pressure sensor) cannot be converted to displacement, velocity or acceleration.
start_stage (int, optional) – Stage sequence number of first stage that will be used (disregarding all earlier stages).
end_stage (int, optional) – Stage sequence number of last stage that will be used (disregarding all later stages).
hide_sensitivity_mismatch_warning (bool) – Hide the evalresp warning that computed and reported sensitivities don’t match.
- Return type
tuple(
numpy.ndarray
, chan)- Returns
frequency response at requested frequencies
- Response._get_overall_sensitivity_and_gain(frequency=None, output='VEL')[source]
Get the overall sensitivity and gain from stages 1 to N.
Returns the overall sensitivity frequency and gain, which can be used to create stage 0.
- Parameters
output (str) –
Output units. One of:
"DISP"
displacement, output unit is meters
"VEL"
velocity, output unit is meters/second
"ACC"
acceleration, output unit is meters/second**2
"DEF"
default units, the response is calculated in output units/input units (last stage/first stage). Useful if the units for a particular type of sensor (e.g., a pressure sensor) cannot be converted to displacement, velocity or acceleration.
frequency (float) – Frequency to calculate overall sensitivity for in Hertz. Defaults to normalization frequency of stage 1.
- Return type
- tuple
( float, float )
- Returns
frequency and gain at frequency.
Special Methods
- Response.__delattr__(name, /)
Implement delattr(self, name).
- Response.__dir__()
Default dir() implementation.
- Response.__eq__(other)
- Response.__format__(format_spec, /)
Default object formatter.
- Response.__ge__(value, /)
Return self>=value.
- Response.__getattribute__(name, /)
Return getattr(self, name).
- Response.__gt__(value, /)
Return self>value.
- Response.__init__(resource_id=None, instrument_sensitivity=None, instrument_polynomial=None, response_stages=None)[source]
- Parameters
resource_id (str) – This field contains a string that should serve as a unique resource identifier. This identifier can be interpreted differently depending on the data center/software that generated the document. Also, we recommend to use something like GENERATOR:Meaningful ID. As a common behavior equipment with the same ID should contains the same information/be derived from the same base instruments.
instrument_sensitivity (
InstrumentSensitivity
) – The total sensitivity for the given channel, representing the complete acquisition system expressed as a scalar.instrument_polynomial (
InstrumentPolynomial
) – The total sensitivity for the given channel, representing the complete acquisition system expressed as a polynomial.response_stages (list of
ResponseStage
objects) – A list of the response stages. Covers SEED blockettes 53 to 56.
- Response.__init_subclass__()
This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
- Response.__le__(value, /)
Return self<=value.
- Response.__lt__(value, /)
Return self<value.
- Response.__ne__(other)
- Response.__new__(**kwargs)
- Response.__reduce__()
Helper for pickle.
- Response.__reduce_ex__(protocol, /)
Helper for pickle.
- Response.__repr__()
Return repr(self).
- Response.__setattr__(name, value, /)
Implement setattr(self, name, value).
- Response.__sizeof__()
Size of object in memory, in bytes.
- Response.__subclasshook__()
Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).