Skip to content

Commit 714f3e4

Browse files
Improve grdseamount documentation (#3712) (#3714)
* Improve grdseamount docs Cleaning up and adding figures * fine tune * Update grdseamount.rst * update -M * Update grdseamount.c * Update grdseamount.rst Co-authored-by: Paul Wessel <[email protected]>
1 parent 17851a2 commit 714f3e4

File tree

8 files changed

+230
-13
lines changed

8 files changed

+230
-13
lines changed

doc/rst/source/supplements/potential/grdseamount.rst

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ Synopsis
2222
[ |-F|\ [*flattening*] ]
2323
[ |-G|\ *grdfile* ]
2424
[ |-L|\ [*cut*] ]
25-
[ |-M|\ *list* ] [ |-N|\ *norm* ]
25+
[ |-M|\ [*list*] ]
26+
[ |-N|\ *norm* ]
2627
[ |-Q|\ *bmode*/*qmode* ]
2728
[ |-S|\ *scale* ]
2829
[ |-T|\ *t0*\ [/*t1*/*dt*]\ [**+l**] ]
@@ -48,7 +49,7 @@ a background depth (more complicated backgrounds may be added via :doc:`grdmath
4849
The input must contain *lon*, *lat*, *radius*, *height* for each seamount.
4950
For elliptical features (**-E**) we expect *lon*, *lat*, *azimuth*, *semi-major*, *semi-minor*,
5051
*height* instead. If flattening is specified (**-F**) with no value appended
51-
then a final column with flattening is expected (cannot be used for plateaus).
52+
then a final column with *flattening* is expected (cannot be used for plateaus).
5253
For temporal evolution of topography the **-T** option may be used, in which case the
5354
data file must have two final columns with the start and stop time of seamount construction.
5455
In this case you may choose to write out a cumulative shape or just the increments produced
@@ -73,13 +74,23 @@ Optional Arguments
7374

7475
**-A**\ [*out/in*]
7576
Build a mask grid, append outside/inside values [1/NaN].
76-
Here, height is ignored and **-L**, **-N** and **-Z** are disallowed.
77+
Here, height and flattening are ignored and **-L**, **-N** and **-Z** are disallowed.
7778

7879
.. _-C:
7980

8081
**-C**
8182
Select shape function: choose among **c** (cone), **d** (disc), **g** (Gaussian)
82-
and **p** (parabolic) shape [Default is Gaussian].
83+
and **p** (parabolic) shape [Default is Gaussian]. All but the disc can furthermore
84+
be truncated via a flattening parameter *f* set by **-F**.
85+
86+
.. figure:: /_images/GMT_seamount_types.*
87+
:width: 500 px
88+
:align: center
89+
90+
The four types of seamounts selectable via option **-C**. In all cases, :math:`h_0` is the maximum
91+
*height*, :math:`r_0` is the basal *radius*, :math:`h_c` is the noise floor set via **-L** [0], and
92+
*f* is the *flattening* set via **-F** [0]. The top radius :math:`r_t` is only nonzero if there is
93+
flattening and hence does not apply to the disc model.
8394

8495
.. _-D:
8596

@@ -95,10 +106,18 @@ Optional Arguments
95106
for each seamount. [Default is Circular data format, expecting
96107
*lon, lat, radius, height*].
97108

109+
.. figure:: /_images/GMT_seamount_map.*
110+
:width: 500 px
111+
:align: center
112+
113+
Use **-E** to select elliptical rather than circular shape in map view. Both shapes require
114+
lon, lat. Circular only requires the radius :math:`r_0` while elliptical requires the azimuth
115+
:math:`\alpha` and the major and minor semi-axes .
116+
98117
.. _-F:
99118

100119
**-F**\ [*flattening*]
101-
Seamounts are to be truncated to guyots. Append *flattening*, otherwise we expect
120+
Seamounts are to be truncated to guyots. Append *flattening* from 0 (no flattening to 1 (no feature!), otherwise we expect
102121
to find it in last input column [no truncation]. Ignored if used with **-Cd**.
103122

104123
.. _-G:
@@ -119,24 +138,30 @@ Optional Arguments
119138

120139
.. _-M:
121140

122-
**-M**\ *list*
123-
Write the names of all grids that were created to the text file *list*.
124-
Requires **-T**.
141+
**-M**\ [*list*]
142+
Write the times and names of all grids that were created to the text file *list*.
143+
Requires **-T**. If not *list* file is given then we write to standard output.
125144

126145
.. _-N:
127146

128147
**-N**\ *norm*
129-
Normalize grid so maximum grid height equals *norm*.
148+
Normalize grid so maximum grid height equals *norm* [no normalization]
130149

131150
.. _-Q:
132151

133152
**-Q**\ *bmode*/*qmode*
134153
Only to be used in conjunction with **-T**. Append two different modes settings:
135154
The *bmode* determines how we construct the surface. Specify **c** for cumulative
136-
volume through time, or **i** for incremental volume added for each time slice.
137-
The *qmode* determines the volume flux curve. Give **g** for a Gaussian volume flux history
155+
volume through time [Default], or **i** for incremental volume added for each time slice.
156+
The *qmode* determines the volume flux curve. Give **g** for a Gaussian volume flux history [Default]
138157
or **l** for a linear volume flux history between the start and stop times of each feature.
139158

159+
.. figure:: /_images/GMT_seamount_flux.*
160+
:width: 500 px
161+
:align: center
162+
163+
Use *qmode* in **-Q** to choose between a linear (**l**) or Gaussian (**g**) cumulative volume flux model.
164+
140165
.. _-S:
141166

142167
**-S**\ *scale*

doc/scripts/GMT_seamount_flux.ps

23.6 KB
Binary file not shown.

doc/scripts/GMT_seamount_flux.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
# Illustrate the two different volume-flux curves
3+
ps=GMT_seamount_flux.ps
4+
gmt set FONT_ANNOT_PRIMARY 14p
5+
# Two flux curves
6+
gmt math -T0/1/1 T = | gmt psxy -R0/1/0/1.1 -JX6.5i/1i -W1p,- -Bxa0.25fg0.5 -Byafg0.5 -Bx+l"Normalized seamount lifespan (@%6%t/@~D@~@%6%t@%%)" -By+l"@%6%V(t)/V@-0@-@%%" -BWSne -K --FONT_LABEL=16p,Helvetica,black -P > $ps
7+
gmt math -T0/1/0.01 T 0.5 SUB 6 MUL ERF 2 DIV 0.5 ADD = | gmt psxy -R -J -O -W3p >> $ps

doc/scripts/GMT_seamount_map.ps

28.1 KB
Binary file not shown.

doc/scripts/GMT_seamount_map.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
# Illustrate the circular and elliptical bases of seamounts
3+
ps=GMT_seamount_map.ps
4+
gmt set MAP_VECTOR_SHAPE 0.5
5+
6+
# Circle
7+
echo 0 0 | gmt psxy -R-1/1/-1/1 -Jx1i -Sc1.3i -W2p -P -K > $ps
8+
echo 0 0 | gmt psxy -R -J -Sc0.1i -Gblack -O -K >> $ps
9+
gmt psxy -R -J -O -K -Sv0.1i+e+s -Gblack -W0.5p -N << EOF >> $ps
10+
-0.8 0 1 0
11+
0 -0.8 0 1
12+
EOF
13+
gmt psxy -R -J -O -K -W0.25p,- << EOF >> $ps
14+
0 0
15+
0.45 0.45
16+
EOF
17+
echo 0.55 0.55 r@-0@- | gmt pstext -R -J -O -K -F+f14p,Times-Italic >> $ps
18+
echo "0 0 lon,lat "| gmt pstext -R -J -O -K -F+f14p,Times-Italic+jTR -Dj0.05i >> $ps
19+
echo circular | gmt pstext -R -J -O -K -F+f16p+cTL >> $ps
20+
# Ellipse
21+
echo 0 0 30 1.7i 0.7i | gmt psxy -R -J -O -K -Se -W2p -X2.5i >> $ps
22+
echo 0 0 | gmt psxy -R -J -Sc0.1i -Gblack -O -K >> $ps
23+
gmt psxy -R -J -O -K -Sv0.1i+e+s -Gblack -W0.5p -N << EOF >> $ps
24+
-0.8 0 1 0
25+
0 -0.8 0 1
26+
EOF
27+
gmt psxy -R -J -O -K -W0.25p,- << EOF >> $ps
28+
>
29+
0 0
30+
0.736121593217 0.425
31+
>
32+
0 0
33+
-0.175 0.303108891325
34+
EOF
35+
echo 0 0 0.2i 30 90 | gmt psxy -R -J -O -K -Sm4p+b -Gblack -W0.25p >> $ps
36+
echo 0.736121593217 0.425 major | gmt pstext -R -J -O -K -F+f14p,Times-Italic+jBL -Dj0.03i -N >> $ps
37+
echo -0.175 0.303108891325 minor | gmt pstext -R -J -O -K -F+f14p,Times-Italic+jBR -Dj0.03i -N >> $ps
38+
echo 0.125 0.275 @~a@~ | gmt pstext -R -J -O -K -F+f14p,Times-Italic >> $ps
39+
echo "0 0 lon,lat "| gmt pstext -R -J -O -K -F+f14p,Times-Italic+jTR -Dj0.05i >> $ps
40+
echo elliptical | gmt pstext -R -J -O -K -F+f16p+cTL >> $ps
41+
gmt psxy -R -J -O -T >> $ps

doc/scripts/GMT_seamount_types.ps

38 KB
Binary file not shown.

doc/scripts/GMT_seamount_types.sh

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
#!/bin/bash
2+
# Plot four different seamount types selectable in grdseamount
3+
# 1. Conical seamount
4+
gmt set MAP_VECTOR_SHAPE 0.5
5+
ps=GMT_seamount_types.ps
6+
cat << EOF > tmp
7+
0 1
8+
1 1
9+
4 0
10+
EOF
11+
cat << EOF > body
12+
-4 0
13+
-1 1
14+
0 1
15+
1 1
16+
4 0
17+
EOF
18+
gmt psxy -R-5/5/-0.05/1.5 -JX6.5i/1.25i -P -K -Glightgray body -Y6i > $ps
19+
gmt psxy -R -J -O -K -W2p tmp >> $ps
20+
gmt psxy -R -J -O -K -W0.5p,- << EOF >> $ps
21+
-4 0
22+
0 1.33333
23+
4 0
24+
EOF
25+
gmt psxy -R -J -O -K -Sv0.1i+e+s -Gblack -W0.5p -N << EOF >> $ps
26+
-5 0 5 0
27+
0 0 0 1.7
28+
EOF
29+
gmt psxy -R -J -O -K -W0.25p,- << EOF >> $ps
30+
>
31+
-0.5 0.2
32+
4.3 0.2
33+
>
34+
1 0
35+
1 1
36+
>
37+
3.4 0
38+
3.4 0.3
39+
EOF
40+
gmt pstext -R -J -O -K -F+f16p,Times-Italic+j -N << EOF >> $ps
41+
1 -0.05 TC r@-t@- = fr@-0@-
42+
4 -0.05 TC r@-0@-
43+
3.4 -0.05 TC r@-c@-
44+
4.3 0.2 LM h@-c@-
45+
-0.2 1 RM h@-0@-
46+
EOF
47+
echo "@%1%c@%% (cone)" | gmt pstext -R -J -O -K -F+f18p+cTL -Dj0.1i >> $ps
48+
# 2. Parabolic seamount
49+
echo "0 1" > tmp
50+
echo "1 1" >> tmp
51+
gmt math -T1/4/0.1 T 4 DIV 2 POW NEG 1 ADD 1 0.25 2 POW SUB DIV = >> tmp
52+
gmt math -T-4/-1/0.1 T 4 DIV 2 POW NEG 1 ADD 1 0.25 2 POW SUB DIV = body
53+
gmt math -T1/4/0.1 T 4 DIV 2 POW NEG 1 ADD 1 0.25 2 POW SUB DIV = >> body
54+
gmt math -T-4/4/0.1 T 4 DIV 2 POW NEG 1 ADD 1 0.25 2 POW SUB DIV = line
55+
gmt psxy -R -J -O -K -Glightgray body -Y-1.4i >> $ps
56+
gmt psxy -R -J -O -K -W2p tmp >> $ps
57+
gmt psxy -R -J -O -K -W0.5p,- line >> $ps
58+
gmt psxy -R -J -O -K -Sv0.1i+e+s -Gblack -W0.5p -N << EOF >> $ps
59+
-5 0 5 0
60+
0 0 0 1.5
61+
EOF
62+
gmt psxy -R -J -O -K -W0.25p,- << EOF >> $ps
63+
>
64+
-0.5 0.2
65+
4.3 0.2
66+
>
67+
1 0
68+
1 1
69+
>
70+
3.60555 0
71+
3.60555 0.3
72+
EOF
73+
gmt pstext -R -J -O -K -F+f16p,Times-Italic+j -N << EOF >> $ps
74+
1 -0.05 TC r@-t@- = fr@-0@-
75+
4 -0.05 TC r@-0@-
76+
3.60555 -0.05 TC r@-c@-
77+
4.3 0.2 LM h@-c@-
78+
-0.2 1 RM h@-0@-
79+
EOF
80+
echo "@%1%p@%% (parabolic)" | gmt pstext -R -J -O -K -F+f18p+cTL -Dj0.1i >> $ps
81+
# 3. Gaussian seamount
82+
echo "0 1" > tmp
83+
echo "1 1" >> tmp
84+
gmt math -T1/4/0.1 T 4 DIV 2 POW 4.5 MUL NEG EXP 0.25 2 POW 4.5 MUL EXP MUL = >> tmp
85+
gmt math -T-4/-1/0.1 T 4 DIV 2 POW 4.5 MUL NEG EXP 0.25 2 POW 4.5 MUL EXP MUL = body
86+
gmt math -T1/4/0.1 T 4 DIV 2 POW 4.5 MUL NEG EXP 0.25 2 POW 4.5 MUL EXP MUL = >> body
87+
gmt math -T-4/4/0.1 T 4 DIV 2 POW 4.5 MUL NEG EXP 0.25 2 POW 4.5 MUL EXP MUL = line
88+
gmt psxy -R-5/5/-0.05/1.35 -J -O -K -Glightgray body -Y-1.6i >> $ps
89+
gmt psxy -R -J -O -K -W2p tmp >> $ps
90+
gmt psxy -R -J -O -K -W0.5p,- line >> $ps
91+
gmt psxy -R -J -O -K -Sv0.1i+e+s -Gblack -W0.5p -N << EOF >> $ps
92+
-5 0 5 0
93+
0 0 0 1.6
94+
EOF
95+
gmt psxy -R -J -O -K -W0.25p,- << EOF >> $ps
96+
>
97+
-0.5 0.2
98+
4.3 0.2
99+
>
100+
1 0
101+
1 1
102+
>
103+
2.59 0
104+
2.59 0.3
105+
EOF
106+
gmt pstext -R -J -O -K -F+f16p,Times-Italic+j -N << EOF >> $ps
107+
1 -0.05 TC r@-t@- = fr@-0@-
108+
4 -0.05 TC r@-0@-
109+
4.3 0.2 LM h@-c@-
110+
2.59 -0.05 TC r@-c@-
111+
-0.2 1 RM h@-0@-
112+
EOF
113+
echo "@%1%g@%% (Gaussian)" | gmt pstext -R -J -O -K -F+f18p+cTL -Dj0.1i >> $ps
114+
# Disc
115+
cat << EOF > tmp
116+
0 1
117+
4 1
118+
4 0
119+
EOF
120+
cat << EOF > body
121+
-4 0
122+
-4 1
123+
4 1
124+
4 0
125+
EOF
126+
gmt psxy -R -J -O -K -Glightgray body -Y-1.45i >> $ps
127+
gmt psxy -R -J -O -K -W2p tmp >> $ps
128+
gmt psxy -R -J -O -K -Sv0.1i+e+s -Gblack -W0.5p -N << EOF >> $ps
129+
-5 0 5 0
130+
0 0 0 1.4
131+
EOF
132+
gmt psxy -R -J -O -K -W0.25p,- << EOF >> $ps
133+
>
134+
-0.5 0.2
135+
4.3 0.2
136+
EOF
137+
gmt pstext -R -J -O -K -F+f16p,Times-Italic+j -N << EOF >> $ps
138+
4 -0.05 TC r@-0@- = r@-c@-
139+
4.3 0.2 LM h@-c@-
140+
-0.2 1 RM h@-0@-
141+
EOF
142+
echo "@%1%d@%% (disc)" | gmt pstext -R -J -O -F+f18p+cTL -Dj0.1i >> $ps
143+
144+
rm -f tmp body line

src/potential/grdseamount.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#define THIS_MODULE_MODERN_NAME "grdseamount"
3535
#define THIS_MODULE_LIB "potential"
3636
#define THIS_MODULE_PURPOSE "Create synthetic seamounts (Gaussian, parabolic, cone or disc, circular or elliptical)"
37-
#define THIS_MODULE_KEYS "<T{,GG},TD("
37+
#define THIS_MODULE_KEYS "<T{,GG},LD),MD),TD("
3838
#define THIS_MODULE_NEEDS "R"
3939
#define THIS_MODULE_OPTIONS "-:RVbdefhir" GMT_OPT("H")
4040

@@ -150,7 +150,7 @@ static int usage (struct GMTAPI_CTRL *API, int level) {
150150
const char *name = gmt_show_name_and_purpose (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_PURPOSE);
151151
if (level == GMT_MODULE_PURPOSE) return (GMT_NOERROR);
152152
GMT_Message (API, GMT_TIME_NONE, "usage: %s [infile(s)] -G<outgrid> %s\n\t%s [-A[<out>/<in>]] [-Cc|d|g|p] [-D%s]\n", name, GMT_I_OPT, GMT_Rgeo_OPT, GMT_LEN_UNITS2_DISPLAY);
153-
GMT_Message (API, GMT_TIME_NONE, "\t[-E] [-F[<flattening>]] [-L[<hcut>]] [-M<list>] [-N<norm>] [-Q<bmode><fmode>] [-S<r_scale>]\n");
153+
GMT_Message (API, GMT_TIME_NONE, "\t[-E] [-F[<flattening>]] [-L[<hcut>]] [-M[<list>]] [-N<norm>] [-Q<bmode><fmode>] [-S<r_scale>]\n");
154154
GMT_Message (API, GMT_TIME_NONE, "\t[-T<t0>[/<t1>/<dt>|<file>|<n>[+l]]] [-Z<base>] [%s] [%s] [%s] [%s]\n\t[%s] [%s]\n\t[%s] [%s]\n\n",
155155
GMT_bi_OPT, GMT_di_OPT, GMT_e_OPT, GMT_f_OPT, GMT_h_OPT, GMT_i_OPT, GMT_r_OPT, GMT_PAR_OPT);
156156

0 commit comments

Comments
 (0)