Skip to main content

The TauP Toolkit, via Python

Project description

taup_python

Access to the TauP Toolkit from Python via an HTTP server.

The problem is that lots of seismologists like writing Python scripts, but calling a Java library from Python seems somewhere between hard and impossible. But interaction doesn't require direct interoperation. The basic idea of this solution (or bandaid) is that this python library will spin up an instance of taup web, and then use that to answer many queries via http, avoiding the startup time of Java.

You will also need to have an instance of the TauP Toolkit installed. This can be done manually by downloading from Zenodo or from Homebrew via

brew tap crotwell/crotwell
brew install taup

The Python classes representing each tool's query parameters are based off off the command line arguments of the same name. For example, this Python code:

with taup.TauPServer() as timeserver:
    timeParams = taup.TimeQuery()
    timeParams.phase(["P", "S"])
    timeParams.model('ak135')
    timeParams.degree(35)
    results = timeParams.calc(timeserver)

roughly corresponds to this command line:

bin/taup time --ph P,S --mod ak135 --deg 35 --json

Note that if you have many calculations in a loop, you want to have the loop on the inside of the with taup.TauPServer() as timeserver: line so that the server is only started up once.

See example_times.py and example_text.py in the examples directory for a couple of more detailed examples.

Documentation available at readthedocs for TauP_python

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

taup-0.1.1.tar.gz (47.5 kB view details)

Uploaded Source

Built Distribution

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

taup-0.1.1-py3-none-any.whl (59.0 kB view details)

Uploaded Python 3

File details

Details for the file taup-0.1.1.tar.gz.

File metadata

  • Download URL: taup-0.1.1.tar.gz
  • Upload date:
  • Size: 47.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for taup-0.1.1.tar.gz
Algorithm Hash digest
SHA256 fe06a6ebb0706852b71f86cdb020b4ed30c10fc918b39c59b1a735eea29179ef
MD5 7e17d304c129131c0d34ff0be4cf80ee
BLAKE2b-256 871602c359ff8c4eb3fcd0321d168988da2a93a86e5be529eae5edec10d63301

See more details on using hashes here.

File details

Details for the file taup-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: taup-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 59.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for taup-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 37571e30f185e3035dd3559b6f09745b3bdef8b6ad6e4fb8e4dd996b5855093d
MD5 ea46230f189013d8dfe1fae37c34a204
BLAKE2b-256 16f54d210dc636784b6e2f6eab54a6541d4d3a0b875407af9371007e4985828c

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