Giter Club home page Giter Club logo

pystp's Introduction

PySTP

PySTP is a Python module for connecting to STP (Seismogram Transfer Program) servers and downloading event metadata, phase picks, and waveforms triggered by seismic events.

PySTP requires ObsPy.

Installation

Clone the PySTP repository:

git clone https://github.com/SCEDC/pystp.git

Navigate to the pystp directory and run pip install . to install the pystp module in your Python environment's path.

cd pystp
pip install .

Basic STPClient Functions

get_events - Downloads an ObsPy catalog either by event IDs or by search parameters of time window, magnitude range, and location boundaries.

get_phases - Downloads an ObsPy catalog containing phase picks.

get_trig - Downloads waveforms for one or events as a Python dictionary with event IDs as keys and ObsPy Stream objects as values.

Usage Example

from pystp import STPClient

client = STPClient()
client.connect()   # Open a connection.

# Download a catalog.
events = client.get_events(times=[datetime.datetime(2019, 10, 17), datetime.datetime(2019, 10, 17, 23, 59, 59)], mags=[2, 4])
# Get event IDs.
evids = [ev.resource_id.id for ev in events]
# Download all CI.CLC.BH waveforms for the events in the catalog.
waveforms = client.get_trig(evids, net='CI', sta='CLC', chan= 'BH_')

# Disconnect from the STP server.
client.disconnect()

Tutorials

Downloading waveforms

Downloading events and picks

Links

STP

ObsPy

pystp's People

Contributors

shang-lin avatar

Watchers

James Cloos 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.