PSMASK(1)

NAME
psmask - To clip or mask areas of no data on a map

SYNOPSIS
psmask [xyzfile] -Ixinc[unit][=|+][/yinc[unit][=|+]] -Jparameters -Rwest/east/south/north[r] [ -B[p|s]parameters ] [ -Ddumpfile ] [ -Eazimuth/elevation ] [ -F ] [ -Gfill ] [ -H[i][nrec] ] [ -K ] [ -M[flag] ] [ -N ] [ -O ] [ -P ] [ -Ssearch_radius[m|c|k|K] ] [ -T ] [ -U[/dx/dy/][label] ] [ -V ] [ -X[a|c|r][x-shift[u]] ] [ -Y[a|c|r][y-shift[u]] ] [ -ccopies ] [ -:[i|o] ] [ -bi[s|S|d|D][ncol] ]

psmask -C [ -K ] [ -O ]

DESCRIPTION
psmask reads a (x,y,z) file [or standard input] and uses this information to find out which grid cells are reliable. Only gridcells which have one or more data points are considered reliable. As an option, you may specify a radius of influence. Then, all gridcells that are within radius of a data point are considered reliable. Furthermore, an option is provided to reverse the sense of the test. Having found the reliable/not reliable points, psmask will either paint tiles to mask these nodes (with the -T switch), or use contouring to create polygons that will clip out regions of no interest. When clipping is initiated, it will stay in effect until turned off by a second call to psmask using the -C option.

xyzfile
    File with (x,y,z) values (e.g., that was used to run surface). If no file is given, standard input is read. For binary files, see -b.

-I  x_inc [and optionally y_inc] is the grid spacing. Append m to indicate minutes or c to indicate seconds. If one of the units e, k, i, or n is appended instead, the increment will be assumed to be in meter, km, miles, or nautical miles, respectively, and will be converted to the equivalent degrees longitude at the middle latitude of the region (the conversion depends on ELLIPSOID). If /y_inc is given but set to 0 it will be reset equal to x_inc; otherwise it will be converted to degrees latitude. If = is appended then the corresponding max x (east) or y (north) may be slightly adjusted to fit exactly the given increment [by default the increment may be adjusted slightly to fit the given domain]. Finally, instead of giving an increment you may specify the number of nodes desired by appending + to the supplied increment; the increment is then recalculated from the number of nodes and the domain. The resulting increment value depends on whether you have selected a gridline-registered or pixel- registered grid; see Appendix B for details.

-J  Selects the map projection. Scale is UNIT/degree, 1:xxxxx, or width in UNIT (upper case modifier). UNIT is cm, inch, or m, depending on the MEASURE_UNIT setting in .gmtdefaults4, but this can be overridden on the command line by appending c, i, or m to the scale/width value. For map height, max dimension, or min dimension, append h, +, or - to the width, respectively.
    More details can be found in the psbasemap man pages.

    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][r|z] (Polar coordinates (theta,r))
    -Jxx-scale[d|l|ppow|t|T][/y-scale[d|l|ppow|t|T]] (Linear, log, and power scaling)

-R  xmin, xmax, ymin, and ymax specify the Region of interest. For geographic regions, these limits correspond to west, east, south, and north and you may specify them in decimal degrees or in [+-]dd:mm[:ss.xxx][W|E|S|N] format. Append r if lower left and upper right map coordinates are given instead of wesn. The two shorthands -Rg -Rd stand for global domain (0/360 or -180/+180 in longitude respectively, with -90/+90 in latitude). For calendar time coordinates you may either give relative time (relative to the selected TIME_EPOCH and in the selected TIME_UNIT; append t to -JX|x), or absolute time of the form [date]T[clock] (append T to -JX|x). At least one of date and clock must be present; the T is always required. The date string must be of the form [-]yyyy[-mm[-dd]] (Gregorian calendar) or yyyy[-Www[-d]] (ISO week calendar), while the clock string must be of the form hh:mm:ss[.xxx]. The use of delimiters and their type and positions must be as indicated (however, input/output and plotting formats are flexible).

OPTIONS
No space between the option flag and the associated arguments.

-B  Sets map boundary annotation and tickmark intervals; see the psbasemap man page for all the details.

-C  Mark end of existing clip path. No input file is needed. Implicitly sets -O.

-D  Dumps out the resulting clipping polygons to disk. Ignored if -T is set. If no dumpprefix is given we use mask (Files will be called mask_*.d).

-E  Sets the viewpoint's azimuth and elevation for perspective plots [180/90].

-F  Force pixel registration. [Default is grid registration].

-G  Paint the clip polygons [or tiles] with selected fill [Default is no fill]. Specify the grey shade (0-255) or color (r/g/b, each in range 0-255; h-s-v, ranges 0-360, 0-1, 0-1; or c/m/y/k, each in range 0-100%; or valid color name). Alternatively, specify -Gpdpi/pattern, where pattern gives the number of the built-in pattern (1-90) or the name of a Sun 1-, 8-, or 24-bit raster file. The dpi sets the resolution of the image. For 1-bit rasters: use -GP for inverse video, or append :Fcolor[B[color]] to specify fore- and background colors (use color = - for transparency). See GMT Cookbook & Technical Reference Appendix E for information on individual patterns.

-H  Input file(s) has Header record(s). Number of header records can be changed by editing your .gmtdefaults4 file. If used, GMT default is 1 header record. Use -Hi if only input data should have header records [Default will write out header records if the input data have them]. Not used with binary data.

-K  More PostScript code will be appended later [Default terminates the plot system].

-M  Multiple segment file(s). Segments are separated by a special record. For ASCII files the first character must be flag [Default is '>']. For binary files all fields must be NaN and -b must set the number of output columns explicitly. By default the -M setting applies to both input and output. Use -Mi and -Mo to give separate settings.

-N  Invert the sense of the test, i.e. clip regions where there is data coverage.

-O  Selects Overlay plot mode [Default initializes a new plot system].

-P  Selects Portrait plotting mode [GMT Default is Landscape, see gmtdefaults to change this].

-S  Sets radius of influence. Grid nodes within radius of a data point are considered reliable. [Default is 0, which means that only grid cells with data in them are reliable]. Append m to indicate minutes or c to indicate seconds. Append k to indicate km (implies -R and -I are in degrees, and we will use a fast flat Earth approximation to calculate distance). For more accuracy, use uppercase K if distances should be calculated along geodesics. However, if the current ELLIPSOID is set to Sphere then spherical great circle calculations are used.

-T  Plot tiles instead of clip polygons. Use -G to set tile color or pattern.

-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), and opetionally append units (c, i, m, p). Prepend a for absolute coordinates; the default (r) will reset plot origin. Give c to center plot using current page size.

-:  Toggles between (longitude,latitude) and (latitude,longitude) input and/or output. [Default is (longitude,latitude)]. Append i to select input only or o to select output only. [Default affects both].

-bi Selects binary input. Append s for single precision [Default is d (double)]. Uppercase S (or D) will force byte-swapping. Optionally, append ncol, the number of columns in your binary file if it exceeds the columns needed by the program. [Default is 2 input columns].

-c  Specifies the number of plot copies. [Default is 1].

EXAMPLES
To make an overlay PostScript file that will mask out the regions of a contour map where there is no control data using clip polygons, use:

psmask africa_grav.xyg -R20/40/20/40 -I5m -JM10i -O -K > mask.ps

The same example but this time we use white tiling:

psmask africa_grav.xyg -R20/40/20/40 -I5m -JM10i -T -O -K -G255 > mask.ps

SEE ALSO
GMT(1), grdmask(1), surface(1), psbasemap(1), psclip(1)