|
2 | 2 | Focal mechanisms
|
3 | 3 | ----------------
|
4 | 4 |
|
5 |
| -The :meth:`pygmt.Figure.meca` method can plot focal mechanisms, or beachballs. |
| 5 | +The :meth:`pygmt.Figure.meca` method can plot focal mechanisms or beachballs. |
6 | 6 | We can specify the focal mechanism nodal planes or moment tensor components as
|
7 |
| -a dict using the ``spec`` parameter (or they can be specified as a 1d or 2d |
8 |
| -array, or within a specified file). The size of plotted beachballs can be |
| 7 | +a dictionary using the ``spec`` parameter (or they can be specified as a 1d or |
| 8 | +2d array, or within a specified file). The size of plotted beachballs can be |
9 | 9 | specified using the ``scale`` parameter.
|
10 | 10 | """
|
11 | 11 |
|
12 | 12 | import pygmt
|
13 | 13 |
|
14 | 14 | fig = pygmt.Figure()
|
15 | 15 |
|
16 |
| -# generate a basemap near Washington state showing coastlines, land, and water |
| 16 | +# generate a map near Washington State showing land, water, and shorelines |
17 | 17 | fig.coast(
|
18 | 18 | region=[-125, -122, 47, 49],
|
19 | 19 | projection="M6c",
|
|
23 | 23 | frame="a",
|
24 | 24 | )
|
25 | 25 |
|
26 |
| -# store focal mechanisms parameters in a dict |
| 26 | +# store focal mechanism parameters in a dictionary based on the Aki & Richards |
| 27 | +# convention |
27 | 28 | focal_mechanism = dict(strike=330, dip=30, rake=90, magnitude=3)
|
28 | 29 |
|
29 |
| -# pass the focal mechanism data to meca in addition to the scale and event |
30 |
| -# location |
31 |
| -fig.meca(focal_mechanism, scale="1c", longitude=-124.3, latitude=48.1, depth=12.0) |
| 30 | +# pass the focal mechanism data through the spec parameter. In addition provide |
| 31 | +# scale, event location, and event depth |
| 32 | +fig.meca( |
| 33 | + spec=focal_mechanism, |
| 34 | + scale="1c", # in centimeters |
| 35 | + longitude=-124.3, |
| 36 | + latitude=48.1, |
| 37 | + depth=12.0, |
| 38 | +) |
32 | 39 |
|
33 | 40 | fig.show()
|
0 commit comments