Moving along!
Here I access waveform and instrument response from Raspberryshakedata and apply (remove) the instrument response.
I am confused about the results. The RS1D geophone should be in velocity units, but when I ask for VEL, the seismogram is riding on a long period signal. When I ask for ACC, I get a seismogram that is higher frequency and noisier than the original.
Below are the plots: Black curve (1) = input, Green curve (2) = ACC, Blue curve (3) = VEL, and Red curve (4)= DISP.
Here is the script:
# remove instrument response
# Load stuff
from obspy import read_inventory, read
from obspy.clients.fdsn import Client
from obspy.core import UTCDateTime, Stream
# set the station name and download the response information
stn = 'R2DEF'
inv = read_inventory('https://fdsnws.raspberryshakedata.com/fdsnws/station/1/query?network=AM&station=%s&level=resp&format=xml' % (stn))
print (inv)
# set data start/end times
start = UTCDateTime(2019, 8, 1, 14, 25, 30) # (YYYY, m, d, H, M, S)
end = UTCDateTime(2019, 8, 1, 14, 27, 0) # (YYYY, m, d, H, M, S)
# set the FDSN server location and channel names
rs = Client(base_url='https://fdsnws.raspberryshakedata.com/')
channels = ['EHZ'] # ENx = accelerometer channels; EHx or SHZ = geophone channels
# get waveforms, put them all into one Stream, and attach the response
stream = Stream()
for ch in channels:
trace = rs.get_waveforms('AM', stn, '00', ch, start, end)
stream += trace
stream.plot(color='black', linewidth='0.5',handle='true')
# attach the response info
stream.attach_response(inv)
# remove the response and plot ACC
resp_removed_ACC = stream.remove_response(output='ACC') # convert to acceleration in M/S
resp_removed_ACC.plot(color='darkgreen', linewidth='0.5', handle='true')
# remove the response and plot VEL
resp_removed_VEL = stream.remove_response(output='VEL') # convert to acceleration in M/S
resp_removed_VEL.plot(color='darkblue', linewidth='0.5', handle='true')
# remove the response and plot DISP
resp_removed_DISP = stream.remove_response(output='DISP') # convert to acceleration in M/S
resp_removed_DISP.plot(color='darkred', linewidth='0.5')