Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/GMT.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ export
sphtriangulate, surface, ternary, ternary!, text, text!, text_record, trend1d, trend2d, triangulate, gmtsplit,
decorated, vector_attrib, wiggle, wiggle!, xyz2grd, gmtbegin, gmtend, gmthelp, subplot, gmtfig, inset, showfig,
earthtide, gravfft, gmtgravmag3d, grdgravmag3d, gravprisms, pscoupe, pscoupe!, coupe, coupe!, psmeca, psmeca!,
meca, meca!, psvelo, psvelo!, velo, velo!, getbyattrib, inpolygon, inwhichpolygon, pcolor, pcolor!, triplot, triplot!,
trisurf, trisurf!, grdrotater, imagesc, upGMT, boxes,
meca, meca!, psvelo, psvelo!, velo, velo!, gmtisf, getbyattrib, inpolygon, inwhichpolygon, pcolor, pcolor!,
triplot, triplot!, trisurf, trisurf!, grdrotater, imagesc, upGMT, boxes,

find_in_dict, find_in_kwargs,
mbimport, mbgetdata, mbsvplist, mblevitus,
Expand Down Expand Up @@ -303,6 +303,7 @@ include("utils_project.jl")
include("choropleth_utils.jl")
include("webmapserver.jl")
include("seis/psmeca.jl")
include("seis/gmtisf.jl")
include("geodesy/psvelo.jl")
include("geodesy/earthtide.jl")
include("MB/mbimport.jl")
Expand Down
45 changes: 45 additions & 0 deletions src/seis/gmtisf.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
"""
gmtisf(cmd0::String; kwargs...)

Plot focal mechanisms.

Parameters
----------

- $(_opt_R)

- **G** | **fill** | **compressionfill** :: [Type => Str | Number]

Selects shade, color or pattern for filling the sectors [Default is no fill].
- **L** | **outline_pen** | **pen_outline** :: [Type => Str | Number | Tuple]

Draws the “beach ball” outline with pen attributes instead of with the default pen set by **pen**
- **M** | **same_size** | **samesize** :: [Type => Bool]

Use the same size for any magnitude. Size is given with **S**
- **N** | **no_clip** | **noclip** :: [Type => Str | []]

Do NOT skip symbols that fall outside frame boundary.

- $(opt_swap_xy)

Example: Plot a focal mechanism using the Aki & Richards convention

```julia
psmeca([0.0 3.0 0.0 0 45 90 5 0 0], aki=true, fill=:black, region=(-1,4,0,6), proj=:Merc, show=1)
```
"""
# ---------------------------------------------------------------------------------------------------
function gmtisf(cmd0::String; kwargs...)

d = init_module(false, kwargs...)[1] # Also checks if the user wants ONLY the HELP mode

cmd = parse_common_opts(d, "", [:R :V_params :yx])[1]
cmd = parse_these_opts(cmd, d, [[:F :focal], [:D :date], [:N :notime]])
out = common_grd(d, cmd0, cmd, "gmtisf ", nothing) # Finish build cmd and run it
nc = size(out,2)
colnames = (nc == 4 || nc == 9) ? ["lon", "lat", "depth", "mag"] : (nc == 7 || nc == 12) ? ["lon", "lat", "depth", "strike", "dip", "rake", "mag"] : ["lon", "lat", "depth", "strike1", "dip1", "rake1", "strike2", "dip2", "rake2", "mantissa", "exponent"]
(!contains(cmd, " -N")) && (append!(colnames, ["year", "month", "day", "hour", "minute"]))
out.colnames = colnames
return out
end
Loading