Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

grd2cpt(1gmt) [debian man page]

GRD2CPT(l)																GRD2CPT(l)

NAME
grd2cpt - Read a grdfile and make a color palette file SYNOPSIS
grd2cpt grdfile [ -Ccptmaster ] [ -I ] [ -Lminlimit/maxlimit ] [ -Szstart/zstop/zinc ] [ -V ] [ -Z ] DESCRIPTION
grd2cpt reads a grdfile and writes a color palette (cpt) file to standard output. The cpt file is based on an existing master cptfile of your choice, and the mapping from data value to colors is through the data's cumulative distribution function (CDF), so that the colors are' histogram equalized. Thus if the resulting cpt file is used with the grdfile and grdimage with a linear projection, the colors will be uniformly distributed in area on the plot. Let z be the data values in the grdfile. Define CDF(Z) = (# of z < Z) / (# of z in grdfile). (NaNs are ignored). These z-values are then normalized to the master cptfile and colors are sampled at the desired intervals. grdfile The 2-D binary grdfile used to derive the color palette table. OPTIONS
-C Selects the master color table to use in the interpolation. Choose among the built-in tables (type grd2cpt to see the list) or give the name of an existing cptfile [Default gives a rainbow cpt file]. -I Reverses the sense of color progression in the master cptfile. -L Limit range of cptfile to minlimit/maxlimit, and don't count data' outside range when estimating CDF(Z). [Default uses min and max of data.] -S Set steps in cpt file. Calculate entries in cptfile from zstart to zstop in steps of (zinc). [Default chooses arbitrary values by a crazy scheme.] -V Verbose operation. This will write CDF(Z) estimates to stderr. [Default is silent.] -Z Will create a continuous color palette. [Default is discontinuous, i.e., constant color intervals] EXAMPLES
Sometimes you don't want to make a cpt file (yet) but would find it helpful' to know that 90% of your data lie between z1 and z2, something you cannot learn from grdinfo. So you can do this to see some points on the CDF(Z) curve (use -V option to see more): grd2cpt mydata.grd -V > /dev/null To make a cpt file with entries from 0 to 200 in steps of 20, and ignore data below zero in computing CDF(Z), and use the built-in master cptfile relief, try grd2cpt mydata.grd -Crelief -L0/10000 -S0/200/20 > mydata.cpt SEE ALSO
gmtdefaults(1gmt), gmt(1gmt), grdhisteq(1gmt), grdinfo(1gmt), makecpt(1gmt) 1 Jan 2004 GRD2CPT(l)

Check Out this Related Man Page

GRDIMAGE(l)															       GRDIMAGE(l)

NAME
grdimage - Create grayshaded or colored image from a 2-D netCDF grd file SYNOPSIS
grdimage grdfile -Ccptfile -Jparameters [ -Btickinfo ] [ -Edpi ] [ -G[f|b]rgb ] [ -Iintensfile] [ -K ] [ -M ] [ -O ] [ -P ] [ -Rwest/east/south/north[r] ] [ -Ssearch_radius ] [ -T[s] ] [ -U[/dx/dy/][label] ] [ -V ] [ -Xx-shift ] [ -Yy-shift ] [ -ccopies ] DESCRIPTION
grdimage reads a 2-D gridded file and produces a gray-shaded (or colored) map by assigning each contour interval a gray-shade (or color). Optionally, illumination may be added by providing a file with intensities in the (-1,+1) range. Values outside this range will be clipped. Such intensity files can be created from the grdfile using grdgradient and modified by grdmath or grdhisteq. Each grid-node in the grdfile is represented as a shaded (or colored) rectangle centered on the grid node. When using map projections, the grid is first resampled on a new rectangular grid (This can be a time-consuming process for large grid files; but see -T). A 24-bit true color PostScript file is out- put. The region option can be used to select a map region larger or smaller than that implied by the extent of the grdfile. grdfile 2-D gridded data set to be imaged -C name of the color palette table -J Selects the map projection. Scale is UNIT/degree, 1:xxxxx, or width in UNIT (upper case modifier). UNIT is cm, inch, or m, depend- ing on the MEASURE_UNIT setting in .gmtdefaults, but this can be overridden on the command line by appending the c, i, or m to the scale/width value. CYLINDRICAL PROJECTIONS: -Jclon0/lat0/scale (Cassini) -Jjlon0/scale (Miller) -Jmscale (Mercator - Greenwich and Equator as origin) -Jmlon0/lat0/scale (Mercator - Give meridian and standard parallel) -Joalon0/lat0/azimuth/scale (Oblique Mercator - point and azimuth) -Joblon0/lat0/lon1/lat1/scale (Oblique Mercator - two points) -Joclon0/lat0/lonp/latp/scale (Oblique Mercator - point and pole) -Jqlon0/scale (Equidistant Cylindrical Projection (Plate Carree)) -Jtlon0/scale (TM - Transverse Mercator, with Equator as y = 0) -Jtlon0/lat0/scale (TM - Transverse Mercator, set origin) -Juzone/scale (UTM - Universal Transverse Mercator) -Jylon0/lats/scale (Basic Cylindrical Projection) AZIMUTHAL PROJECTIONS: -Jalon0/lat0/scale (Lambert). -Jelon0/lat0/scale (Equidistant). -Jflon0/lat0/horizon/scale (Gnomonic). -Jglon0/lat0/scale (Orthographic). -Jslon0/lat0/[slat/]scale (General Stereographic) CONIC PROJECTIONS: -Jblon0/lat0/lat1/lat2/scale (Albers) -Jdlon0/lat0/lat1/lat2/scale (Equidistant) -Jllon0/lat0/lat1/lat2/scale (Lambert) MISCELLANEOUS PROJECTIONS: -Jhlon0/scale (Hammer) -Jilon0/scale (Sinusoidal) -Jk[f|s]lon0/scale (Eckert IV (f) and VI (s)) -Jnlon0/scale (Robinson) -Jrlon0/scale (Winkel Tripel) -Jvlon0/scale (Van der Grinten) -Jwlon0/scale (Mollweide) NON-GEOGRAPHICAL PROJECTIONS: -Jp[a]scale[/origin] (polar (theta,r) coordinates, optional a for azimuths and offset theta [0]) -Jxx-scale[l|ppow][/y-scale[l|ppow]] (Linear, log, and power scaling) More details can be found in the psbasemap manpages. OPTIONS
No space between the option flag and the associated arguments. -B Sets map boundary tickmark intervals. See psbasemap for details. -E Sets the resolution of the projected grid that will be created if a map projection other than Linear or Mercator was selected. By default, the projected grid will be of the same size (rows and columns) as the input file. -G This option only applies when the resulting image otherwise would consist of only two colors: black(0) and white(255). If so, this option will instead use the image as a transparent mask and point the mask (or its inverse, with -Gb) with the given color combina- tion. -I Gives the name of a grdfile with intensities in the (-1,+1) range. [Default is no illumination]. -K More PostScript code will be appended later [Default terminates the plot system]. -M Force conversion to monochrome image using the (television) YIQ transformation. -bo Selects binary output. Append s for single precision [Default is double]. -P Selects Portrait plotting mode [GMT Default is Landscape, see gmtdefaults to change this]. -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. You may ask for a larger w/e/s/n region to have more room between the image and the axes. A smaller region than specified in the grdfile will result in a subset of the grid [Default is region given by the grdfile]. -S Set the search radius for the averaging procedure [Default avoids aliasing]. -T Plot image without any interpolation. This involves converting each node-centered bin into a polygon which is then painted sepa- rately. Append s to skip nodes with z = NaN. This option is useful for categorical data where interpolating between values is mean- ingless. -U Draw Unix System time stamp on plot. User may specify where the lower left corner of the stamp should fall on the page relative to lower left corner of plot. Optionally, append a label, or c (which will plot the command string.). The GMT parameters UNIX_TIME and UNIX_TIME_POS can affect the appearance; see the gmtdefaults man page for details. -V Selects verbose mode, which will send progress reports to stderr [Default runs "silently"]. -X -Y Shift origin of plot by (x-shift,y-shift). Prepend a for absolute coordinates; the default (r) will reset plot origin. -c Specifies the number of plot copies. [Default is 1] EXAMPLES
To gray-shade the file hawaii_grav.grd with shades given in shades.cpt on a Lambert map at 1.5 cm/degree along the standard parallels 18 and 24, and using 1 degree tickmarks, try grdimage hawaii_grav.grd -Jl18/24/1.5c -Cshades.cpt -B1 > hawaii_grav_image.ps To create an illuminated color PostScript plot of the gridded data set image.grd, using the intensities provided by the file intens.grd, and color levels in the file colors.cpt, with linear scaling at 10 inch/x-unit, tickmarks every 5 units, try grdimage image.grd -Jx10i -Ccolors.cpt -Iintens.grd -B5 > image.ps SEE ALSO
gmt(1gmt), grdcontour(1gmt), grdview(1gmt), grdgradient(1gmt), grdhisteq(1gmt) 1 Jan 2004 GRDIMAGE(l)
Man Page