Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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.

Metadata

Release files for premlike 0.1.0a3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for premlike 0.1.0a3
File Size Uploaded Provenance Actions
premlike-0.1.0a3.tar.gz 18.7 kB With provenance Details for premlike-0.1.0a3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for premlike 0.1.0a3
File Interpreter ABI Platform Actions
premlike-0.1.0a3-py3-none-any.whl Python 3 none any Details for premlike-0.1.0a3-py3-none-any.whl

Total release size: 32.8 kB

Release files / premlike-0.1.0a3.tar.gz

Download URL premlike-0.1.0a3.tar.gz
Size 18.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9a6fb4677d068d2e76560079e9065e68db7f696dc6972cc61f6e169ce0858e29
BLAKE2b-256 checksum
How to use checksums
ca33aa7e0cc0b0af36d30d6529b064b287835706f59b2375fd8a48dc7788957a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Release files / premlike-0.1.0a3-py3-none-any.whl

Download URL premlike-0.1.0a3-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
010dd410b3a5e9400e19bb5d752fb13ec890e2abb861463e101dff466e9a9952
BLAKE2b-256 checksum
How to use checksums
3d390f3ab00658dc76b5008a10cd2793bc5a9edff334a746acc401172fda213a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Security for premlike 0.1.0a3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for premlike-0.1.0a3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page