ISIS Documentation

grid

Add a graticule or rectangular grid to the input image

This program superimposes a user-defined grid on an input image.

Two types of grids are available:
1. A graticule based on latitude and longitude coordinates where (MODE=GROUND).
2. A simple rectangular grid based on line and sample coordinates where (MODE=IMAGE).
Defaults:
  • MODE = GROUND
  • BASELAT = 0.0
  • BASELON = 0.0
  • LATINC = 10
  • LONINC = 10
Use the GROUND mode for images that have SPICE or map projection information. Use the IMAGE mode for images that do not have SPICE or map projection information, or to draw grid lines based on sample and line information.

The grid pattern will intersect a specific origin of either (latitude,longitude) or (sample,line) position. Grid lines are drawn at intervals from the origin based on the increment values defined by the user. The graticule produced may not match the image coordinates exactly, so the result will have outer grid cells that might have different heights and widths than the interior grid cells. In addition, if the LATINC and LONINC are too large compared with your image map scale, the grid lines may miss your image. If the increments are too small, the grid lines may be overly dense.

This application will draw grids on either ISIS level0, level1 (with successful spiceinit), and level2 cubes, or mosaics. The mapping information in the labels will be used to draw grid lines on mosaics and Level2 images. If the latitude and longitude information cannot be calculated or extracted using the image label contents, then use the IMAGE mode.

For Cubes with an associated band-dependent camera model (latitude, longitude coordinates do not correspond to the same sample, line coordinates in each band,) the grid is recalculated for each band.

Example Parameter Settings for Grids:
Example 1: Superimpose a basic latitude/longitude graticule with grid lines drawn every 10 degrees based on zero:
MODE=GROUND BASELAT=0 BASELON=0 LATINC=10 LONINC=10

Example 2: Superimpose a graticule on an input image that intersects at line 23 and sample 17, with vertical lines drawn every 30 pixels and horizontal lines every 40 pixels:
MODE=IMAGE BASELINE=23 BASESAMPLE=17 SINC=30 LINC=40
Note: MODE=GROUND cannot be used when sample and line coordinates are used.

Example 3: Superimpose a latitude/longitude graticule with a grid intersection at -5.0 degree latitude and 140.0 degree longitude, with latitude lines drawn every 2.5 degrees and longitude lines drawn every 3 degrees:
MODE=GROUND BASELAT=-5.0 BASELON=140 LATINC=2.5 LONINC=3

Example 4: Superimpose a latitude/longitude graticule within a subarea of an image (full latitude and longitude extent), with a grid line drawn every 2.5 degrees between latitudes -8 and -1 degrees and only between longitudes 140 and 145 degrees:
MODE=GROUND BASELAT=0 BASELON=0 LATINC=2.5 LONINC=2.5 MINLAT=-8 MAXLAT=-1 MINLON=140 MAXLON=145 Bound=yes

For complex grids, the grid application can be run multiple times with different parameter settings for each successive run that builds onto the previous output file. The TICKS option can be used to draw short ticks instead of grid lines. The OUTLINE option will draw grid lines along the outside edges of the first and last samples and lines of the input file. The BOUNDARY option will either draw grid lines around the outside edges of the input file or around the bounding box specified by the user with MINLAT, MAXLAT, MINLON, and MAXLON parameters.


Categories


Related Objects and Documents

Applications


History

Sean Crosby2007-03-16 Original version
Steven Lambright2007-07-27 Added category: Map Projection
Steven Lambright2008-04-22 Fixed problems with mapping outside of the projection space and with 0lat/0lon boundaries.
Steven Lambright2008-05-12 Removed references to CubeInfo
Steven Lambright2008-06-12 Added outline option
Steven Lambright2009-01-06 Changed how mode=ground works
Steven Lambright2010-05-06 Added TICKS options
Steven Lambright2010-07-22 Added LINEWIDTH option
Mackenzie Boyd2011-01-21 Added more line options, to change output to be HRS, LRS, NULL, or a DN.
Steven Lambright2011-01-25 Bug fixes for projections that use PositiveWest or Planetographic coordinate systems. The BASELAT and BASELON parameters are now expected to be in the units of the projection (if your cube has a planetographic latitude system, and baselat=50, then there will be a line at the planetographic latitude of 50).
Steven Lambright2011-01-26 Added BOUNDARY, MINLAT, MAXLAT, MINLON and MAXLON options.
Steven Lambright2011-12-08 Fixed a bug with the outline option. If the image had a larger number of samples than number of lines, all of the data at sample > number of lines would be considered a grid line. This could result in a large portion of the image losing legitimate DN values for the grid value. Fixes #607.
Steven Lambright2012-01-04 Tested and documented for the January 2012 release. The documentation updates included were recommended by Chris Isbell.
Adam Licht2012-12-26 Added functionality to choose the source of image background. Pixel Values for behind the grid can now be the image pixel value, HRS, LRS, NULL, or a DN.
Steven Lambright2012-12-31 Incorporated Adam Licht's changes into Isis. This included re-formatting to match current Isis 3 coding standards, removal of error checking of conditions that cannot happen, fixes with running in batch mode/resetting of variable states between runs, some re-positioning of parameter locations, and creating tests. These changes shouldn't break any existing scripts that utilize grid. Fixes #917.
Moses Milazzo2013-03-24 Added to documentation to alert the user to the fact that providing a poorly chosen starting point or grid increment may result in unexpected behavior. Fixes #178.
Ella Mae Lee2013-07-18 Updated the documentation and added examples. Fixes #178.
Janet Barrett2014-06-23 Modified so that the output cube characteristics are obtained from the input cube and/or cube characteristics specified on the command line. Fixes #2063.
Kristin Berry2014-11-25 Modified to work on Cubes with associated band-dependent camera models. Now when MODE="GROUND" on a Cube with a band-dependent camera model, the grid will be re-calculated for each band. Fixes #2191.
Kristin Berry2017-02-16 Fixed error introduced in last change which caused grid to no longer work on multi-band cubes without camera models (for example: a mosaic will not have a camera model.) Fixes #4586.
Jesse Mapel2017-06-26 Added a flag to extend the grid past the longitude domain boundary. Fixes #2185.
Kaitlyn Lee2020-10-26 Converted application and tests for Gtest conversion.