Skip to content

sean0921/simplemeca-flask

Folders and files

NameName
Last commit message
Last commit date
Aug 26, 2022
May 17, 2022
Apr 5, 2022
May 2, 2024
May 17, 2022
Aug 26, 2022
Jan 7, 2022
Sep 14, 2022
Nov 3, 2023
Aug 26, 2022
Aug 26, 2022
Jul 24, 2024
Jul 24, 2024

Repository files navigation

Simple Focal Mechanism Generator based on PyGMT

Requirements

  • see pyproject.toml

Create Virtual Environment

  • make init

Run the Web Application

  • make run

Try the Web Application

Method

  • URL: POST /simplemeca

  • Header:

    Key Value Required
    Content-Type application/json Required
  • Body Json Parameters: (All Required)

    • strike
      float
    • dip
      float
    • rake
      float
    • color_r
      float
      R in RGB colors
    • color_g
      float
      G in RGB colors
    • color_b
      float
      B in RGB colors
    • title
      string
  • Response

{'image_url': 'http://127.0.0.1:5000/static/<sha256-format>.png'}

Examples

  • example_payload.json

TODO

#X Y depth mrr mtt mff mrt mrf mtf exp newX newY title
gmt meca -Rg -JN15c -Sm2c -png << EOF
-176.96 -29.25 47.8 7.680 0.090 -7.770 1.390 4.520 -3.260 26 0 0 title
EOF

Known Issues

  • Ghostscript does not support webp output, so only consider png or jpg format.
  • GMT 5/6 (PyGMT) realtime performance is worser than legacy GMT 4.x: GenericMappingTools/gmt#587

Credit

Resources