Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

grdreformat(1) [debian man page]

GRDREFORMAT(l)															    GRDREFORMAT(l)

NAME
grdreformat - Converting between different grdfile formats. SYNOPSIS
grdreformat ingrdfile[=id[/scale/offset[/NaNvalue]]] outgrdfile[=id[/scale/offset[/NaNvalue]]] [ -Rwest/east/south/north[r] ] [ -V ] DESCRIPTION
grdreformat reads a grdfile in one format and writes it out using another format. As an option the user may select a subset of the data to be written and to specify scaling, translation, and NaN-value. ingrdfile The grdfile to be read. Append format =id number if not a standard GMT netcdf-based grdfile. If id is set, you may optionally append scale and offset to scale the data and then add an offset. If scale and offset are supplied you may also append a value that represent 'not-a-number' (for floating-point grids this is unneccesary since the IEEE NaN is used; however short integers need a value which means no data available.) outgrdfile The grdfile to be written. Append format =id number if not a standard GMT netcdf-based grdfile. If id is set, you may optionally append scale and offset to scale the data and then add an offset. If scale and offset are supplied you may also append a value that represent 'not-a-number' (for floating-point grids this is unneccesary since the IEEE NaN is used; however short integers need a value which means no data available.) For format =id > 0 the size of the GMT grdheader block is hsize = 896 bytes, and the total size of the file is hsize + nx * ny * item_size, where item_size is the size in bytes of each element (1, 2, 4). Bit grids are stored using 4-byte integers, each holding 32 bits, so for these files the size equation is modified by using ceil (nx / 32) * 4 instead of nx. For header and grid details, see Appendix B. OPTIONS
-R west, east, south, and north specify the Region of interest. To specify boundaries in degrees and minutes [and seconds], use the dd:mm[:ss] format. Append r if lower left and upper right map coordinates are given instead of wesn. -V Selects verbose mode, which will send progress reports to stderr [Default runs "silently"]. EXAMPLES
To create a 4-byte raw floating point grid from the netcdf file data.grd, try grdreformat data.grd ras_data.b4=1 -V To make a 2-byte short integer file, scale it by 10, subtract 32000, setting NaNs to -9999, do grdreformat values.grd shorts.i2=2/10/-32000/-9999 -V To create a Sun standard 8-bit rasterfile for a subset of the data file image.grd, assuming the range in image.grd is 0-1 and we need 0-255, try grdreformat image.grd -R-60/-40/-40/-30 image.ras8=3/255/0 -V SEE ALSO
gmt(1gmt), grdmath(1gmt) 1 Jan 2004 GRDREFORMAT(l)

Check Out this Related Man Page

GRDEDIT(l)																GRDEDIT(l)

NAME
grdedit - Modifying the header in a 2-D grdfile SYNOPSIS
grdedit grdfile [ -A ] [ -Dxunit/yunit/zunit/scale/offset/title/remark ] [ -Rwest/east/south/north[r] ] [ -S ] [ -V ] DESCRIPTION
grdedit reads the header information in a binary 2-D grdfile and replaces the information with values provided on the command line [if any]. As an option, global, geographical grids (with 360 degrees longitude range) can be rotated in the east-west direction. grdedit only operates on files containing a grdheader. No space between the option flag and the associated arguments. Use upper case for the option flags and lower case for modifiers. grdfile Name of the 2-D grdfile to modify OPTIONS
-A If necessary, adjust the file's x_inc, y_inc to be compatible with its domain (or a new domain set with -R). Older gridfiles (i.e., created prior to GMT 3.1) often had excessive slop in' x_inc, y_inc and an adjustment is necessary. Newer files are created cor- rectly. -D Give new values for xunit, yunit, zunit, scale, offset, title, and remark. To leave some of the values untouched, specify = as the new value. -R west, east, south, and north specify the Region of interest. To specify boundaries in degrees and minutes [and seconds], use the dd:mm[:ss] format. Append r if lower left and upper right map coordinates are given instead of wesn. The new w/e/s/n values will replace those in the grid, and the x_inc, y_inc values are adjusted, if necessary. -S For global, geographical grids only. Grid values will be shifted laterally according to the new borders given in -R. -V Selects verbose mode, which will send progress reports to stderr [Default runs "silently"]. EXAMPLES
Let us assume the file data.grd covers the area 300/310/10/30. We want to change the boundaries from geodetic longitudes to geographic and put a new title in the header. We accomplish this by grdedit data.grd -R-60/-50/10/30 -D=/=/=/=/=/"Gravity Anomalies"/= The grid world.grd has the limits 0/360/-72/72. To shift the data so that the limits would be -180/180/-72/72, use grdedit world.grd -R-180/180/-72/72 -S The file junk.grd was created prior to GMT 3.1 with incompatible -R and -I arguments. To reset the x- and y-increments we run grdedit junk.grd -A SEE ALSO
gmt(1gmt), grd2xyz(1gmt), xyz2grd(1gmt) 1 Jan 2004 GRDEDIT(l)
Man Page