Skip to content

Commit

Permalink
implement ResponseListElement.. but, uncertainties for FloatType of
Browse files Browse the repository at this point in the history
StationXML are not yet respected
  • Loading branch information
megies committed Sep 17, 2013
1 parent 2088b7f commit d8bb3bb
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions obspy/station/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,18 +416,35 @@ def __init__(self, stage_sequence_number, stage_gain_value,
decimation_correction=decimation_correction)


class ResponseListElement():
class ResponseListElement(object):
"""
Describes the amplitude and phase response value for a discrete frequency
value.
:type frequency: float
:param frequency: The frequency for which the response is valid.
:type amplitude: float
:param amplitude: The value for the amplitude response at this frequency.
:type phase: float
:param phase: The value for the phase response at this frequency.
"""
def __init__(self, frequency, amplitude, phase):
"""
:type frequency: float
:param frequency: The frequency for which the response is valid.
:type amplitude: float
:param amplitude: The value for the amplitude response at this
frequency.
:type phase: float
:param phase: The value for the phase response at this frequency.
"""
self.frequency = frequency
self.amplitude = amplitude
self.phase = phase

@property
def phase(self):
return self.__phase

@phase.setter
def phase(self, value):
value = float(value)
if not -360 <= value <= 360:
raise ValueError("Phase angle out of allowed range.")
self.__phase = value


class FIRResponseStage(ResponseStage):
Expand Down

0 comments on commit d8bb3bb

Please sign in to comment.