Skip to content
Snippets Groups Projects
Commit 0792d5a0 authored by Erin (Josh) Rigler's avatar Erin (Josh) Rigler
Browse files

Remove sensitivity/response; fixes issue #117.

Remove instrument_sensitivity if it exist. If it doesn't exist, then
an instrument_polynomial must describe the response, which is how the
Geomagnetism Program specifies an offset and gain response. We do not
attempt to remove any frequency-depenent response since these all seem
tailored to seismic data (e.g., no DC/zero-frequency response).
parent e05c96ab
No related branches found
No related tags found
1 merge request!335FDSN 3D Rotation
......@@ -258,6 +258,25 @@ class FDSNFactory(TimeseriesFactory):
data = self._rotate_and_return_requested_channel(
data, sncl, starttime, endtime, channel
)
for trace in data:
response = trace.stats.response
if response.instrument_sensitivity:
if response.instrument_sensitivity.input_units == "T":
# some ASL stations produce data in Teslas, not nanoteslas
response.instrument_sensitivity.value /= 1e9
response.instrument_sensitivity.input_units = "nT"
# apply total gain/sensitivity, ignore any frequency response
trace.remove_sensitivity()
else:
# according to fdsn docs, if no instrument_sensitivity,
# the response must be an instrument_polynomial
# https://docs.fdsn.org/projects/stationxml/en/latest/reference.html#instrumentsensitivity
# Geomag Program observatories use 2nd order instrument_polynomial
# to capture both offset and scale, but no frequency response
data.remove_response()
if data.count() == 0 and add_empty_channels:
data += self._get_empty_trace(
starttime=starttime,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment