Converting UDP data format to Miniseed

Hi All,

I’m trying to display raspberry shake data in a web application dashboard using seisplotjs. I’ve connected a python API to get data from raspberry shake and push it to the web application. I’m wondering if there is any library that I can use to convert the UDP data format to Miniseed or other plotting friendly standard data formats? I’ve seen rsudp, don’t think it’s got any converter I can consume from my code?

Thanks.
Rangana

1 Like

Hello rangana, welcome to the community!

This is a very interesting application, nice idea!

Our RSUDP is an interpreter of what a UDP data stream provides, which is explained here: Raspberry Shake Data Producer UDP Port Output — Instructions on Setting Up Your Raspberry Shake. But, it also includes a miniSEED format file writer, which appends the UDP datacast stream to a local miniSEED file every 10 seconds.

Possibly, you can use this functionality to obtain the needed file and then feed it to your Python API forward to seisplotjs.

This is the relative section on the RSUDP manual: 3. Modules and Settings — rsudp documentation

1 Like

Hello.

Thanks for the reply. :slight_smile:
I’m ok with this approach and I will try this avenue.

Cheers,
Rangana

1 Like

No problem! I hope you will be able to do it!

Hello Stormchaser,

I’m having some difficulties trying to use the write function. I would like to save the data stream in acceleration and velocity units for my RS4D. The plot module works fine and shows acceleration and velocity units but I think I’m doing something wrong. I include my .json config file and the output of the rs-client command.

Any help would be very much appreciated.

Thanks.
Víctor

rsudp_settings.json (1.4 KB) rs-client_output.txt (3.6 KB)

Hello Victor,

It’s no problem at all, thank you for providing the settings and the output. The write section is properly configured except for a thing. You have written:

"write": {
    "enabled": true,
    "channels": ["all"]},

but that will not work because of the square brackets that contain the “all”. You should remove them, thus obtaining:

"write": {
    "enabled": true,
    "channels": "all"},

In this way, RSUDP should work as intended, and save the channel files in a folder inside the output_dir every 10 seconds, as per the manual: 3. Modules and Settings — rsudp documentation

Hello @Stormchaser,

Thank you for your answer, now I have properly configured the write section. Unfortunately, that change did not solve my problem and the output file has not been saved inside the output_dir.

These lines are from the rs-client command output, maybe I am configuring something else wrong.

2021-06-17 22:57:06 [Write] miniSEED output directory: False
2021-06-17 22:57:06 [Write] Writing inventory file: False/AM.R0FB0.00.xml
I/O error : No such file or directory
I/O error : No such file or directory

Thank you so much for your time.

Cheers,
Víctor

rsudp_settings.json (1.4 KB)
rs-client_output.txt (3.3 KB)

Hello Victor,

Let’s see what could be causing this. Firstly, I now see that you are using an RS1D, so it would be better for the code to have

["EHZ"]

under channels in the plot section and under channels in the forward section.

Also, to have

"HZ"

in channel in the alert section.

Regarding the output directory, it seems that the error is produced since RSUDP cannot find that directory. Since RSUDP does not have permissions to create one if it is missing, that message is produced.

Please check that the folder (and the folder path) exist, and the folder has writing permissions. If this still doesn’t work, you can try to assign a different directory as the output_dir.

Hello Stormchaser,

I have changed the [“EHZ”] channel label for the plot and forward section and the “HZ” for the alert section as well. I have also changed the ouput_dir path to /home/vic/Desktop, that change creates two folders, data and screenshots and the images are saved into screenshots successfully. Unfortunately, the data directory is still empty. :frowning_face:

Is there anything else that I could try to get the write section working?

Cheers,
Víctor
rsudp_settings.json (1.4 KB) rs-client_output.txt (3.4 KB)

Hello Victor,

This is quite strange, since the folders are created and, as you say, the screenshots are put in the correct one.

I put your rsudp_settings.json file in my RSUDP installation, only changing the output directory to my Desktop and the station code to my RS1D, and the data is being written in the data folder in that directory, alongside the various screenshots.

A last possible try could be writing the channel name in this way:

"write": {
    "enabled": true,
    "channels": ["EHZ"]},

instead of the current one. If even this doesn’t work, then I would advice to cleanup the system from this RSUDP installation, maybe even uninstall/reinstall Anaconda/Miniconda, and proceed to reinstall RSUDP from scratch.