grdproject − Forward and Inverse map transformation of 2-D grid files |
grdproject in_grdfile −Gout_grdfile −Jparameters [ −A[k|m|n|i|c|p] ] [ −C[dx/dy] ] [ −Dxinc[unit][=|+][/yinc[unit][=|+]] ] [ −Edpi ] [ −F ] [ −I ] [ −Mc|i|m|p ] [ −Nnx/ny ] [ −Rwest/east/south/north[r] ] [ −S[-]b|c|l|n[/threshold] ] [ −V ] |
grdproject will do one of two things depending
whether −I has been set. If set, it will
transform a gridded data set from a rectangular coordinate
system onto a geographical system by resampling the surface
at the new nodes. If not set, it will project a geographical
gridded data set onto a rectangular grid. To obtain the
value at each new node, its location is inversely projected
back onto the input grid after which a value is interpolated
between the surrounding input grid values. By default
bi-cubic interpolation is used. Aliasing is avoided by also
forward projecting the input grid nodes. If two or more
nodes are projected onto the same new node, their average
will dominate in the calculation of the new node value.
Interpolation and aliasing is controlled with the
−S option. The new node spacing may be
determined in one of several ways by specifying the grid
spacing, number of nodes, or resolution. Nodes not
constrained by input data are set to NaN. |
in_grdfile |
2-D binary grid file to be transformed. |
−G |
Specify the name of the output netCDF grid file. |
||
−J |
Selects the map projection. Scale is UNIT/degree, 1:xxxxx, or width in UNIT (upper case modifier). UNIT is cm, inch, or m, depending on the MEASURE_UNIT setting in .gmtdefaults4, but this can be overridden on the command line by appending c, i, or m to the scale/width value. For map height, max dimension, or min dimension, append h, +, or - to the width, respectively. |
More details can be found in the psbasemap man pages. CYLINDRICAL PROJECTIONS: −Jclon0/lat0/scale (Cassini) AZIMUTHAL PROJECTIONS: −Jalon0/lat0/scale (Lambert) CONIC PROJECTIONS: −Jblon0/lat0/lat1/lat2/scale
(Albers) MISCELLANEOUS PROJECTIONS: −Jhlon0/scale (Hammer) NON-GEOGRAPHICAL PROJECTIONS: −Jp[a]scale[/origin][r|z]
(Polar coordinates (theta,r)) |
No space between the option flag and the associated arguments. |
−A |
Force 1:1 scaling, i.e., output (or input, see −I) data are in actual projected meters. To specify other units, append k (km), m (mile),n (nautical mile), i (inch), c (cm), or p (points). Without −A, the output (or input, see −I) are in the units specified by MEASURE_UNIT (but see −M). |
||
−C |
Let projected coordinates be relative to projection center [Default is relative to lower left corner]. Optionally, add offsets in the projected units to be added (or subtracted when −I is set) to (from) the projected coordinates, such as false eastings and northings for particular projection zones [0/0]. |
||
−D |
Set the grid spacing for the new grid. Append m for minutes, c for seconds. |
||
−E |
Set the resolution for the new grid in dots per inch. |
||
−F |
Toggle between pixel and gridline registration [Default is same as input]. |
||
−I |
Do the Inverse transformation, from rectangular to geographical. |
||
−M |
Append c, i, or m to indicate that cm, inch, or meter should be the projected measure unit [Default is set by MEASURE_UNIT in .gmtdefaults4]. Cannot be used with −A. |
||
−N |
Set the number of grid nodes in the new grid. |
||
−R |
xmin, xmax, ymin, and ymax specify the Region of interest. For geographic regions, these limits correspond to west, east, south, and north and you may specify them in decimal degrees or in [+-]dd:mm[:ss.xxx][W|E|S|N] format. Append r if lower left and upper right map coordinates are given instead of w/e/s/n. The two shorthands −Rg and −Rd stand for global domain (0/360 and -180/+180 in longitude respectively, with -90/+90 in latitude). For calendar time coordinates you may either give (a) relative time (relative to the selected TIME_EPOCH and in the selected TIME_UNIT; append t to −JX|x), or (b) absolute time of the form [date]T[clock] (append T to −JX|x). At least one of date and clock must be present; the T is always required. The date string must be of the form [-]yyyy[-mm[-dd]] (Gregorian calendar) or yyyy[-Www[-d]] (ISO week calendar), while the clock string must be of the form hh:mm:ss[.xxx]. The use of delimiters and their type and positions must be exactly as indicated (however, input, output and plot formats are customizable; see gmtdefaults). You may ask to project only a subset of the grid by specifying a smaller input w/e/s/n region [Default is the region given by the grid file]. |
||
−S |
Select the interpolation mode by adding b for B-spline smoothing, c for bicubic interpolation, l for bilinear interpolation, or n for nearest-neighbor value (for example to plot categorical data). Optionally, prepend - to switch off antialiasing. Add /threshold to control how close to nodes with NaNs the interpolation will go. A threshold of 1.0 requires all (4 or 16) nodes involved in interpolation to be non-NaN. 0.5 will interpolate about half way from a non-NaN value; 0.1 will go about 90% of the way, etc. [Default is bicubic interpolation with antialiasing and a threshold of 0.5]. |
||
−V |
Selects verbose mode, which will send progress reports to stderr [Default runs "silently"]. |
To transform the geographical grid dbdb5.grd onto a pixel Mercator grid at 300 dpi, run grdproject dbdb5.grd −R20/50/12/25 −Jm0.25i −E300 −F −Gdbdb5_merc.grd To inversely transform the file topo_tm.grd back onto a geographical grid, use grdproject topo_tm.grd −R-80/-70/20/40 −Jt-75/1:500000 −I −D5m −V −Gtopo.grd This assumes, of course, that the coordinates in
topo_tm.grd were created with the same projection
parameters. grdproject topo_utm.grd −R203/205/60/65 −Ju5/1:1 −I −Mm −V −Gtopo.grd |
The boundaries of a projected (rectangular) data set will not necessarily give rectangular geographical boundaries (Mercator is one exception). In those cases some nodes may be unconstrained (set to NaN). To get a full grid back, your input grid may have to cover a larger area than you are interrested in. |
GMT(1), gmtdefaults(1), mapproject(1) |