using GMT
# Assume that the Matthew_test.nc is at current dir
# Load the x,y, z arrays from file
x = gmt("read -Tg Matthew_test.nc?x");
y = gmt("read -Tg Matthew_test.nc?y");
z = gmt("read -Tg Matthew_test.nc?sfc_precip");
# Check the range of the coordinates. Need to know x_min, x_max, y_min, y_max
# Those values are the 5th and 6th of
x.range
y.range
# Compute a grid. Don't know original point separation so from dimensions and x values
# esrtimated that they are about 4 km.
G = gmt("nearneighbor -R-1428/1215/-2729/2326 -I4 -S20", [x.z[:] y.z[:] z.z[:]]);
# Quick image
grdimage(G, shade="+ne0.8+a100", proj="X10c/0", frame="a", fmt="jpg", show=true)
3 Likes