Hi all,
I’ve made progress with the map, but now the colormap won’t apply to there region. I’m not sure why. grdcut
does not take cmap
as an input, which leaves feeding my cpt into grdimage
.
I did make sure that the epoch chosen has data showing for the region specified (Washington state) – so I know there should be something being displayed.
As requested, I adjusted my code so that my problem is reproducible. I don’t know how to share it on Juliahub, but I did make it public, which can be found here where my username is robfuller924. I uploaded 7 files in total. 6 .grd files, and 1 cpt.
Here is the code I’m trying to make the plots with:
using DelimitedFiles, Glob, GMT
begin
# rad
twosigrad = GMT.gmtread("/home/rob/RNI/RNI.rad/value/rad.out/2sig/2003.906_rad.grd")
sigrad = GMT.gmtread("/home/rob/RNI/RNI.rad/value/rad.out/sig/2003.906_rad.grd")
# lon
twosiglon = GMT.gmtread("/home/rob/RNI/RNI.lon/value/lon.out/2sig/2003.906_lon.grd")
siglon = GMT.gmtread("/home/rob/RNI/RNI.lon/value/lon.out/sig/2003.906_lon.grd")
# lat
twosiglat = GMT.gmtread("/home/rob/RNI/RNI.lat/value/lat.out/2sig/2003.906_lat.grd")
siglat = GMT.gmtread("/home/rob/RNI/RNI.lat/value/lat.out/sig/2003.906_lat.grd")
# cpt
roma = gmtread("/home/rob/Scripts/cpt/customroma4.cpt")
end
begin
GMT.subplot(grid = "2x3", title = "RNI | 2003.906");
coast = GMT.coast(DCW = (name = "US.WA"), dump = true);
# rad
G1 = GMT.grdcut(sigrad, cutline=(polygon = coast, crop2cutline= true));
G2 = GMT.grdcut(twosigrad, cutline=(polygon = coast, crop2cutline= true));
GMT.grdimage(G1,
coast = (borders = ((type = 1, pen = ("thick", "red")), (type = 2, pen = ("thinner", "lightgrey"))),
area = 500,
shore = (:thinnest, :lightgrey)),
cmap = roma,
panel = (1,1),
title = "Vertical"
);
GMT.grdimage(G2,
coast = (borders = ((type = 1, pen = ("thick", "red")), (type = 2, pen = ("thinner", "lightgrey"))),
area = 500,
shore = (:thinnest, :lightgrey)),
cmap = roma,
panel = (2,1)
);
# lon
G3 = GMT.grdcut(siglon, cutline=(polygon = coast, crop2cutline= true));
G4 = GMT.grdcut(twosiglon, cutline=(polygon = coast, crop2cutline= true));
GMT.grdimage(G3,
coast = (borders = ((type = 1, pen = ("thick", "red")), (type = 2, pen = ("thinner", "lightgrey"))),
area = 500,
shore = (:thinnest, :lightgrey)),
cmap = roma,
panel = (1,2),
title = "East"
);
GMT.grdimage(G4,
coast = (borders = ((type = 1, pen = ("thick", "red")), (type = 2, pen = ("thinner", "lightgrey"))),
area = 500,
shore = (:thinnest, :lightgrey)),
cmap = roma,
panel = (2,2),
title = "Greater than 2sigma"
);
# lat
G5 = GMT.grdcut(siglat, cutline=(polygon = coast, crop2cutline= true));
G6 = GMT.grdcut(twosiglat, cutline=(polygon = coast, crop2cutline= true));
GMT.grdimage(G5,
coast = (borders = ((type = 1, pen = ("thick", "red")), (type = 2, pen = ("thinner", "lightgrey"))),
area = 500,
shore = (:thinnest, :lightgrey)),
cmap = roma,
panel = (1,3),
title = "North"
);
GMT.grdimage(G6,
coast = (borders = ((type = 1, pen = ("thick", "red")), (type = 2, pen = ("thinner", "lightgrey"))),
area = 500,
shore = (:thinnest, :lightgrey)),
cmap = roma,
panel = (2,3)
);
subplot(show=true)
end
If you do download the data, all you should have to do is adjust the paths to the datasets.
The output of the above code looks like this:
It’s definitely closer to what I want, but, like described above, cmap
is not being read in and I’m not sure why.
When I compare this to another script I have, a segment of which, that looks like this:
# rad
GMT.grdimage(sigrad, (region= [-130 -70 24 64], proj=:Winkel),
coast = (borders = ((type = 1, pen = ("thick", "black")), (type = 2, pen = ("thinner", "lightgrey"))),
area = 500,
shore = (:thinnest, :lightgrey)),
cmap = roma,
panel = (1,1),
title = "Vertical"
);
The difference here, is that I specify the region and projection because I’m not using coast
or grdcut
in the loop that the above segment came from. But cmap
does get read in correctly and produced the following:
Where you can see that Washington does have Data for both Vertical and East. So, I’m not sure what’s going on here.
As always, thank you in advance for any help and insights for my technical issues. Please let me know if there are any issues downloading or accessing the data I uploaded to Juliahub. I am happy to share my data through other means as well.
- Rob