Code Monkey home page Code Monkey logo

pyraysum's People

Contributors

paudetseis avatar wasjabloch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pyraysum's Issues

how to compute epicentral distance

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.

PyRaysum does not handle evanescent waves

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?

Things to do for PyRaysum

  • Remove un-necessary Fortran IO - deep clean up
  • Put all prs run-time arguments in trace headers
  • Optimize wiggle module
  • Prepare proper Jupiter notebooks
  • Add tests
  • Add more examples in module API
  • Add more examples of usage in documentation
  • Make public and setup Travis and Code-coverage
  • Add module to deal with arbitrary elastic tensors

Compiling params.h with new parameters

Hi @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.

Error AttributeError: module 'fraysum' has no attribute 'run_full'

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.

Computations taking infinite time for some velocity models

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



Error: ImportError: DLL load failed while importing fraysum: The specified module could not be found.

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!

run_frs(): segmentation fault / infinite runtime / ERROR in evec_check

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)

Plotting

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.

DLL load failed while importing fraysum

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:

distutils DeprecationWarning

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.

Quick question

Hi!
I just have two question. How to change the position of the sensor in the program?

  1. In the attached picture it is at 0 km. Would it be possible to change to order coordinate? For example -60?
  2. In this Class --- >pyraysum.prs.Geometry(baz, slow, dn=0, de=0, maxtr=500). We have dn and de. What does it mean exactly dn and de? the North and East epicentral distance from source to receiver?

question

Thanks for this amazing package!

ValueError: failed in converting 1st argument `thick' of fraysum.run_full to C/Fortran array

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)

No P wave arrival

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.

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

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.