Git Product home page Git Product logo

hypoddpy's Introduction

hypoDDpy


This is largely unmaintained and I personally have not been using it for many years. But people keep using it and I am happy to accept pull requests. If anyone wants to take over maintenance please send me an email!


This a collection of tools to run HypoDD by Felix Waldhauser.

It takes event files in the QuakeML format, station data in the SEED format and waveform data in any format ObsPy can read and does all the rest.

The output is one QuakeML file with the relocated events having one additional Origin node. The events that could not be relocated will not be changed.

Flowchart 1

Did It Help You in Your Research?

If yes, consider citing this software! Just click on this button here to get all the required information:

DOI

Possible Improvements

  • Deal with stations below sea level:
    • Adjust events up and down before/after hypoDD ran to correspond to station shift.
    • Adjust model up to correspond to station shift.
  • Make hypoDD_relocator more configurable:
    • All parameters in ph2dt.inp
    • All parameters in hypoDD.inp
    • All adjustments to hypoDD.inc (parameters for compilation)

Requirements

  • Python 3.6+
  • NumPy
  • matplotlib
  • progressbar
  • ObsPy (Tested on 1.2.0)

Installation

hypoDDpy currently works with HypoDD 2.1b which you will have to acquire separately from Felix Waldhauser.

Put the archive here:

hypoddpy/src/HYPODD_2.1b.tar.gz

The src directory will likely not exist.

Then run either of the following two commands, depending on which Python module installer you prefer:

pip install -v -e .
python setup.py develop

The in-place install is a good idea because there is a chance that you will have to adjust the source code.

Running it

It is steered via a Python script that you will have to create. It should be rather self-explanatory.

After you created it, simply run it to perform the relocation.

import glob
from hypoddpy import HypoDDRelocator


# Init the relocator with the working directory and some necessary
# configuration values.
#
# The working dir is where all the working files and some output files will be
# stored.
# All the other attributes are related to the cross correlation and should be
# self-explanatory.
relocator = HypoDDRelocator(working_dir="relocator_working_dir",
    cc_time_before=0.05,
    cc_time_after=0.2,
    cc_maxlag=0.1,
    cc_filter_min_freq=1.0,
    cc_filter_max_freq=20.0,
    cc_p_phase_weighting={"Z": 1.0},
    cc_s_phase_weighting={"Z": 1.0, "E": 1.0, "N": 1.0},
    cc_min_allowed_cross_corr_coeff=0.4)

# Add the necessary files. Call a function multiple times if necessary.
relocator.add_event_files(glob.glob("events/*.xml"))
relocator.add_waveform_files(glob.glob("waveform/*.mseed"))
relocator.add_station_files(glob.glob("station/*.xml"))

# Setup the velocity model. This is just a constant velocity model.
relocator.setup_velocity_model(
    model_type="layered_p_velocity_with_constant_vp_vs_ratio",
    layer_tops=[(-10000, 5.8)],
    vp_vs_ratio=1.73)

# Start the relocation with the desired output file.
relocator.start_relocation(output_event_file="relocated_events.xml")

hypoddpy's People

Contributors

jwjeremy avatar krischer avatar megies avatar ogalanis avatar qingkaikong avatar waynecrawford avatar

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.