Hi everyone,
I am a gmt
novice trying to understand how grdsample
works exactly, when I specify a ROI in degrees and an increment in meters.
I am using gmt 6.1.1 on Windows 10 via git bash.
What I am confused by is the following:
Calling
gmt grdsample original.nc -Gresampled.nc -I150e -Vd
seems to work as expected (increment of 150 meters is converted to degrees according to the log):
grdsample [DEBUG]: Grid/Image dimensions imply w/e/s/n = -123.002/-121.994/47.9979/49.0063, inc = 150/150, gridline registration, n_layers = 1
grdsample [DEBUG]: Geographic input grid, longitudes span less than 360
grdsample [INFORMATION]: Distance to degree conversion implies x_inc = 0.00203591
grdsample [INFORMATION]: Given domain implies x_inc = 0.00203704
grdsample [INFORMATION]: Distance to degree conversion implies y_inc = 0.00134898
grdsample [INFORMATION]: Given domain implies y_inc = 0.00134984
but calling the same + specifying the ROI in degrees (using ud
)
gmt grdsample original.nc -Gresampled.nc -R-123.00208333333333/-121.99375/47.99791666666666/49.00625ud -I150e -Vd
gives me
grdsample [DEBUG]: Grid/Image dimensions imply w/e/s/n = -123.002/-121.994/197.998/49.0063, inc = 150/150, gridline registration, n_layers = 1
grdsample [DEBUG]: Geographic input grid, longitudes span less than 360
grdsample [INFORMATION]: Distance to degree conversion implies x_inc = -0.00244395
grdsample [INFORMATION]: Given domain implies x_inc = 2.34771e-10
grdsample [INFORMATION]: Distance to degree conversion implies y_inc = 0.00134898
grdsample [INFORMATION]: Given domain implies y_inc = -3.46907e-08
grdsample [ERROR]: Grid y increment <= 0.0
grdsample (gmtapi_init_grdheader): Please select compatible -R and -I values
As far as I can tell, this seems to add the increment (150, which should be interpreted as metres because I specify e
) to the ymin value of the ROI (47, which should be interpreted as degrees because I specify ud
) and deducing that the dimensions imply a Southern boundary (197) further north than its Northern boundary (49)? Could someone explain where I am going wrong?
I’ve attached the example file as a zipped NetCDF I am trying to grdsample
below:
original.zip (67.5 KB)
Any help with this would be much appreciated! Thanks in advance!
Best,
Alessandro