.\" Man page generated from reStructuredText. . .TH "GRDEDIT" "1gmt" "Nov 05, 2016" "5.3.1" "GMT" .SH NAME grdedit \- Modify header or content of a grid . .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 \fBgrdedit\fP \fIgrid\fP [ \fB\-A\fP ] [ \fB\-C\fP ] [ \fB\-D\fP\fIxname\fP/\fIyname\fP/\fIzname\fP/\fIscale\fP/\fIoffset\fP/\fIinvalid\fP/\fItitle\fP/\fIremark\fP ] [ \fB\-E\fP[\fBa\fP|\fBh\fP|\fBl\fP|\fBr\fP|\fBt\fP|\fBv\fP] ] [ \fB\-G\fP\fIoutgrid\fP ] [ \fB\-J\fP\fIparameters\fP ] [ \fB\-N\fP\fItable\fP ] [ \fB\-R\fP\fIregion\fP ] [ \fB\-S\fP ] [ \fB\-T\fP ] [ \fB\-V\fP[\fIlevel\fP] ] [ \fB\-bi\fPbinary ] [ \fB\-di\fPnodata ] [ \fB\-f\fPflags ] [ \fB\-:\fP[\fBi\fP|\fBo\fP] ] .sp \fBNote:\fP No space is allowed between the option flag and the associated arguments. .SH DESCRIPTION .sp \fBgrdedit\fP reads the header information in a binary 2\-D grid file 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, and individual nodal values can be replaced from a table of \fIx\fP, \fIy\fP, \fIz\fP values. \fBgrdedit\fP only operates on files containing a grid header. Note: If it is important to retain the original data you should use \fB\-G\fP to save the modified grid to a new file. .SH REQUIRED ARGUMENTS .INDENT 0.0 .TP .B \fIgrid\fP Name of the 2\-D grid file to modify. (See GRID FILE FORMATS below). .UNINDENT .SH OPTIONAL ARGUMENTS .INDENT 0.0 .TP \fB\-A\fP If necessary, adjust the file\(aqs \fIx_inc\fP, \fIy_inc\fP to be compatible with its domain (or a new domain set with \fB\-R\fP). Older grid files (i.e., created prior to GMT 3.1) often had excessive slop in \fIx_inc\fP, \fIy_inc\fP and an adjustment is necessary. Newer files are created correctly. .UNINDENT .INDENT 0.0 .TP \fB\-C\fP Clear the command history from the grid header. .UNINDENT .INDENT 0.0 .TP \fB\-D\fP\fIxname\fP/\fIyname\fP/\fIzname\fP/\fIscale\fP/\fIoffset\fP/\fIinvalid\fP/\fItitle\fP/\fIremark\fP Give values for \fIxname\fP, \fIyname\fP, \fIzname\fP (give the names of those variables and in square bracket their units, e.g., "distance [km]"), \fIscale\fP (to multiply grid values after read [normally 1]), \fIoffset\fP (to add to grid after scaling [normally 0]), \fIinvalid\fP (a value to represent missing data [NaN]), \fItitle\fP (anything you like), and \fIremark\fP (anything you like). To leave some of these values untouched, leave field blank. Empty fields in the end may be skipped. Alternatively, to allow "/" to be part of one of the values, use any non\-alphanumeric character (and not the equal sign) as separator by both starting and ending with it. For example: \fB\-D\fP:\fIxname\fP:\fIyname\fP:\fIzname\fP:\fIscale\fP:\fIoffset\fP:\fIinvalid\fP:\fItitle\fP:\fIremark\fP: Use quotes to group texts with more than one word. Note that for geographic grids (\fB\-fg\fP) \fIxname\fP and \fIyname\fP are set automatically. .UNINDENT .INDENT 0.0 .TP \fB\-E\fP[\fBa\fP|\fBh\fP|\fBl\fP|\fBr\fP|\fBt\fP|\fBv\fP] Transform the grid in one of six ways and (for \fBl\fP|\fBr\fP|\fBt\fP) interchange the \fIx\fP and \fIy\fP information: \fB\-Ea\fP will rotate the grid around 180 degrees, \fB\-Eh\fP will flip the grid horizontally (left\-to\-right), \fB\-El\fP will rotate the grid 90 degrees counter\-clockwise (left), \fB\-Er\fP will rotate the grid 90 degrees clockwise (right), \fB\-Et\fP will transpose the grid [Default], \fB\-Ev\fP will flip the grid vertically (top\-to\-bottom). Incompatible with the other options (except \fB\-G\fP). .UNINDENT .INDENT 0.0 .TP \fB\-G\fP\fIoutgrid\fP Normally, grdedit will overwrite the existing grid with the modified grid. Use \fB\-G\fP to write the modified grid to the file \fIoutgrid\fP instead. .UNINDENT .INDENT 0.0 .TP \fB\-J\fP\fIparameters\fP (more ...) Select map projection. Use the \fB\-J\fP syntax to save the georeferencing info as CF\-1 compliant metadata in netCDF grids. This metadata will be recognized by GDAL. .UNINDENT .INDENT 0.0 .TP \fB\-N\fP\fItable\fP Read the ASCII (or binary; see \fB\-bi\fP) file \fItable\fP and replace the corresponding nodal values in the grid with these \fIx\fP,\fIy\fP,\fIz\fP values. .UNINDENT .INDENT 0.0 .TP \fB\-R\fP[\fIunit\fP]\fIxmin\fP/\fIxmax\fP/\fIymin\fP/\fIymax\fP[\fBr\fP] (more ...) Specify the region of interest. The new w/e/s/n values will replace those in the grid, and the \fIx_inc\fP, \fIy_inc\fP values are adjusted, if necessary. .UNINDENT .INDENT 0.0 .TP \fB\-S\fP For global, geographical grids only. Grid values will be shifted longitudinally according to the new borders given in \fB\-R\fP\&. .UNINDENT .INDENT 0.0 .TP \fB\-T\fP Make necessary changes in the header to convert a gridline\-registered grid to a pixel\-registered grid, or vice\-versa. Basically, gridline\-registered grids will have their domain extended by half the x\- and y\-increments whereas pixel\-registered grids will have their domain shrunk by the same amount. .UNINDENT .INDENT 0.0 .TP \fB\-V\fP[\fIlevel\fP] (more ...) Select verbosity level [c]. .UNINDENT .INDENT 0.0 .TP \fB\-bi\fP[\fIncols\fP][\fBt\fP] (more ...) Select native binary input. [Default is 3 input columns]. .UNINDENT .INDENT 0.0 .TP \fB\-di\fP\fInodata\fP (more ...) Replace input columns that equal \fInodata\fP with NaN. .UNINDENT .INDENT 0.0 .TP \fB\-f\fP[\fBi\fP|\fBo\fP]\fIcolinfo\fP (more ...) Specify data types of input and/or output columns. .UNINDENT .INDENT 0.0 .TP \fB\-h\fP[\fBi\fP|\fBo\fP][\fIn\fP][\fB+c\fP][\fB+d\fP][\fB+r\fP\fIremark\fP][\fB+r\fP\fItitle\fP] (more ...) Skip or produce header record(s). .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 use just \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 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 GEOGRAPHICAL AND TIME COORDINATES .sp When the output grid type is netCDF, the coordinates will be labeled "longitude", "latitude", or "time" based on the attributes of the input data or grid (if any) or on the \fB\-f\fP or \fB\-R\fP options. For example, both \fB\-f0x\fP \fB\-f1t\fP and \fB\-R\fP90w/90e/0t/3t will result in a longitude/time grid. When the x, y, or z coordinate is time, it will be stored in the grid as relative time since epoch as specified by TIME_UNIT and TIME_EPOCH in the gmt.conf file or on the command line. In addition, the \fBunit\fP attribute of the time variable will indicate both this unit and epoch. .SH EXAMPLES .sp Let us assume the file data.nc 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 .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gmt grdedit data.nc \-R\-60/\-50/10/30 \-D//////"Gravity Anomalies" .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp The grid world.nc has the limits 0/360/\-72/72. To shift the data so that the limits would be \-180/180/\-72/72, use .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gmt grdedit world.nc \-R\-180/180/\-72/72 \-S .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp The file junk.nc was created prior to GMT 3.1 with incompatible \fB\-R\fP and \fB\-I\fP arguments. To reset the x\- and y\-increments we run .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gmt grdedit junk.nc \-A .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp The file junk.nc was created prior to GMT 4.1.3 and does not contain the required information to indicate that the grid is geographic. To add this information, run .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gmt grdedit junk.nc \-fg .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp To rotate the grid oblique.nc 90 degrees counter\-clockwise and write out the rotated grid to a new file, run .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gmt grdedit oblique.nc \-El \-Goblique_rot.nc .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .SH SEE ALSO .sp gmt, grd2xyz, grdinfo xyz2grd .SH COPYRIGHT 2016, P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe .\" Generated by docutils manpage writer. .