I have used this exact code previously without issue, but now it is throwing an error and apparently it does not like this section of my code anymore?
GMT.grdimage(G1, region = [-130 -70 24 51],
proj = (name = :lambertConic, center = [-100 35], parallels = [33 45]),
cmap = roma,
colorbar = (pos = (outside = true, anchor = :MR), xlabel = "mm"),
coast = (borders = ((type = 1, pen = ("thick", "black")), (type = 2, pen = ("thinner", "lightgrey"))),
area = 500,
shore = (:thinnest, :lightgrey)),
panel = (1,1),
title = "Vertical Residual greater than 2sigma | $yr",
);
Which now throws the following error:
grdcut [ERROR]: Could not decode ?, return NaN.
grdcut [ERROR]: Could not decode , return NaN.
grdcut [WARNING]: not a valid number and may not be decoded properly.
grdcut [ERROR]: Your scale or width () resulted in a zero value.
grdcut [ERROR]: Option -J parsing failure. Correct syntax:
-J Select map proJection (<scale> in cm/degree, <width> in cm).
Modifiers:
+dh Specifying map height.
+du Specifying maximum map dimension.
+dl Specifying minimum map dimension.
+dw Specifying map width [Default].
Azimuthal projections set -Rg unless polar aspect or -R<...>+r is
set.
-Ja|A<lon0>/<lat0>[/<hor>]/<scl> (or <radius>/<lat>)|<width> (Lambert
Azimuthal Equal-area)
-Jb|B<lon0>/<lat0>/<lat1>/<lat2>/<scl>|<width> (Albers Conic Equal-
area)
-Jcyl_stere|Cyl_stere/[<lon0>/[<lat0>/]]<lat1>/<lat2>/<scl>|<width>
(Cylindrical Stereographic)
-Jc|C<lon0>/<lat0><scl>|<width> (Cassini)
-Jd|D<lon0>/<lat0>/<lat1>/<lat2>/<scl>|<width> (Equidistant Conic)
-Je|E<lon0>/<lat0>[/<horizon>]/<scl> (or <radius>/<lat>)|<width>
(Azimuthal Equidistant)
-Jf|F<lon0>/<lat0>[/<horizon>]/<scl> (or <radius>/<lat>)|<width>
(Gnomonic)
-Jg|G<lon0>/<lat0>/<scl> (or <radius>/<lat>)|<width> (Orthographic)
-Jg|G<lon0>/<lat0>/<scl>|<width>[+a<azimuth>][+t<tilt>][+v<vwidth>/⏎
…<vheight>][+w<twist>][+z<altitude>[r|R]|g] (General Perspective)
-Jh|H[<lon0>/]<scl>|<width> (Hammer-Aitoff)
-Ji|I[<lon0>/]<scl>|<width> (Sinusoidal)
-Jj|J[<lon0>/]<scl>|<width> (Miller)
-Jkf|Kf[<lon0>/]<scl>|<width> (Eckert IV)
-Jks|Ks[<lon0>/]<scl>|<width> (Eckert VI)
-Jl|L<lon0>/<lat0>/<lat1>/<lat2>/<scl>|<width> (Lambert Conformal
Conic)
-Jm|M[<lon0>/[<lat0>/]]<scl>|<width> (Mercator)
-Jn|N[<lon0>/]<scl>|<width> (Robinson projection)
-Jo|O (Oblique Mercator). Specify one of three definitions:
-Jo|Oa|A<lon0>/<lat0>/<azimuth>/<scl>|<width>[+v]
-Jo|Ob|B<lon0>/<lat0>/<lon1>/<lat1>/<scl>|<width>[+v]
-Jo|Oc|C<lon0>/<lat0>/<lonp>/<latp>/<scl>|<width>[+v]
-Jpoly|Poly/[<lon0>/[<lat0>/]]<scl>|<width> ((American) Polyconic)
-Jq|Q[<lon0>/[<lat0>/]]<scl>|<width> (Equidistant Cylindrical)
-Jr|R[<lon0>/]<scl>|<width> (Winkel Tripel)
-Js|S<lon0>/<lat0>/[<horizon>/]<scl> (or <slat>/<scl> or <radius>/⏎
…<lat>)|<width> (Stereographic)
-Jt|T<lon0>/[<lat0>/]<scl>|<width> (Transverse Mercator)
-Ju|U[<zone>/]<scl>|<width> (UTM)
-Jv|V<lon0>/<scl>|<width> (van der Grinten)
-Jw|W<lon0>/<scl>|<width> (Mollweide)
-Jy|Y[<lon0>/[<lat0>/]]<scl>|<width> (Cylindrical Equal-area)
-Jp|P<scl>|<width>[+a][+f[e|p|<radius>]][+k<kind>][+r<offset>]⏎
…[+t<origin][+z[p|<radius>]] (Polar [azimuth] (theta,radius)).
-Jx|X<x-scl>|<width>[d|l|p<power>|t|T][/<y-scl>|<height>[d|l|⏎
…p<power>|t|T]] (Linear, log, and power projections)
(See basemap for more details on projection syntax)
grdcut [ERROR]: Offending option -JL0/0/?
ERROR: Something went wrong when calling the module. GMT error number = 72
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] gmt(cmd::String, args::GMTgrid{Float32, 2})
@ GMT ~/.julia/packages/GMT/YxoFB/src/gmt_main.jl:169
[3] common_grd(d::Dict{Symbol, Any}, cmd::String, args::GMTgrid{Float32, 2})
@ GMT ~/.julia/packages/GMT/YxoFB/src/common_options.jl:4104
[4] common_grd(::Dict{Symbol, Any}, ::String, ::String, ::String, ::GMTgrid{Float32, 2}, ::Vararg{Any})
@ GMT ~/.julia/packages/GMT/YxoFB/src/common_options.jl:4094
[5] grdcut_helper(cmd0::String, arg1::GMTgrid{Float32, 2}; kwargs::@Kwargs{R::String, J::String})
@ GMT ~/.julia/packages/GMT/YxoFB/src/grdcut.jl:76
[6] grdcut_helper
@ ~/.julia/packages/GMT/YxoFB/src/grdcut.jl:48 [inlined]
[7] grdcut
@ ~/.julia/packages/GMT/YxoFB/src/grdcut.jl:44 [inlined]
[8] grdimage(cmd0::String, arg1::GMTgrid{…}, arg2::Nothing, arg3::Nothing; first::Bool, kwargs::@Kwargs{…})
@ GMT ~/.julia/packages/GMT/YxoFB/src/grdimage.jl:91
[9] grdimage
@ ~/.julia/packages/GMT/YxoFB/src/grdimage.jl:51 [inlined]
[10] grdimage
@ ~/.julia/packages/GMT/YxoFB/src/grdimage.jl:225 [inlined]
[11] top-level scope
@ ~/Documents/julia/gmt_jl/stackplot.jl:35
Some type information was truncated. Use `show(err)` to see complete types.
Which, it shouldn’t? The centers and parallels make sense, I think? I’ve tried a view adjustments, but the error still throws. Anyone have any idea here?
If it’s helpful, here is my full code to create my plots:
using DelimitedFiles, Glob, GMT
# paths to various directories
imgpath = "/home/rob/Pictures/GenericMappingTool/rni_count/";
twosig = "/home/rob/Documents/julia2/RNI/vertical/2sigma/";
grid = "/home/rob/Documents/julia2/RNI/vertical/grid/";
roma = gmtread("/home/rob/Documents/bashscripts/customroma.cpt");
lonlat = gmtread("/home/rob/Documents/julia/gmt_jl/lonlat.txt");
## Function to read each file in as a GMT dataset ##
function gmt_read(i)
sig = gmtread(i[1])
gridded = gmtread(i[2])
return sig, gridded
end
file_count = 1
for i in zip((glob("*.txt", twosig)), (glob("*.txt", grid)))
sig, gridded = gmt_read(i)
G1 = GMT.gridit(sig, mask = 0.3, inc = 0.2);
G2 = GMT.gridit(gridded, mask = 0.3, inc = 0.2);
base = basename(i[1])
yr = string(base[1:8])
count_up = lpad(file_count, 4, "0")
GMT.subplot(grid = "2x1", savefig = imgpath * "$count_up" * "_stack.png",);
# gridding image for 2sigma values
GMT.grdimage(G1, region = [-130 -70 24 51],
proj = (name = :lambertConic, center = [-100 35], parallels = [33 45]),
cmap = roma,
colorbar = (pos = (outside = true, anchor = :MR), xlabel = "mm"),
coast = (borders = ((type = 1, pen = ("thick", "black")), (type = 2, pen = ("thinner", "lightgrey"))),
area = 500,
shore = (:thinnest, :lightgrey)),
panel = (1,1),
title = "Vertical Residual greater than 2sigma | $yr",
);
# gridding image for values
GMT.grdimage(G2, region = [-130 -70 24 51],
proj = (name = :lambertConic, center = [-100 35], parallels = [33 45]),
cmap = roma,
colorbar = (pos = (outside = true, anchor = :MR), xlabel = "mm"),
coast = (borders = ((type = 1, pen = ("thick", "black")), (type = 2, pen = ("thinner", "lightgrey"))),
area = 500,
shore = (:thinnest, :lightgrey)),
panel = (2,1),
title = "Vertical Residual | $yr",
);
GMT.scatter!(lonlat,
marker = :c,
markersize = 0.075,
mc = "black",
#figname = imgpath * "$yr" *" _stacked.png",
panel = (1,1),
# show = true
);
GMT.scatter!(lonlat,
marker = :c,
markersize = 0.075,
mc = "black",
#figname = imgpath * "$yr" *" _stacked.png",
panel = (2,1),
# show = true
);
subplot(:end)
file_count += 1
end