This is a simple package for working with USGS shakemaps to download them and get the intensity and damage potential at a given set of locations
pip install --user -e .
To download the example shakemap (Hawaii earthquake) to your downloads folder:
cd tests/example_download
find_and_download_shakemap.py -i example_search_params.yaml -o ./
Running the script should do the following:
- Search for an earthquake on the USGS server according to the parameters in the
search_params.yaml
file. - Prompt you to check which of the candidate earthquakes you want.
- Search for any ShakeMaps associated with the selected earthquake.
- Prompt you to check which Shakemap you want to download.
- Download the intensity grid and associated uncertainty grid in xml.zip format.
You might have issues if accessing the web via proxy.
To lookup the shakemap intensity from a downloaded shakemap for a set of coordinates
cd tests/example_lookup
shakemap_lookup.py -i Hawaii_Mile_Markers_v2.csv --intensity_measure 'MMI' \
-s ../example_download/grid_70116556_v01.0.xml \
-u ../example_download/uncertainty_70116556_v01.0.xml
Look up shakemap at a set of coordinates and combine with a fragility function to estimate the probability of damage at each location.
cd tests/example_damage_est
shakemap_estimate_damage.py -i Hawaii_Mile_Markers_v2.csv --fragility_file 'my_fragility.csv' \
-s ../example_download/grid_70116556_v01.0.xml \
-u ../example_download/uncertainty_70116556_v01.0.xml
For the lat lon search parameters, the following has a list of bounding box per country (with some issues highlighted in the comments below).
https://gist.github.com/graydon/11198540
- TODO