Skip to content

Commit

Permalink
Merge branch 'master' into gmt-gsfml
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulWessel committed Dec 3, 2023
2 parents 17d5051 + 7825ff4 commit db9d445
Show file tree
Hide file tree
Showing 12 changed files with 1,097 additions and 18 deletions.
10 changes: 10 additions & 0 deletions admin/add_windows_cpack.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,13 @@ if (GMTMEX_PATH)
DESTINATION ${GMT_BINDIR}
COMPONENT Runtime)
endif (GMTMEX_PATH)

install (PROGRAMS
${VCRUNTIME_PATH}/vcruntime140.dll
${VCRUNTIME_PATH}/vcruntime140_1.dll
${VCRUNTIME_PATH}/msvcp140.dll
${VCRUNTIME_PATH}/msvcp140_1.dll
${VCRUNTIME_PATH}/msvcp140_2.dll
${VCRUNTIME_PATH}/msvcp140_codecvt_ids.dll
DESTINATION ${GMT_BINDIR}
COMPONENT Runtime)
4 changes: 4 additions & 0 deletions doc/rst/source/modules-classic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,10 @@ seis
+----------------------------------+--------------------+
| :doc:`/supplements/seis/pssac` | |pssac_purpose| |
+----------------------------------+--------------------+
| :doc:`/supplements/seis/shake` | |shake_purpose| |
+--------------------------------+----------------------+
| :doc:`/supplements/seis/vs30` | |vs30_purpose| |
+--------------------------------+----------------------+

spotter
-------
Expand Down
6 changes: 6 additions & 0 deletions doc/rst/source/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ All modules are requested via a call to the :doc:`gmt` program.
supplements/seis/meca
supplements/seis/polar
supplements/seis/sac
supplements/seis/shake
supplements/seis/vs30
supplements/spotter/backtracker
supplements/spotter/gmtpmodeler
supplements/spotter/grdpmodeler
Expand Down Expand Up @@ -747,6 +749,10 @@ seis
+--------------------------------+------------------+
| :doc:`/supplements/seis/sac` | |sac_purpose| |
+--------------------------------+------------------+
| :doc:`/supplements/seis/shake` | |shake_purpose| |
+--------------------------------+------------------+
| :doc:`/supplements/seis/vs30` | |vs30_purpose| |
+--------------------------------+------------------+

spotter
-------
Expand Down
8 changes: 7 additions & 1 deletion doc/rst/source/project.rst
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,13 @@ Optional Arguments

.. include:: explain_colon.rst_

.. include:: explain_distunits.rst_
Units
-----

For map distance unit, append *unit* **d** for arc degree, **m** for arc minute, and **s** for arc second,
or **e** for meter [Default unless stated otherwise], **f** for foot, **k** for km, **M** for statute mile,
**n** for nautical mile, and **u** for US survey foot. We compute such distances using a spherical
approximation with great circles using the authalic radius (see PROJ_MEAN_RADIUS).

.. include:: explain_help.rst_

Expand Down
8 changes: 5 additions & 3 deletions doc/rst/source/reference/supplemental-packages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,12 @@ seis: Seismology
This package contains the programs
:doc:`coupe </supplements/seis/coupe>`,
:doc:`meca </supplements/seis/meca>`,
:doc:`polar </supplements/seis/polar>`, and
:doc:`sac </supplements/seis/sac>` which are used by seismologists
:doc:`polar </supplements/seis/polar>`,
:doc:`sac </supplements/seis/sac>`,
:doc:`sac </supplements/seis/vs30>`, and
:doc:`sac </supplements/seis/shake>`, which are used by seismologists
for plotting focal mechanisms (including cross-sections
and polarities) and SAC files.
and polarities), compute Vs30 velocities, intensity maps and SAC files.
The coupe, meca, and polar were developed by Kurt Feigl and Genevieve
Patau, while Dongdong Tian added sac; the package is now maintained by the GMT team.

Expand Down
8 changes: 2 additions & 6 deletions doc/rst/source/supplements/module_supplements_purpose.rst_
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

.. |img2grd_purpose| replace:: Extract a subset from an img file in Mercator or Geographic format

.. |terrain_filter_purpose| replace:: Callable function to do image texture

.. |mgd77convert_purpose| replace:: Convert MGD77 data to other formats

.. |mgd77header_purpose| replace:: Create MGD77 headers from A77 files
Expand Down Expand Up @@ -104,11 +102,9 @@

.. |rotsmoother_purpose| replace:: Get mean rotations and covariance matrices from set of finite rotations

.. |grdbarb_purpose| replace:: Plot wind barb field from two component grids

.. |barb_purpose| replace:: Plot wind barbs in 2-D and 3-D
.. |shake_purpose| replace:: Compute Peak Ground Acceleration/Velocity and Intensity

.. |psbarb_purpose| replace:: Plot wind barbs in 2-D and 3-D
.. |vs30_purpose| replace:: Convert topographic slope to Vs30 velocities

.. |x2sys_binlist_purpose| replace:: Create bin index listing from track data files

