Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to save synthetic 3 component RF's in '.H5' format #25

Open
rafa0110 opened this issue Apr 9, 2024 · 1 comment
Open

How to save synthetic 3 component RF's in '.H5' format #25

rafa0110 opened this issue Apr 9, 2024 · 1 comment

Comments

@rafa0110
Copy link

rafa0110 commented Apr 9, 2024

Hi!
I computed synthetic RF's using PyRaySum. Now, I want to save each component with the .H5 format. For the moment I am able to save just the 'RFR' and 'RFT'. For example, 2 Trace(s) in Stream:

            ...RFR | 1970-01-01T00:00:00.000000Z - 1970-01-01T00:01:21.237500Z | 80.0 Hz, 6500 samples
             ...RFT | 1970-01-01T00:00:00.000000Z - 1970-01-01T00:01:21.237500Z | 80.0 Hz, 6500 samples

In this case, the 'Z' component is missing in the stream.

The other alternative that I tried was to use:
result.write('synthetic')

It saved a 3 column '.txt' file with their respective header. Are there a way to write the results direct in the .'H5' format? or are there a way to transform the '.txt' to 'H5'?

Thanks in advance!

@wasjabloch
Copy link
Collaborator

I am not well familiar with the H5 format. As far as I understand it is related to NumPy Arrays. If you are using the obspy-interface (using pyraysum.run) you can extract the numpy data array e.g. from the .data attribute of the obspy traces. If you are using the NumPy interface (fraysum.run_bare) you will get back a NumPy Array that is probably already quite close to what you want. On the internet, I found this documentation. I hope it helps:

https://docs.h5py.org/en/stable/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants