paudetseis / pyraysum Goto Github PK
View Code? Open in Web Editor NEWTeleseismic body wave modeling through stacks of (dipping/anisotropic) layers
Home Page: https://paudetseis.github.io/PyRaysum/
License: MIT License
Teleseismic body wave modeling through stacks of (dipping/anisotropic) layers
Home Page: https://paudetseis.github.io/PyRaysum/
License: MIT License
Hii, paudetseis is it possible to obtain epicentral distance using this software, i obtain only back azimuth and slowness information along with time, r,t,z values. Or can the back-azimuth be assumed as epicentral distance in the case of raysum. Please suggest.Thanks.
hi @wsja,
I have been trying to use rather thin layers (~2 km) in the velocity model for pyraysum and when I do, the following lines (#593-595) in raysum.f
are triggered. The maxvals I get are <0.99 and >0.9. The resultant receiver functions (and seismograms??) are nans.
write (*,*) 'WARNING in evec_check, maxval: ',maxval,
& ' (should be 1). Ignoring phase.'
Is there any workaround for this? Or is this a limitation?
prs
run-time arguments in trace headersHi @wsja,
I am trying to compile fraysum with increased values for maxlay (from 15 to 30) and maxph (from 40000 to 80000). Are there any other parameters that needs changing to accommodate new parameters?
Also, can you please explain the procedure to compile with new params.h?
Thanks very much.
While executing streamlist = prs.run(model, geom, rc) i am getting error as
lib/python3.7/site-packages/pyraysum/prs.py", line 2128, in run
traces, traveltimes, amplitudes, phaselist = fraysum.run_full(
AttributeError: module 'fraysum' has no attribute 'run_full
Plz suggest a answer.
Hi @wsja
For some velocity models, receiver function computations take an infinite time. When I use verbose=1
, I see the following output, and stays the same forever. What could be happening here? I tried tweaking the velocity model in question, but same outcome. I am sorry for opening all these issues, but it seems the only way to resolve them. Thanks in advance!
phase: 400
layer: type:
8 1
7 1
6 1
5 1
4 1
3 1
2 1
1 1
1 5
2 5
3 5
4 6
5 6
6 6
7 6
7 3
6 3
5 3
4 3
3 2
2 2
1 2
phase: 401
layer: type:
8 1
7 1
6 1
5 1
4 1
3 1
2 1
1 1
1 5
2 5
3 5
4 6
5 6
6 6
7 6
7 3
6 3
5 3
4 3
3 3
2 3
1 3
Hello, I installed pyraysum with:
conda create -n prs python fortran-compiler obspy -c conda-forge
conda activate prs
conda install jupyter
pip install pyraysum
When I try to run anything, for example:
from pyraysum import Model, Geometry, Control, run
# Build a 1-layer-over-half-space subsurface model
model = Model(
thickn=[32000, 0], # m; half-space thickness is irrelevant
rho=[2800, 3600], # kg/m^3
vp=[6400, 8100], # m/s
vs=[3600, 4650], # m/s
)
model.plot()
I get:
ImportError Traceback (most recent call last)
Cell In[1], line 1
----> 1 from pyraysum import Model, Geometry, Control, run
3 # Build a 1-layer-over-half-space subsurface model
4 model = Model(
5 thickn=[32000, 0], # m; half-space thickness is irrelevant
6 rho=[2800, 3600], # kg/m^3
7 vp=[6400, 8100], # m/s
8 vs=[3600, 4650], # m/s
9 )
File ~\.conda\envs\prs\lib\site-packages\pyraysum\__init__.py:25
1 # Copyright 2022 Wasja Bloch, Pascal Audet
2
3 # This file is part of PyRaysum.
(...)
20 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 # SOFTWARE.
23 __version__ = '1.0.0'
---> 25 from .prs import Model, Geometry, Control, Result, run
File ~\.conda\envs\prs\lib\site-packages\pyraysum\prs.py:32
30 from numpy.fft import fft, ifft, fftshift
31 from copy import deepcopy
---> 32 import fraysum
34 from pyraysum import plot
35 from pyraysum.frs import read_arrivals, read_traces, _phnames
ImportError: DLL load failed while importing fraysum: The specified module could not be found.
And I cannot find fraysum anywhere.
Thank you for your help!
For certain ray geometries, when the subsurface model contains a layer where the isotropy flag is off (flag=0
), fraysum
runs forever, returns a ERROR in evec_check
or runs into a segmentation fault.
Download:
ERROR_evec_mod.txt
ERROR_evec_geom.txt
segfault_mod.txt
then execute:
# requires future branch
from pyraysum import prs
mod = prs.read_model('ERROR_evec_mod.txt')
geom = prs.read_geometry('ERROR_evec_geom.txt')
# runs forever
prs.run_frs(mod, geom)
mod = prs.read_model('segfault_mod.txt')
# causes ERROR in evec_check
prs.run_frs(mod, geom, mults=1)
# causes segmentation fault
prs.run_frs(mod, geom)
When trying to add features to plot or modify them, they are not available to edit. My suggestion is to set the figure to be returned by their functions.
hello!
I've followed the instructions and installed pyraysum using pip, and I've navigated to the examples\notebooks folder and opened Jupyter Notebook. However, when I attempt to run from pyraysum import prs, I encounter
an error that seems to indicate that 'fraysum' is missing. Here's the error message I'm receiving , I would greatly appreciate your guidance on how to resolve this issue. :
ImportError Traceback (most `recent` call last)
Cell In[6], line 1
----> 1 from pyraysum import prs
File F:\anaconda\envs\prs\lib\site-packages\pyraysum\__init__.py:25
1 # Copyright 2022 Wasja Bloch, Pascal Audet
2
3 # This file is part of PyRaysum.
(...)
20 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 # SOFTWARE.
23 __version__ = '1.1.0'
---> 25 from .prs import Model, Geometry, Control, Result, run
File F:\anaconda\envs\prs\lib\site-packages\pyraysum\prs.py:32
30 from numpy.fft import fft, ifft, fftshift
31 from copy import deepcopy
---> 32 import fraysum
34 from pyraysum plot
35 from pyraysum.frs read_arrivals, read_traces, _phnames
ImportError: DLL load failed while importing fraysum:
When building pyraysum
in python 3.11, a DeprecationWarning is issued:
setup.py:4: DeprecationWarning:
`numpy.distutils` is deprecated since NumPy 1.23.0, as a result
of the deprecation of `distutils` itself. It will be removed for
Python >= 3.12. For older Python versions it will remain present.
It is recommended to use `setuptools < 60.0` for those Python versions.
For more details, see:
https://numpy.org/devdocs/reference/distutils_status_migration.html
setup.py should be migrated following the instructions here: https://numpy.org/devdocs/reference/distutils_status_migration.html
The site mentions:
It is not necessary to migrate immediately - the release date for Python 3.12 is October 2023.
Hi!
I just have two question. How to change the position of the sensor in the program?
Thanks for this amazing package!
I'm encountering an error whenever I set the maxlay
parameter to any number other than 15. Here is a snippet of my Python code:
model = Model(
thickn=[32000, 0], # m; half-space thickness is irrelevant
rho=[2800, 3600], # kg/m^3
vp=[6400, 8100], # m/s
vs=[3600, 4650], # m/s
maxlay=1500, # Neither 5 nor any other values work
)
# Set up Geometry
baz = 0
slow = 0.06
geom = prs.Geometry(baz=baz, slow=slow)
# Set up run parameters
phl = ["1P0P", "1P0P0p0P", "1P0P0p0S", "1P0P0s0S", "1P0S"]
ctrl = prs.Control(
verbose=False,
rot=1,
mults=2,
dt=1 / 100,
npts=5000,
align=0,
)
ctrl.set_phaselist(phl, equivalent=True)
result = prs.run(model, geom, ctrl, rf=True)
Hii, paudetseis.
I am using PyRaysum for synthetic receiver functions study. But I have observed that first P wave at t=0 is not appearing in the impulse response (both in Verical and Radial component) when depth of interface is small (say 25 km). Can you please look into the issue? How to solve the issue?
Thanks.
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!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.