Rel_calib_stack to response


Can someone help to get from the output of rel_calib_stack to a obspy.core.inventory.response.Response that I can attach to a ?



You basically want to make a Response with one stage and that being a ResponseListResponseStage that has the list of freq-amp-phase pairs.
Then you could probably then go one of two ways with that stage’s gain and the instrument sensitivity. You could be lazy and set it to 1 and use the values you got on these individual value pairs, or probably better you could use an actual proper value from your flat response part (assuming there is one) and then divide all original values for “amplitude” by that value for the individual pairs, so that all the value pairs have the amplitude relative to that overall sensitivity.

1 Like

No matter how I define the instrument_sensitivity when creating the Response, I will always get an error when trying to plot the response.

I have tried:
response = Response(resource_id=None, instrument_sensitivity=None, instrument_polynomial=None, response_stages=responseLS)
the same with: instrument_sensitivity=-170.0 and instrument_sensitivity=InstrumentSensitivity(amp_array, freq_array,“PA”, “V”) where amp_array and feq_array are the same as in the defined response stage.
To plot, I use: response.plot(min_freq=1, sampling_rate=256e3)
Error message: line 1544, in _call_eval_resp_for_frequencies

  • gain_blkt.gain = self.instrument_sensitivity.value*

Instrument sensitivity isn’t with arrays of values, it’s defined at one certain frequency. Also please keep it to your original ticket and not mix into this one which was resolved, thanks!
Like I said in the other ticket, you’ll need phase values as well at these frequencies you listed.