Expand Down
23 changes: 16 additions & 7 deletions src/gmt_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -9268,13 +9268,22 @@ void gmt_ECEF_inverse (struct GMT_CTRL *GMT, double in[], double out[]) {
for (i = 0; i < 3; i++) in_p[i] = in[i] - GMT->current.proj.datum.from.xyz[i];

p = hypot (in_p[GMT_X], in_p[GMT_Y]);
theta = atan (in_p[GMT_Z] * GMT->current.proj.datum.from.a / (p * GMT->current.proj.datum.from.b));
sincos (theta, &sin_theta, &cos_theta);
out[GMT_X] = d_atan2d (in_p[GMT_Y], in_p[GMT_X]);
out[GMT_Y] = atand ((in_p[GMT_Z] + GMT->current.proj.datum.from.ep_squared * GMT->current.proj.datum.from.b * pow (sin_theta, 3.0)) / (p - GMT->current.proj.datum.from.e_squared * GMT->current.proj.datum.from.a * pow (cos_theta, 3.0)));
sincosd (out[GMT_Y], &sin_lat, &cos_lat);
N = GMT->current.proj.datum.from.a / sqrt (1.0 - GMT->current.proj.datum.from.e_squared * sin_lat * sin_lat);
out[GMT_Z] = (p / cos_lat) - N;
if (p > 0.0) { /* Not the S|N pole so we can invert */
theta = atan (in_p[GMT_Z] * GMT->current.proj.datum.from.a / (p * GMT->current.proj.datum.from.b));
sincos (theta, &sin_theta, &cos_theta);
out[GMT_X] = d_atan2d (in_p[GMT_Y], in_p[GMT_X]);
out[GMT_Y] = atand ((in_p[GMT_Z] + GMT->current.proj.datum.from.ep_squared * GMT->current.proj.datum.from.b * pow (sin_theta, 3.0)) / (p - GMT->current.proj.datum.from.e_squared * GMT->current.proj.datum.from.a * pow (cos_theta, 3.0)));
if (in_p[GMT_Z] > 0.0 && out[GMT_Y] < 0.0) out[GMT_Y] = -out[GMT_Y];
if (in_p[GMT_Z] < 0.0 && out[GMT_Y] > 0.0) out[GMT_Y] = -out[GMT_Y];
sincosd (out[GMT_Y], &sin_lat, &cos_lat);
N = GMT->current.proj.datum.from.a / sqrt (1.0 - GMT->current.proj.datum.from.e_squared * sin_lat * sin_lat);
out[GMT_Z] = (p / cos_lat) - N;
}
else { /* S or N pole, use sign of in_p[GMT_Z] to set latitude and height */
out[GMT_X] = 0.0; /* Might as well pick0 since any longitude will work */
out[GMT_Y] = (in_p[GMT_Z] > 0.0) ? 90.0 : -90.0; /* EIther at north or south pole, check via Z coordinate */
out[GMT_Z] = in_p[GMT_Z] - copysign (GMT->current.proj.datum.from.b, in_p[GMT_Z]);
}
}

#if 0
Expand Down
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 ${SUPPL_LONG_OPT_H})
set (SUPPL_PROGS_SRCS psmeca.c pspolar.c pscoupe.c pssac.c shake.c vs30.c ${SUPPL_LONG_OPT_H})
set (SUPPL_LIB_SRCS ${SUPPL_PROGS_SRCS} utilmeca.c sacio.c)
set (SUPPL_EXAMPLE_FILES README.seis)
48 changes: 48 additions & 0 deletions src/seis/longopt/shake_inc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*--------------------------------------------------------------------
*
* Copyright (c) 1991-2023 by the GMT Team (https://www.generic-mapping-tools.org/team.html)
* See LICENSE.TXT file for copying and redistribution conditions.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; version 3 or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* Contact info: www.generic-mapping-tools.org
*--------------------------------------------------------------------*/

#ifndef SHAKE_INC_H
#define SHAKE_INC_H

/* Translation table from long to short module options, directives and modifiers */

static struct GMT_KEYWORD_DICTIONARY module_kw[] = { /* Local options for this module */
/* separator, short_option, long_option,
short_directives, long_directives,
short_modifiers, long_modifiers */
{ 0, 'G', "",
"", "",
"", "" },
{ 0, 'D', "",
"", "",
"", "" },
{ 0, 'L', "",
"", "",
"", "" },
{ 0, 'M', "",
"", "",
"", "" },
{ 0, 'C', "",
"", "",
"", "" },
{ 0, 'F', "",
"", "",
"", "" },
{ 0, '\0', "", "", "", "", ""} /* End of list marked with empty option and strings */
};

#endif /* !SHAKE_INC_H */
39 changes: 39 additions & 0 deletions src/seis/longopt/vs30_inc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*--------------------------------------------------------------------
*
* Copyright (c) 1991-2023 by the GMT Team (https://www.generic-mapping-tools.org/team.html)
* See LICENSE.TXT file for copying and redistribution conditions.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; version 3 or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* Contact info: www.generic-mapping-tools.org
*--------------------------------------------------------------------*/

#ifndef VS30_INC_H
#define VS30_INC_H

/* Translation table from long to short module options, directives and modifiers */

static struct GMT_KEYWORD_DICTIONARY module_kw[] = { /* Local options for this module */
/* separator, short_option, long_option,
short_directives, long_directives,
short_modifiers, long_modifiers */
{ 0, 'G', "",
"", "",
"", "" },
{ 0, 'C', "",
"", "",
"", "" },
{ 0, 'W', "",
"", "",
"", "" },
{ 0, '\0', "", "", "", "", ""} /* End of list marked with empty option and strings */
};

#endif /* !VS30_INC_H */
Loading

0 comments on commit db9d445

Please sign in to comment.