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

question about the *.nc files #380

Open
seismolab-uct opened this issue Nov 4, 2024 · 3 comments
Open

question about the *.nc files #380

seismolab-uct opened this issue Nov 4, 2024 · 3 comments

Comments

@seismolab-uct
Copy link

Hi I have a few basic questions about the *.nc files generated in the different steps. I'm trying to export the results of the reference stack to segy (or first miniseed then segy).

I loaded a few *.nc files and I noticed there are two data variables REF and a CCF:

import numpy as np
import xarray as xr
import matplotlib.pyplot as plt

data = xr.open_dataset("W.10001.--_XW.10010.--.nc")

<xarray.Dataset> Size: 115kB
Dimensions:  (taxis: 4801)
Coordinates:
  * taxis    (taxis) float64 38kB -120.0 -120.0 -119.9 ... 119.9 120.0 120.0
Data variables:
    CCF      (taxis) float64 38kB ...
    REF      (taxis) float64 38kB ...

data.REF.plot()
plt.show()
data.CCF.plot()
plt.show()

From the figures I can see that CCF is the actual reference stack cross-correlation, while I am not particularly sure what REF is for.

REF
nc_ref_plot

CCF
nc_ccf_plot

I would appreciate any comments or suggestions on how best to convert all these *.nc files to mseed (or segy) and if there is a way of extracting metadata from the *.nc files such as the station pair, or other items that can be used to populate an obspy stream for example.

Thanks

@ThomasLecocq
Copy link
Member

The best is to use the API to get the results and export them, not to read the NC files directly. See the "interaction examples" in the documentation. Also, note that the current master version and its documentation aren't fully finished, and this is "as is"...

@ThomasLecocq
Copy link
Member

(NB: the ref NC shouldn't contain a CCF object but a REF object indeed (in the example above, the REF object was pre-filled with random values (python randoms: 0 to 1 and should have been replaced by the true CCF values). Leaving this issue open for that very reason, for other interaction questions, please use the Discussions tab!

@seismolab-uct
Copy link
Author

Thanks I'll look through the interaction examples, and will make sure to use the discussions tab for questions like these.

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