GithubHelp home page GithubHelp logo

shakemap-amp-tools's Introduction

Status

Note: any general purpose ground motion processing functionality that was in this repository is being moved to the groundmotion-processing repository so that this repository will only conctain shakemap-specific methods.

Build Status

codecov

Codacy Badge

shakemap-amp-tools

Fetch, read, and process ground motion amplitude data.

Introduction

shakemap-amp-tools is a project designed to provide a number of functions ancillary to the ShakeMap project, mostly those having to do with finding and parsing strong ground motion data and converting it into the XML data format used by ShakeMap. This repository includes the following tools:

  • amps2xml Convert peak ground motions in Excel format to ShakeMap XML data structure.
  • sm2xml Convert a directory of strong motion data files into ShakeMap xml.

Installing

If you already have a miniconda or anaconda Python 3.5 environment:

For conda package:

  • conda install amptools

Source code:

  • git clone https://github.com/usgs/shakemap-amp-tools.git
  • cd shakemap-amp-tools
  • bash intall.sh
  • conda activate amptools

Tools

sm2xml

This tool converts a directory of ground motion time series data into an xml file formatted for ShakeMap. The input file must be in a format supported by thegroundmotion-processing.

amps2xml

This tool converts an excel file of peak ground motion data into an xml file formatted for use by ShakeMap. Excel spreadsheets must contain only tabular (rows/columns) data.

A "complete" peak ground motion spreadsheet would look like this:

reference Mexican National Seismic Service report dated 2010-01-01
station NAME NETID SOURCE LAT LON ELEV DISTANCE INTENSITY H1 H2 Z
PGA PGV SA(0.3) SA(1.0) SA(3.0) PGA PGV SA(0.3) SA(1.0) SA(3.0) PGA PGV SA(0.3) SA(1.0) SA(3.0)
ACAM Guanajuato MX National Seismic Service 20.043186 -100.716777 5.1 913.1 0.72 4.48 1.31 5.12 7.74 2.93 4.928 1.44 5.632 8.514 3.223 4.256 1.24 4.864 7.353 2.784

A minimum intensity only peak ground motion table would look like this:

referenceJones and Smith, 2007. Journal of Seismology.
station lat lon network intensity
ABC 20.123 -118.123 MX 4.5

A minimum pga only peak ground motion table would look like this:

referenceJones and Smith, 2007. Journal of Seismology.
station lat lon network unk
pga
ABC 20.123 -118.123 MX 0.5

Spreadsheet Requirements

The reference section in the first row is mandatory, and should consist of a cell in the first column with "reference" in it, and the cell in the second column containing the reference string.

The required columns are:

  • station: Usually a short abbreviated code.
  • lat: Latitude of the station where data was collected.
  • lon: Longitude of the station where data was collected.
  • network: Usually a short code indicating the seismic network who collected the data.

In addition to these required columns, there must be additionally at least:

  • intensity: Modified Mercalli Intensity (MMI) at the station location.

AND/OR:

  • channel (more on this below), containing at least one of the following:
    • pga: Peak Ground Acceleration, in units of %g.
    • pgv: Peak Ground Velocity, in units of cm/s.
    • psa03: Peak Spectral Acceleration at 0.3 seconds, in units of %g.
    • psa10: Peak Spectral Acceleration at 1.0 seconds, in units of %g.
    • psa30: Peak Spectral Acceleration at 3.0 seconds, in units of %g.

The channel columns can be one of three different naming schemes:

  • XXE, XXN, XXZ: Three channels named according to the scheme found at http://www.fdsn.org/seed_manual/SEEDManual_V2.4_Appendix-A.pdf where XXE/XXN are horizontal channels, and XXZ is the vertical channels.
  • H1, H2, Z: Three channels where the direction of the channel is not known, where H1/H2 are horizontal channels and Z is the vertical channel.
  • UNK: The "channel" to use when only summary peak ground motion values are known.

For the "XXE/XXN/XXZ" or "H1/H2/Z" naming schemes, at least one of the horizontal channels must be included.

Links to example spreadsheets:

shakemap-amp-tools's People

Contributors

cbworden avatar emthompson-usgs avatar hschovanec-usgs avatar jrekoske-usgs avatar mhearne-usgs avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shakemap-amp-tools's Issues

Implement smconvert

The purpose of this routine is supposed to be something that allows a user to convert data from one of the amptools supported formats (KNET, GeoNet, etc.) into anything ObsPy supports. We may also write (some) writers for these formats, in particular Cosmos V2, since that seems to be the format used by PRISM.

Add constants.py module

Containing:

  • time format for datetime strings in JSON (%Y-%m-%dT%H:%M:%S.%f')
  • time format for output miniseed/json files (%Y%m%d%H%M%S')
  • default config dictionary

and any other constants we can think of.

Make default values configurable

This applies to amptools.stream. The IMTs returned (specifically the periods for spectral amplitudes) should be configurable.

Signal-to-noise ratio

Be sure that the code is aware that the what we sometimes call the "signal" window is actually "signal and noise" window or the "total" window. So the signal to noise ratio is actually calculated as

(total - noise)/noise

Discuss list of IMCs

If I run sm2xml on a station with channels H1,H2, and Z, I get Z and H2 back as components. For that tool, we actually don't want greater of two horizontals, as ShakeMap figures that out for itself.

Create a global read() method

Create a read() or read_data() method that imports all reader modules and calls the is_X() method until it finds a match. Raise an exception on failure.

Default corner frequencies

If the signal to noise ratio tests fail, we should reject the record rather than use the default corner frequencies.

Refactor io/obspy/core.py/read_obspy() to use a new function

This new function should read obspy data file and json file and return a stream and dictionary.

read_obspy() then does intelligent things with dictionary to put into stream, then only returns stream.

Other methods (in smdb) can call the lower level function and do more stuff with the data found in dictionary.

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.