Different velocity result in data view and from python

I try to use python to download my raspberryshake data
My code:

from obspy.clients.fdsn import Client
from obspy.core import Stream
rs = Client(‘RASPISHAKE’)
stn = ‘R246D’
inv = rs.get_stations(network=‘AM’, station=stn, level=‘RESP’)

start = UTCDateTime(2024, 2, 1, 10, 32, 51) # (YYYY, m, d, H, M, S)
end = UTCDateTime(2024, 2, 1, 10, 54, 18) # (YYYY, m, d, H, M, S)

channels = [‘EHE’]

stream = Stream()
for ch in channels:
trace = rs.get_waveforms(‘AM’, stn, ‘00’, ch, start, end)
stream += trace

stream.attach_response(inv)
Output_type = ‘VEL’
resp_removed = stream.remove_response(output=Output_type)
resp_removed.plot()

Then, I get the figure.

However, the velocity figure gotten from python is different to data view website

Which one is correct?

2 Likes

G’Day Yang-Rui-Jia.

Hmmm. Had me scratching my head for a while…

Initially I thought it was because you didn’t detrend the trace, but I added that to your code and got the same result, so I tried adding the water _level to the remove response command and no change…

In the end, I added a filter, and there’s something weird in your raw signal about 0.02 Hz. Try the code below and adjust the bottom two corners of the bandpass filter and watch the results. ;o)


from obspy.clients.fdsn import Client
from obspy.core import Stream
from obspy.core import UTCDateTime
rs = Client('RASPISHAKE')
stn = 'R246D'
inv = rs.get_stations(network='AM', station=stn, level='RESP')

start = UTCDateTime(2024, 2, 1, 10, 32, 51) # (YYYY, m, d, H, M, S)
end = UTCDateTime(2024, 2, 1, 10, 54, 18) # (YYYY, m, d, H, M, S)

channels = ['EHE']

filt = [0.01, 0.02, 50, 51]

stream = Stream()
for ch in channels:
    trace = rs.get_waveforms('AM', stn, '00', ch, start, end)
    trace.merge(method=0, fill_value='latest')         #fill in any gaps in the data to prevent a crash
    trace.detrend(type='demean')                       #demean the data
    stream += trace

#stream.attach_response(inv)
Output_type = 'VEL'
resp_removed = stream.remove_response(inventory=inv, pre_filt=filt, output=Output_type, water_level=60, plot=True)
#resp_removed.plot()

There may be a better explanation! I could be missing something still… but for the moment I think there’s something weird in the raw signal at about 0.02Hz and below (maybe event slightly above).

Al.

3 Likes

Thanks. I’ll try to run this code.

1 Like