Assuming the dataset is not already downloaded/run gmt clear data
.
Simple script:
res=@earth_relief_05m
proj=-JS0/90/50c
r=-R0/60/70/90
gmt begin map png
echo "Running grdimage command.."
gmt grdimage ${res} ${proj} ${r} -Bafg
echo "Running grdcut command.."
gmt grdcut ${res} ${r} -Gtemp-slope.nc
gmt end
When executed, the dataset is downloaded twice - one time for each command:
Running grdimage command..
grdblend [NOTICE]: Remote data courtesy of GMT data server oceania [http://oceania.generic-mapping-tools.org]
grdblend [NOTICE]: SRTM15 Earth Relief at 05x05 arc minutes reduced by Gaussian Cartesian filtering (9.3 km fullwidth) [Tozer et al., 2019].
grdblend [NOTICE]: -> Download 180x180 degree grid tile (earth_relief_05m_p): S90E000
Running grdcut command..
gmt [WARNING]: Remote dataset given to a data processing module but no registration was specified - default to gridline registration (if available)
grdblend [NOTICE]: Remote data courtesy of GMT data server oceania [http://oceania.generic-mapping-tools.org]
grdblend [NOTICE]: SRTM15 Earth Relief at 05x05 arc minutes reduced by Gaussian Cartesian filtering (9.3 km fullwidth) [Tozer et al., 2019].
grdblend [NOTICE]: -> Download 180x180 degree grid tile (earth_relief_05m_g): S90E000
Should not this be done only once? Note exact same -J
and -R
.
Re-run the script again - and both commands understand that the dataset is already available and no download is initiated:
Running grdimage command..
Running grdcut command..
gmt [WARNING]: Remote dataset given to a data processing module but no registration was specified - default to gridline registration (if available)
I tried executing the grdcut
command first, to see if that made any difference, but no - it still downloads twice.
I forgot to add $proj
to the grdcut
command. Adding that still does not stop the double download. Not that it should matter, but you never know.