.TH GRDCLIP 1gmt "Feb 27 2014" "GMT 4.5.13 (SVN)" "Generic Mapping Tools" .SH NAME grdclip \- Clipping of range in grid files. .SH SYNOPSIS \fBgrdclip\fP \fIinput_file.grd\fP \fB\-G\fP\fIoutput_file.grd\fP [ \fB\-Sa\fP\fIhigh/above\fP ] [ \fB\-Sb\fP\fIlow/below\fP ] [ \fB\-V\fP ] .SH DESCRIPTION \fBgrdclip\fP will set values < \fIlow\fP to \fIbelow\fP and/or values > \fIhigh\fP to \fIabove\fP. Useful when you want all of a continent or an ocean to fall into one color or grayshade in image processing, or clipping of the range of data values is required. \fIabove/below\fP can be any number or NaN (Not a Number). You must choose at least one of \fB\-Sa\fP or \fB\-Sb\fP. .TP \fIinput_file.grd\fP The input 2-D binary grid file. .TP \fB\-G\fP \fIoutput_file.grd\fP is the modified output grid file. .SH OPTIONS .TP \fB\-Sa\fP Set all data[i] > \fIhigh\fP to \fIabove\fP. .TP \fB\-Sb\fP Set all data[i] < \fIlow\fP to \fIbelow\fP. .TP \fB\-V\fP Selects verbose mode, which will send progress reports to stderr [Default runs "silently"]. .SH GRID FILE FORMATS By default \fBGMT\fP writes out grid as single precision floats in a COARDS-complaint netCDF file format. However, \fBGMT\fP is able to produce grid files in many other commonly used grid file formats and also facilitates so called "packing" of grids, writing out floating point data as 2- or 4-byte integers. To specify the precision, scale and offset, the user should add the suffix \fB=\fP\fIid\fP[\fB/\fP\fIscale\fP\fB/\fP\fIoffset\fP[\fB/\fP\fInan\fP]], where \fIid\fP is a two-letter identifier of the grid type and precision, and \fIscale\fP and \fIoffset\fP are optional scale factor and offset to be applied to all grid values, and \fInan\fP is the value used to indicate missing data. When reading grids, the format is generally automatically recognized. If not, the same suffix can be added to input grid file names. See \fBgrdreformat\fP(1) and Section 4.17 of the GMT Technical Reference and Cookbook for more information. .P When reading a netCDF file that contains multiple grids, \fBGMT\fP will read, by default, the first 2-dimensional grid that can find in that file. To coax \fBGMT\fP into reading another multi-dimensional variable in the grid file, append \fB?\fP\fIvarname\fP to the file name, where \fIvarname\fP is the name of the variable. Note that you may need to escape the special meaning of \fB?\fP in your shell program by putting a backslash in front of it, or by placing the filename and suffix between quotes or double quotes. The \fB?\fP\fIvarname\fP suffix can also be used for output grids to specify a variable name different from the default: "z". See \fBgrdreformat\fP(1) and Section 4.18 of the GMT Technical Reference and Cookbook for more information, particularly on how to read splices of 3-, 4-, or 5-dimensional grids. .SH EXAMPLES To set all values > 70 to NaN and all values < 0 to 0 in file data.grd: .sp \fBgrdclip\fP data.grd \fB\-G\fP new_data.grd \fB\-Sa\fP 70/NaN \fB\-Sb\fP 0/0 \fB\-V\fP .SH "SEE ALSO" .IR GMT (1), .IR grdlandmask (1), .IR grdmask (1), .IR grdmath (1), .IR grd2xyz (1), .IR xyz2grd (1)