Skip to content
Snippets Groups Projects
Select Git revision
  • 2ff17fd7b6b2255707c06866964a00147315996c
  • main default protected
  • multi-gitter-gfz-name-repl
  • multi-gitter-branch
  • enhancement/revise_global_weights
  • enhacement/try_davids_approach
  • v0.10.3
  • v0.10.2
  • v0.10.1
  • v0.10.0
  • v0.9.3
  • v0.9.2
  • v0.9.1
  • v0.9.0
  • v0.8.2
  • v0.8.1
  • v0.8.0
  • v0.7.0
  • v0.6.9
  • v0.6.8
  • v0.6.7
  • v0.6.6
  • v0.6.5
  • v0.6.4
  • v0.6.3
  • v0.6.2
26 results

spechomo

eGSIM Shakemap Service

The eGSIM shakemap is comprised of a backend service (api.py) and a front end response site (front-end).

Docker

You can run the shakemap service in a docker container:

docker-compose build
docker-compose up

Note, that the front-end is not yet integrated in the docker-compose.yml. The service exposes port 8082.

Dependencies

apt install gmt libhdf5-dev pkg-config postgresql
pip3 install -r requirements.txt

vs30 model available at USGS. Export an environment variable VS30PATH pointing to that file. Shortcut: wget https://earthquake.usgs.gov/static/lfs/data/global_vs30_grd.zip

Furthermore, npm is required for the front-end, as well as the vue command line client. Install the latter with

npm install -g @vue/cli@latest

Start services manually

Spawning the service at port 8082:

python3 src/api.py

Starting the front end:

cd front-end/shakemap
npm install    # This needs to be done just once or if new dependencies were added
npm run serve

Starting the API documentation:

cd front-end/api_documentation
git clone https://github.com/swagger-api/swagger-node
npm start

Go to open http://localhost:8081/docs

API

Either post request QuakeML formatted strings or use get requests on endpoint /shakemap.

You can manually query the api with e.g. curl pointing a quakeml against the API:

curl -X POST -H "Content-Type: application/json" -d @coquimbo.quakeml http://localhost:8082/shakemap\?gmpe=BindiEtAl2014Rjb\&imt\=PGA