grdcut(1gmt)


NAME

   grdcut - Extract subregion from a grid

SYNOPSIS

   grdcut ingrid  -Goutgrid
    -Rregion [  -N[nodata] ] [  -S[n]lon/lat/radius[unit] ] [  -V[level] ]
   [  -Z[n|r]min/max ] [ -fflags ]

   Note: No space is allowed between the option flag  and  the  associated
   arguments.

DESCRIPTION

   grdcut  will produce a new outgrid file which is a subregion of ingrid.
   The subregion is specified with -R as in other programs; the  specified
   range  must  not exceed the range of ingrid (but see -N).  If in doubt,
   run  grdinfo  to  check  range.  Alternatively,  define  the  subregion
   indirectly via a range check on the node values or via distances from a
   given point. Complementary to grdcut there is grdpaste, which will join
   together two grid files along a common edge.

REQUIRED ARGUMENTS

   ingrid This is the input grid file.

   -Goutgrid
          This is the output grid file.

OPTIONAL ARGUMENTS

   -N[nodata]
          Allow grid to be extended if new -R exceeds existing boundaries.
          Append nodata value to initialize nodes outside  current  region
          [Default is NaN].

   -R[unit]xmin/xmax/ymin/ymax[r] (more ...)
          Specify the region of interest. This defines the subregion to be
          cut out.

   -S[n]lon/lat/radius[unit]
          Specify an origin and radius; append a distance unit (see UNITS)
          and  we  determine  the corresponding rectangular region so that
          all grid nodes on or inside the  circle  are  contained  in  the
          subset.  If  -Sn  is used we set all nodes outside the circle to
          NaN.

   -V[level] (more ...)
          Select verbosity level [c].

   -Z[n|r]min/max
          Determine the new rectangular region so that all  nodes  outside
          this  region  are also outside the given z-range [-inf/+inf]. To
          indicate no limit on min or max, specify a hyphen (-). Normally,
          any  NaNs  encountered  are simply skipped and not considered in
          the decision.  Use -Zn to consider  a  NaN  to  be  outside  the
          z-range.   This   means   the   new  subset  will  be  NaN-free.
          Alternatively, use -Zr to consider NaNs to be  within  the  data
          range.  In this case we stop shrinking the boundaries once a NaN
          is found [Default  simply  skips  NaNs  when  making  the  range
          decision].

   -f[i|o]colinfo (more ...)
          Specify data types of input and/or output columns.

   -^ or just -
          Print  a  short  message  about  the syntax of the command, then
          exits (NOTE: on Windows use just -).

   -+ or just +
          Print  an  extensive  usage  (help)   message,   including   the
          explanation  of  any  module-specific  option  (but  not the GMT
          common options), then exits.

   -? or no arguments
          Print a complete usage (help) message, including the explanation
          of options, then exits.

UNITS

   For  map distance unit, append unit d for arc degree, m for arc minute,
   and s for arc second, or e for meter [Default], f for foot, k for km, M
   for  statute  mile,  n  for nautical mile, and u for US survey foot. By
   default we compute such distances using a spherical approximation  with
   great  circles.  Prepend - to a distance (or the unit is no distance is
   given) to perform "Flat Earth" calculations (quicker but less accurate)
   or  prepend  +  to perform exact geodesic calculations (slower but more
   accurate).

GRID FILE FORMATS

   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 ...)

GEOGRAPHICAL AND TIME COORDINATES

   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 -f or -R  options.  For  example,  both
   -f0x  -f1t  and  -R90w/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  unit
   attribute of the time variable will indicate both this unit and epoch.

EXAMPLES

   Suppose  you  have  used  surface  to  grid  ship gravity in the region
   between 148E - 162E and 8N - 32N, and you do  not  trust  the  gridding
   near  the  edges, so you want to keep only the area between 150E - 160E
   and 10N - 30N, then:

          gmt grdcut grav_148_162_8_32.nc -Ggrav_150_160_10_30.nc -R150/160/10/30 -V

   To return the subregion of a grid such that any boundary  strips  where
   all values are entirely above 0 are excluded, try

          gmt grdcut bathy.nc -Gtrimmed_bathy.nc -Z-/0 -V

   To  return  the  subregion  of  a grid that contains all nodes within a
   distance of 500 km from the point 45,30 try

          gmt grdcut bathy.nc -Gsubset_bathy.nc -S45/30/500k -V

SEE ALSO

   gmt, grdclip, grdpaste, grdinfo

COPYRIGHT

   2016, P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe





Opportunity


Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.

Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.





Free Software


Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.


Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.





Free Books


The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.


Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.





Education


Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.


Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.