Skip to content

Commit 705a9e8

Browse files
authored
More JELS fixes and change the the default GMT_SERVER value (#1972)
1 parent 6f79b90 commit 705a9e8

5 files changed

Lines changed: 13 additions & 15 deletions

File tree

ci/config-gmt-unix.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ set (DCW_ROOT "$ENV{COASTLINEDIR}/dcw")
1111
1212
set (GMT_USE_THREADS TRUE)
1313
set (GMT_ENABLE_OPENMP TRUE)
14-
set (GMT_DATA_SERVER https://www.star.nesdis.noaa.gov/data/socd3/lsa/gmtdata/)
14+
set (GMT_DATA_SERVER https://www.earthbyte.org/webdav/gmt_mirror/gmtdata/)
1515
1616
# recommended even for release build
1717
set (CMAKE_C_FLAGS "-Wall -Wdeclaration-after-statement ${CMAKE_C_FLAGS}")

src/GMT.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ using .Laszip
377377
@compile_workload begin
378378
G_API[] = GMT_Create_Session("GMT", 2, GMT_SESSION_BITFLAGS)
379379
#GMT.parse_B(Dict{Symbol, Any}(:frame => (annot=10, title="Ai Ai"), :grid => (pen=2, x=10, y=20)), "", " -Baf -BWSen");
380-
#GMT.parse_opt_S(Dict{String, Any}(), mat2ds(rand(4,2)));
381380
GMT.theme("dark")
382381
GMT.theme_modern()
383382
mat2ds([9 8; 9 8], x=[0 7], pen=["5p,black", "4p,white,20p_20p"], multi=true)

src/common_options.jl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3071,17 +3071,17 @@ function axis(D::Dict{Symbol,Any}, x::Bool, y::Bool, z::Bool, secondary::Bool, d
30713071

30723072
# intervals
30733073
ints::String, ann_2, ann_3, tic_2, tic_3, gri_2, gri_3, gri_d = "", "", "", "", "", "", "", ""
3074-
if (haskey(d, :annot)) ints *= "a" * helper1_axes(d[:annot], is3D, 'a') end
3074+
if (haskey(d, :annot)) ints *= "a" * helper1_axes(d, :annot, is3D, 'a') end
30753075
contains(ints, ' ') && (spli = split(ints); ints = string(spli[1]); ann_2 = string(spli[2]); ann_3 = string(spli[3]))
30763076
(haskey(d, :annot_unit)) && (ints *= helper2_axes(d[:annot_unit]))
30773077

3078-
if (haskey(d, :ticks)) ints *= "f" * helper1_axes(d[:ticks], is3D, 'f') end
3078+
if (haskey(d, :ticks)) ints *= "f" * helper1_axes(d, :ticks, is3D, 'f') end
30793079
contains(ints, ' ') && (spli = split(ints); ints = string(spli[1]); tic_2 = string(spli[2]); tic_3 = string(spli[3]))
30803080
(haskey(d, :ticks_unit)) && (ints *= helper2_axes(d[:ticks_unit]))
30813081

30823082
if (haskey(d, :grid))
30833083
if (isa(d[:grid], NamedTuple)) gri_d = parse_grid(D, d[:grid], opt_B="", stalone=false) # Whatever comes out
3084-
else gri_d = "g" * helper1_axes(d[:grid], is3D, 'g')
3084+
else gri_d = "g" * helper1_axes(d, :grid, is3D, 'g')
30853085
end
30863086
contains(gri_d, ' ') && (spli = split(gri_d); gri_d = string(spli[1]); gri_2 = string(spli[2]); gri_3 = string(spli[3]))
30873087
ints *= gri_d; CTRL.pocket_B[1] = gri_d # If gri_d has a space in it I guess some shit will happen later
@@ -3158,7 +3158,7 @@ function axis(D::Dict{Symbol,Any}, x::Bool, y::Bool, z::Bool, secondary::Bool, d
31583158
return opt, [have_Baxes, (opt_Bframe != "")]
31593159
end
31603160

3161-
function axis(opt::String, D::Dict; x::Bool=false, y::Bool=false, z::Bool=false, secondary::Bool=false)::Tuple{String, Vector{Bool}}
3161+
function axis(opt::String, D::Dict{Symbol,Any}; x::Bool=false, y::Bool=false, z::Bool=false, secondary::Bool=false)::Tuple{String, Vector{Bool}}
31623162
# Method for axes setting already passed as a string
31633163
(x && opt[1] != 'x') && (opt = "x" * opt)
31643164
(y && opt[1] != 'y') && (opt = "y" * opt)
@@ -3194,15 +3194,15 @@ function helper0_axes(arg)::String
31943194
end
31953195

31963196
# ------------------------
3197-
function helper1_axes(arg, is3D::Bool, c::Char)::String
3197+
function helper1_axes(d::Dict{Symbol, Any}, symb::Symbol, is3D::Bool, c::Char)::String
31983198
# Used by annot, ticks and grid to accept also 'auto' and "" to mean automatic
3199-
out::String = arg2str(arg)
3199+
out::String = arg2str(d[symb])
32003200
(out != "" && out[1] == 'a') && return ""
3201-
if ((is3D || isa(arg, Tuple)) && ((nc = count_chars(out, '/')) > 0))
3202-
nc == 1 && return @sprintf("%.12g %s%.12g %s%.12g", arg[1], c, arg[1], c, arg[2])::String
3203-
nc == 2 && return @sprintf("%.12g %s%.12g %s%.12g", arg[1], c, arg[2], c, arg[3])::String
3201+
if ((is3D || isa(d[symb], Tuple)) && ((nc = count_chars(out, '/')) > 0))
3202+
nc == 1 && return @sprintf("%.12g %s%.12g %s%.12g", d[symb][1], c, d[symb][1], c, d[symb][2])::String
3203+
nc == 2 && return @sprintf("%.12g %s%.12g %s%.12g", d[symb][1], c, d[symb][2], c, d[symb][3])::String
32043204
end
3205-
(out != "" && isletter(out[1]) && out[1] != 'p') && # "pi" is allowed
3205+
(out != "" && isletter(out[1]) && out[1] != 'p') && # "pi" is allowed
32063206
(@warn("Probable misuse of the 'grid' sub-otpion. Defaulting to a valid value."); out = "")
32073207
return out
32083208
end
@@ -4891,7 +4891,7 @@ macro var"?"(name)
48914891
dir = "modules/"
48924892
if sym in [:ablines,:append2fig,:bezier,:blendimg,:cart2pol,:cart2sph,:circfit,:colorzones,:cpt4dcw,:crop,
48934893
:cubeplot,:coastlinesproj,
4894-
:cubeslice,:date2doy,:delrows!,:doy2date,:ecmwf,:era5time,era5vars,:gadm,:geocoder,:geodetic2enu,
4894+
:cubeslice,:date2doy,:delrows,:doy2date,:ecmwf,:era5time,era5vars,:gadm,:geocoder,:geodetic2enu,
48954895
:getbyattrib,:getprovider,:gmtread,:gmtwrite, :graticules,:gridit,:gunique,hampel,:imagesc,:inwhichpolygon,
48964896
:image_alpha!, :image_cpt!,:imshow,:ind2rgb, :info,:isnodata,:isoutlier,:lazinfo,:lazread,:lazwrite,:lasread,
48974897
:laswrite,:lelandshade,:linearfitxy,:listecmwfvars,

src/gmtspatial.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ function _gmtspatial_helper(cmd0::String, arg1, arg2, d::Dict)::Union{GMTdataset
106106
D.colnames = getsize(D)[2] == 2 ? ["centroid_x","centroid_y"] : ["centroid_x","centroid_y","area"];
107107
if isa(D, GMTdataset)
108108
ind = findall(.!isfinite.(D.data[:,1]))
109-
#!isempty(ind) && (D.data = delrows!(D.data, ind)) # Can't do this because it changes the number of output rows
110109
end
111110
end
112111
set_dsBB!(D)

src/makeDCWs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ function makeDCWs(fname="ne_10m_admin_0_countries_iso.shp.zip"; float=false, nam
113113
dx = diff(Dk[ind_big].data[:,1]); dy = diff(Dk[ind_big].data[:,2])
114114
ind_x = findall(abs.(dx) .< 0.00001); ind_y = findall(abs.(dy) .< 0.00001)
115115
ind = intersect(ind_x, ind_y)
116-
(!isempty(ind)) && (Dk[ind_big].data = delrows!(Dk[ind_big].data, ind)) # Delete repeated points
116+
(!isempty(ind)) && (Dk[ind_big].data = delrows(Dk[ind_big].data; rows=ind)) # Delete repeated points
117117
deleteat!(Dk, n) # Delete the one that was included in the big one
118118
set_dsBB!(Dk)
119119
break

0 commit comments

Comments
 (0)