Skip to content

Commit

Permalink
Add new module under "seis" to read seismicity files stored with the …
Browse files Browse the repository at this point in the history
…ISF format (#8552)

* Add new module under "seis" to read seismicity files stored with the ISF format

* Missed calling GMT_End_IO() and that was why it was not working from Julia.

* Fix bug in the date filter.

* One more fix to the date filter.
  • Loading branch information
joa-quim authored Jul 26, 2024
1 parent beefd18 commit 586699f
Show file tree
Hide file tree
Showing 9 changed files with 2,691 additions and 1 deletion.
4 changes: 4 additions & 0 deletions doc/rst/source/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ All modules are requested via a call to the :doc:`gmt` program.
supplements/seis/meca
supplements/seis/polar
supplements/seis/sac
supplements/seis/gmtisf
supplements/seis/grdshake
supplements/seis/grdvs30
supplements/spotter/backtracker
Expand Down Expand Up @@ -337,6 +338,7 @@ Supplemental Modules
- :doc:`/supplements/segy/segyz`
- :doc:`/supplements/seis/coupe`
- :doc:`/supplements/seis/meca`
- :doc:`/supplements/seis/gmtisf`
- :doc:`/supplements/seis/polar`
- :doc:`/supplements/seis/sac`
- :doc:`/supplements/spotter/backtracker`
Expand Down Expand Up @@ -749,6 +751,8 @@ seis
+-----------------------------------+--------------------+
| :doc:`/supplements/seis/sac` | |sac_purpose| |
+-----------------------------------+--------------------+
| :doc:`/supplements/seis/gmtisf` | |gmtisf_purpose| |
+-----------------------------------+--------------------+
| :doc:`/supplements/seis/grdshake` | |grdshake_purpose| |
+-----------------------------------+--------------------+
| :doc:`/supplements/seis/grdvs30` | |grdvs30_purpose| |
Expand Down
1 change: 1 addition & 0 deletions doc/rst/source/reference/supplemental-packages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ This package contains the programs
:doc:`meca </supplements/seis/meca>`,
:doc:`polar </supplements/seis/polar>`,
:doc:`sac </supplements/seis/sac>`,
:doc:`sac </supplements/seis/gmtisf>`,
:doc:`grdvs30 </supplements/seis/grdvs30>`, and
:doc:`grdshake </supplements/seis/grdshake>`, which are used by seismologists
for plotting focal mechanisms (including cross-sections
Expand Down
2 changes: 2 additions & 0 deletions doc/rst/source/supplements/module_supplements_purpose.rst_
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@

.. |pssac_purpose| replace:: Plot seismograms in SAC format

.. |gmtisf_purpose| replace:: Read seismicity data in the ISF formated file

.. |backtracker_purpose| replace:: Generate forward and backward flowlines and hotspot tracks

.. |gmtpmodeler_purpose| replace:: Evaluate a plate motion model at given locations
Expand Down
102 changes: 102 additions & 0 deletions doc/rst/source/supplements/seis/gmtisf.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
.. index:: ! gmtisf
.. include:: ../module_supplements_purpose.rst_

******
gmtisf
******

|gmtisf_purpose|

Synopsis
--------

.. include:: ../../common_SYN_OPTs.rst_

**gmt gmtisf** *ISFfile*
|SYN_OPT-R|
[ |-D|\ *date_start*\ [/*date_end*] ]
[ |-F|\ [**a**] ]
[ |-N| ]
[ |SYN_OPT--| ]

Description
-----------

Reads seismicity data from an ISC (https://www.isc.ac.uk/iscbulletin) formated *file.isc* and output [lon lat depth mag ...]
to standard output.

Optional Arguments
------------------

.. _-R:

.. |Add_-Rgeo| replace:: |Add_-R_auto_table|
.. include:: ../../explain_-Rgeo.rst_

.. _-D:

**-D**\ *date_start*\ [/*date_end*]
Limit the output locations to data hose date is >= date1, or between date1 and date2. <date> must be in ISO format, e.g, 2000-04-25"

.. _-F:

**-F**\ [*a*]
Select only events that have focal mechanisms. The default is output in Global CMT convention. Append 'a' for the AKI convention.

Focal mechanisms in Global CMT convention.

**1**,\ **2**:
longitude, latitude of event (**-:** option interchanges order)

**3**:
depth of event in kilometers

**4**,\ **5**,\ **6**:
strike, dip, and rake of plane 1

**7**,\ **8**,\ **9**:
strike, dip, and rake of plane 2

**10**,\ **11**:
mantissa and exponent of moment in dyne-cm


Focal mechanisms in Aki and Richards convention.

**1**,\ **2**:
longitude, latitude of event (**-:** option interchanges order)

**3**:
depth of event in kilometers

**4**,\ **5**,\ **6**:
strike, dip and rake in degrees

**7**:
magnitude

.. _-N:

**-N**
The default is to output time information [year month day hour minute] as the last 5 columns.
Use this option to skip those last 5 columns.

Examples
--------

Extract the `lon lat depth mag` seismicity from file `file.isf` obtained at (https://www.isc.ac.uk/iscbulletin/)
and limiting over a geographic region and a date interval::

gmt isf file.isf -R-15/0/30/45 -D2001-01-01/2005-12-31 -N > seismicity.dat

The above command can be piped directly to `psxy` to create a seismicity map. _e.,g._::

gmt isf file.isf -R-15/0/30/45 -D2001-01-01/2005-12-31 -N | gmt psxy -R -JM14c -Sc0.01 -Gblack -Ba -P > seis.ps

See Also
--------

:doc:`psmeca`,
:doc:`pspolar`,
:doc:`pscoupe`,
:doc:`gmt </gmt>`, :doc:`psbasemap </psbasemap>`, :doc:`psxy </psxy>`
2 changes: 1 addition & 1 deletion src/seis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
set (SUPPL_NAME seis)
set (SUPPL_HEADERS meca.h meca_symbol.h utilmeca.h seis_defaults.h sacio.h)
AUX_SOURCE_DIRECTORY (longopt SUPPL_LONG_OPT_H)
set (SUPPL_PROGS_SRCS psmeca.c pspolar.c pscoupe.c pssac.c grdshake.c grdvs30.c ${SUPPL_LONG_OPT_H})
set (SUPPL_PROGS_SRCS psmeca.c pspolar.c pscoupe.c pssac.c grdshake.c grdvs30.c gmtisf.c ${SUPPL_LONG_OPT_H})
set (SUPPL_LIB_SRCS ${SUPPL_PROGS_SRCS} utilmeca.c sacio.c)
set (SUPPL_EXAMPLE_FILES README.seis)
Loading

0 comments on commit 586699f

Please sign in to comment.