RSUDP write output

With Rsudp, I get an output named “AM.R7FD6.00.EHZ.D.2024.003”,
Can I use MATLAB to draw this file’s time-velocity graph?
Also, I know the unit of the output is “Counts”, how could I transform “Counts” into “Velocity”(Or Displacement and Acceleration)

1 Like

Hello Yang-Rui-Jia,

Yes, you can use MATLAB to plot the data recorded by your Shake via RSUDP. You should be able to read the files using the information in this topic: Matlab question and then plot them out similarly to this: Live Seismic Traffic Monitoring with ThingSpeak, MATLAB, and Raspberry Shake » Hans on IoT - MATLAB & Simulink

Regarding your second query, you can convert counts to Velocity/Displacement/Acceleration by removing the response (that you can download from here: https://data.raspberryshake.org/fdsnws/station/1/query?level=resp&network=AM&station=R7FD6) with MATLAB, in a similar way ObsPy does it (https://data.raspberryshake.org/fdsnws/station/1/query?level=resp&network=AM&station=R7FD6). I would recommend using the MATLAB GISMO package: The GISMO Toolbox - seismic data analysis in MATLAB for all of this, as it is a great starting point for a MATLAB approach.

I run the rsudp and shake my RS4D. Then, I get ‘AM.R7FD6.00.EHZ.D.2024.005’.
I try to run the code showed below. What is the unit in ACC?
By the way, what is the definition about output type “DEF”?
from obspy.core import read
from obspy.clients.fdsn import Client

st = read(‘AM.R7FD6.00.EHZ.D.2024.005’)

print(st)
print(st[0].stats)

start = st[0].stats.starttime
end = st[0].stats.endtime
stn = st[0].stats.station
rs = Client(‘RASPISHAKE’)
inv = rs.get_stations(network=‘AM’, station=stn, level=‘RESP’)
output_type = ‘ACC’
st.attach_response(inv)
resp_removed = st.remove_response(output=output_type)

resp_removed.plot()

Hello Yang Rui Jia,

ACC units are meters per second squared (m/s^2) while DEF units, per ObsPy definition, are

default units, the response is calculated in output units/input units (last stage/first stage). Useful if the units for a particular type of sensor (e.g., a pressure sensor) cannot be converted to displacement, velocity or acceleration.

You can find more information here: obspy.core.trace.Trace.remove_response — ObsPy 1.4.0 documentation

ok, I got it. Thank you.
I think I have another question. Is there any method other than “response remove” to convert count data to velocity(or acc, disp) ?

Hello Yang Rui Jia,

When converting from the counts recorded by the instrument (the raw data) to any other analysis unit (m/s for velocity, etc), the full metadata included in the response are always required.

This is because they contain the performance envelope of the instrument and are to be used to achieve a correct data conversion via response removal. You will find more details about this subject on the relative ES page here: SAGE: Frequently Answered Question