


ipw.to.grass            GRASS Reference Manual             ipw.to.grass



NAME
	ipw.to.grass - Converts IPW image file to GRASS raster map layer

SYNOPSIS
	ipw.to.grass
	ipw.to.grass help
	ipw.to.grass [-o] [ipw=name] map=name [mask=name] [multiplier=value] \
		[offset=value]

DESCRIPTION

	ipw.to.grass converts a single-band image file in IPW (Image
	Processing Workbench) format to a GRASS raster map layer.
	If an IPW image is not specified, standard input will be
	used.  If an IPW image is specified as a mask, all cells in the 
	GRASS map layer corresponding to the zero ("no data") values
	in the mask will be set to zero, regardless of the value
	in the IPW input image.

	Since GRASS cell values are integers, IPW image floating
	point values will be truncated to integer values, i.e.
	29.2 and 29.9 will both be set to 29 in the resulting
	GRASS cell file.  A multiplier and/or offset may be
	specified to convert the input IPW floating point pixel
	values to the GRASS integer values.  If both a multiplier
	and offset are specified, the data are first multiplied
	by the multiplier, then the offset will be added.

	In GRASS, the raster header specifies the north, south, east
	and west boundaries as the outer cell edges of the raster map.
	The data values are assumed to be located at the cell centers.
	Therefore, the data value for the northwestern-most cell (row 0,
	col 0) is georeferenced at northing NORTH-NSRES/2 and easting
	WEST+EWRES/2 (where NORTH is the northern edge of the raster,
	WEST is the western edge of the raster and NSRES and EWRES are
	the resolutions in the N/S and E/W directions, respectively). 
	In IPW the GEO header parameters bline and bsamp, analogous
	to NORTH and WEST, do not define the outer edge of the boundary
	cells (i.e. IPW pixels).  Instead they georeference the centers
	of the boundary cells.

	To translate the IPW image to a GRASS format, this half-cell
	difference of the georeferencing parameters is accounted for. 
	The geographic region stored in the header of the new GRASS
	raster will be set so that:

		NORTH = bline - dline/2
		SOUTH = NORTH + nlines * dline
		WEST = bsamp - dsamp/2
		EAST = WEST + nsamps * dsamp
		NSRES = -dline
		EWRES = dsamp

	[These equations are adjusted for input of lower left origin data.]
	where bline and bsamp are the beginning line and sample coordinates,
	and dline and dsamp are the line and sample increments from the
	IPW geodetic header.  nlines and nsamps are the number of lines
	and samples read from the IPW basic image header.  Thus unlike most
	GRASS commands, the current geographic region of your GRASS session
	is normally not used to set the boundaries or resolution of the new
	raster.  However, if the IPW image file does not include a GEO
	header, the current geographic region is used to define the
	geographic region of the new raster.

	The -o flag can be used to override reckoning of the
	half-resolution difference in the georeferencing parameters.  If the
	-o option is specified, NORTH will be set to bline and WEST will
	be set to bsamp without adjustment for the difference.  This option
	should be invoked only when evidence of spatial misregistration is
	apparent and understood (use only with extreme caution).



GRASS 4.0                U.S. Army CERL                         1






ipw.to.grass            GRASS Reference Manual             ipw.to.grass




	Flags:
	-o		    use the IPW GEO header origin (bline and bsamp)
			    to set the NORTH and WEST edge of the GRASS raster:
			    causes one-half cell resolution misregistration in
			    each direction (see discussion above)

	Parameters:

	ipw=name            IPW input image (defaults to standard input)
	map=name            output GRASS cell file
	mask=name           IPW mask image
	multiplier=value    multiply IPW datum by value (before offset)
			    default: 1.0
	offset=value        add to map datum (after multiplication)
			    default: 0.0

EXAMPLES
	The following command,

		ipw.to.grass ipw=ipwfile map=grasslayer multiplier=10.0 \
			offset=100.0

	will convert an IPW image called ipwfile to a GRASS map
	layer called  grasslayer, multiplying all input values by 10
	then adding 100 before storing in the GRASS output file.

	In the following command,

		demux -b 0 ipw.img | ipw.to.grass map=grass.out \
			mask=ipwmask offset=0.5

	the IPW command demux is used to extract band 0 from a multi-band
	IPW image file for input to ipw.to.grass.  The data are
	masked by the IPW mask image ipwmask.  The offset 0.5 is added to 
	each datum to cause rounding to the nearest integer when the value 
	is truncated.

	To convert an N-band IPW image into N GRASS cell files:

		demux -b 1 ipwfile | ipw.to.grass o=cell.1
			...
		demux -b N ipwfile | ipw.to.grass o=cell.N

NOTES

SEE ALSO
     James Edward Frew, Jr., The Image Processing Workbench

     Also read GRASS User's Reference Manual entries for:
     grass.to.ipw, g.region

AUTHOR
     Kelly Longley, Oregon State University, EPA Environmental
     Research Lab - Corvallis


GRASS 4.0                U.S. Army CERL                         2


