Skip to main content

A PREMlike model

Project description

premlike

This is a python module and some example notebooks to work with PREM, a famous 1D model of the Earth's interior published by Dziewonski and Anderson in 1981. The module was initially created to allow the Deep Earth Research Group at Leeds the University of Leeds to run a summer project to look at the structure of the core but the code has subsequently been used for a number of other research projects.

Features and limitations

Premlike allows the creation and evaluation of models that are "like" PREM in terms of their parameterization. That is, the P- and S-wave velocity, density and attenuation are described by piecewise polynomials. The module allows the calculation of the corresponding acceleration due to gravity, pressure, frequency dependent velocities and elastic moduli as a function of radius. These calculations are analytic (i.e. there is no numerical integration in the calculation of pressure). The module can easily be used to generate input for Obspy's TauPy module for the calculation of travel times, and for Mineos for the calculation of e.g. normal mode center frequencies.

Currently, Premlike does not support radial anisotropy although adding this is planned (however, note that TauPy does not currently support such models either). In addition, the creation of complete documentation and a more robust set of tests is ongoing.

Installation and use

This module relies on python (version 3) and Numpy. The software can be installed with pip install premlike

Examples are distributed as Jupyter notebooks, which need Jupyter and Matplotlib to run. Calculation of travel time curves (in the third example notebook) needs Obspy.

Experienced users of git who want to contribute to the code may want to fork this repository in github and clone from their fork.

Mineos

In order to compute normal mode frequencies, we use mineos. I installed this as follows (working outside the prem4derg directory):

wget http://geoweb.cse.ucdavis.edu/cig/software/mineos/mineos-1.0.2.tgz
mkdir cig
tar -xzvf mineos-1.0.2.tgz
cd mineos-1.0.2
./configure --prefix=/Users/andreww/Code/cig

Edit the Makefile to add: -Wno-error -Wno-return-type to the CFLAGS because the C contains errors. Add -fallow-argument-mismatch to FFLAGS because the Fortran contains errors.

make 
make install

Examples of use

Example Jupyter notebooks can be accessed and explored by running jupyter notebook. Four examples are currently provided:

  • A density example, showing how a model can be defined and used to calculate mass, moment of inertia, gravity and pressure.
  • A velocity example, showing how a model can be defined and used to calculate seismic velocities as a function of depth and period.
  • A travel time example, showing how an obspy taupy model can be created and used to compute travel time curves.
  • A normal modes example, showing how Mineos can be used to compute normal mode frequencies.

These examples are only starting point. For example, the code could be used to fit new models.

Development and support

Premlike is software under development, bugs and rough edges may abound. Users who are interested in changing the code are encouraged to create a fork on GitHub and submit changes via pull requests. Problems can be reported via issues, which also list areas where further development may be useful.

References

Dziewonski, A. M. and Anderson, D. L. (1981) Preliminary reference Earth model Physics of the Earth and Planetary Interiors vol.25 pp.297—356.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

premlike-0.1.0a1.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

premlike-0.1.0a1-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file premlike-0.1.0a1.tar.gz.

File metadata

  • Download URL: premlike-0.1.0a1.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for premlike-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 9cf89532637142010046a19b1b99844518333d5c1fab4858c076641f9e906663
MD5 004e74cf08358aea44c0d64b811e93ac
BLAKE2b-256 b57861123f4d227808a5dcaac34ab7a4af210cf08e9585ddaabb7b52f5956b57

See more details on using hashes here.

File details

Details for the file premlike-0.1.0a1-py3-none-any.whl.

File metadata

  • Download URL: premlike-0.1.0a1-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for premlike-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 55e81f6ebe1fced789794d9d0c24a3efd39f6fcd21256657521c3796e5ed8972
MD5 d618ca9b975549e7e6565f122bdcf352
BLAKE2b-256 480ddd75fb42c029c7d1161bafe5580e11b02801de291762a21176b3155fe833

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page