Skip to main content

hashpy

hashpy is SKHASH 1.1.4 by Robert J. Skoumal (U.S. Geological Survey), packaged unchanged except for NumPy 2 support (two lines: size-1 arrays to scalars in mech_probability, np.isin for np.in1d; the numpy<2.0 pin lifted). All nine bundled examples give the same output under NumPy 1.26 and 2.x.

pip install hashpy
hashpy path_to/control_file.txt

It imports as hashpy, so it does not clash with the official SKHASH package; use the original for anything else. Please cite Skoumal, Hardebeck & Shearer (2024). Public domain (CC0), as the original.


SKHASH

Python package for earthquake focal mechanism inversions.

Author: Robert Skoumal, U.S. Geological Survey | rskoumal@usgs.gov

This project contains Python code to compute focal mechanism solutions using first-motion polarities (traditional, consensus, and/or imputed) and S/P ratios (traditional and/or consensus).

How to Use

1. Install the latest release in your virtual environment:

# If you don't want to create beachball plots:
pip install -U SKHASH

# If you do want to create beachball plots:
pip install -U 'SKHASH[plot]'

Python 3.8+ versions are supported.

2. Run SKHASH with your desired control file:

SKHASH path_to/control_file.txt

More information

Running examples

A variety of examples are provided in the repository. It's recommended you play around with these examples to learn about some of the features.

  1. Download the examples folder available HERE.
  2. Unzip the folder.
  3. Navigate to the examples folder you just downloaded, e.g.: cd examples
  4. Run SKHASH with the example of your choice, e.g.: SKHASH hash1/control_file.txt

Manual

Refer to the manual or the wiki for additional information about running the code.

Fortran subroutine (completely optional)

By default, SKHASH will compute mechanisms using the Python routine. However, to speed up the grid search, you can choose to take advantage of an included Fortran subroutine. If the Python C/API wrapper does not already exist, SKHASH will automatically create the wrapper with the user's permission when the Fortran subroutine is used.

To use this Fortran routine, add the following lines to your control file:

$use_fortran
True

A fortran compiler will be needed on the user's machine. If one does not exist, here are some examples on how to get one:

# macOS Homebrew example
brew install gcc

# Ubuntu example
apt install gfortran

If you're using Python 3.12+, the meson and ninja packages are also needed.

pip3 install meson ninja

Note that if you are using macOS and receive an error, you may be missing the Command Line Tools package. To install:

xcode-select --install

Citation

Please cite our paper if you use anything in this project:

  • Skoumal, R.J., Hardebeck, J.L., Shearer, P.M. (2024). SKHASH: A Python package for computing earthquake focal mechanisms. Seismological Research Letters, 95(4), 2519-2526. https://doi.org/10.1785/0220230329

Significant portions of this algorithm are based on HASH:

  • Hardebeck, J.L., & Shearer, P.M. (2002). A new method for determining first-motion focal mechanisms. Bulletin of the Seismological Society of America, 92(6), 2264-2276. https://doi.org/10.1785/0120010200

  • Hardebeck, J.L., & Shearer, P.M. (2003). Using S/P amplitude ratios to constrain the focal mechanisms of small earthquakes. Bulletin of the Seismological Society of America, 93(6), 2434-2444. https://doi.org/10.1785/0120020236

License and Disclaimer

License: This project is in the public domain.

Disclaimer: This software is preliminary or provisional and is subject to revision.

Metadata

Release files for hashpy 1.1.4.post1

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

Source distribution (sdist)

Source distribution for hashpy 1.1.4.post1
File Size Uploaded Provenance Actions
hashpy-1.1.4.post1.tar.gz 59.0 kB Without provenance Details for hashpy-1.1.4.post1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hashpy 1.1.4.post1
File Interpreter ABI Platform Actions
hashpy-1.1.4.post1-py3-none-any.whl Python 3 none any Details for hashpy-1.1.4.post1-py3-none-any.whl

Total release size: 123.8 kB

Release files / hashpy-1.1.4.post1.tar.gz

Download URL hashpy-1.1.4.post1.tar.gz
Size 59.0 kB
Tags Source
SHA-256 checksum
How to use checksums
267ba6af889463d44d2118dd82a0fc33e091a108a0cd0c88a2449f4d964ab772
BLAKE2b-256 checksum
How to use checksums
8f1f2c7edbb4ce713795d9d544dd25a58c15231a23c25589da5ee93727191b0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","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}

Release files / hashpy-1.1.4.post1-py3-none-any.whl

Download URL hashpy-1.1.4.post1-py3-none-any.whl
Size 64.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
230258b8b4638b996b78e762d8e8941b242c0dc92df7e9c3c212b545cf153937
BLAKE2b-256 checksum
How to use checksums
ac7dec81fcd0a44a54b9e93863b1eca8c5d399e53fe89c37bf0e5194c2d9f841
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","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}

Security for hashpy 1.1.4.post1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release
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