.\" Man page generated from reStructuredText. . .TH "GRDCLIP" "1gmt" "Jan 10, 2019" "5.4.5" "GMT" .SH NAME grdclip \- Clip the range of grids . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .SH SYNOPSIS .sp \fBgrdclip\fP \fIingrid\fP \fB\-G\fP\fIoutgrid\fP [ \fB\-R\fP\fIregion\fP ] [ \fB\-S\fP\fBa\fP\fIhigh/above\fP ] [ \fB\-S\fP\fBb\fP\fIlow/below\fP ] [ \fB\-S\fP\fBi\fP\fIlow/high/between\fP ] [ \fB\-S\fP\fBr\fP\fIold/new\fP ] [ \fB\-V\fP[\fIlevel\fP] ] .sp \fBNote:\fP No space is allowed between the option flag and the associated arguments. .SH DESCRIPTION .sp \fBgrdclip\fP will set values < \fIlow\fP to \fIbelow\fP and/or values > \fIhigh\fP to \fIabove\fP\&. You can also specify one or more intervals where all values should be set to IT(between), or replace individual values. Such operations are useful when you want all of a continent or an ocean to fall into one color or gray shade in image processing, when clipping of the range of data values is required, or for reclassification of data values. \fIabove\fP, \fIbelow\fP, \fIbetween\fP, \fIold\fP and \fInew\fP can be any number or even NaN (Not a Number). You must choose at least one of the \fB\-S\fP options. Use \fB\-R\fP to only extract a subset of the \fIingrid\fP file. .SH REQUIRED ARGUMENTS .INDENT 0.0 .TP .B \fIingrid\fP The input 2\-D binary grid file. .UNINDENT .INDENT 0.0 .TP \fB\-G\fP\fIoutgrid\fP \fIoutgrid\fP is the modified output grid file. .UNINDENT .SH OPTIONAL ARGUMENTS .INDENT 0.0 .TP \fB\-R\fP\fIxmin\fP/\fIxmax\fP/\fIymin\fP/\fIymax\fP[\fB+r\fP][\fB+u\fP\fIunit\fP] (more ...) Specify the region of interest. Using the \fB\-R\fP option will select a subsection of \fIingrid\fP grid. If this subsection exceeds the boundaries of the grid, only the common region will be extracted. .UNINDENT .INDENT 0.0 .TP \fB\-Sa\fP\fIhigh/above\fP Set all data[i] > \fIhigh\fP to \fIabove\fP\&. .TP \fB\-Sb\fP\fIlow/below\fP Set all data[i] < \fIlow\fP to \fIbelow\fP\&. .TP \fB\-Si\fP\fIlow/high/between\fP Set all data[i] >= \fIlow\fP and <= \fIhigh\fP to \fIbetween\fP\&. Repeat the option for as many intervals as are needed. .TP \fB\-Sr\fP\fIold/new\fP Set all data[i] == \fIold\fP to \fInew\fP\&. This is mostly useful when your data are known to be integer values. Repeat the option for as many replacements as are needed. .UNINDENT .INDENT 0.0 .TP \fB\-V\fP[\fIlevel\fP] (more ...) Select verbosity level [c]. .UNINDENT .INDENT 0.0 .TP \fB\-^\fP or just \fB\-\fP Print a short message about the syntax of the command, then exits (NOTE: on Windows just use \fB\-\fP). .TP \fB\-+\fP or just \fB+\fP Print an extensive usage (help) message, including the explanation of any module\-specific option (but not the GMT common options), then exits. .TP \fB\-?\fP or no arguments Print a complete usage (help) message, including the explanation of all options, then exits. .UNINDENT .SH GRID FILE FORMATS .sp By default GMT writes out grid as single precision floats in a COARDS\-complaint netCDF file format. However, GMT 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 1\- or 2\-byte integers. (more ...) .SH EXAMPLES .sp To set all values > 70 to NaN and all values < 0 to 0 in file data.nc: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gmt grdclip data.nc \-Gnew_data.nc \-Sa70/NaN \-Sb0/0 \-V .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp To reclassify all values in the 25\-30 range to 99, those in 35\-39 to 55, exchange 17 for 11 and all values < 10 to 0 in file classes.nc, try .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gmt grdclip classes.nc \-Gnew_classes.nc \-Si25/30/99 \-Si35/39/55 \-Sr17/11 \-Sb10/0 \-V .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .SH SEE ALSO .sp gmt, grdlandmask, grdmask, grdmath, grd2xyz, xyz2grd .SH COPYRIGHT 2019, P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe .\" Generated by docutils manpage writer. .