rivshrink


rivshrink infile outfile factor [-s]


Description

rivshrink shrinks the RivaFile infile by averaging factor squared tiles of pixels down to single pixels. If -s is specified, the shrunken data is taken by sampling instead of averaging. The shrunken data is written to outfile. infile's RivaFile header is copied to outfile, and the NS, NL, and PIXMETERS fields are updated. factor must be an integer greater than 1.

rivshrink can shrink DEMs if BPP=1 or BPP=2, and other images for any value of BPP. If infile is a DEM with BPP=2, the pixels in outfile will invariably be in Unix order (SUNFORMAT=1).

Usage

The following listing shows how to shrink 'dem.riv' by a factor of 2 in each direction:
% rivheader dem.riv RivaFile: dem.riv LBLSIZE=1024 TYPE='DEM' NL=171 NS=98 BPP=2 SUNFORMAT=1 PROJECTION='CYLINDRICAL' LONG0=-117.917 LAT0=38.4167 LONG1=-114.667 LAT1=33.6667 PIXMETERS=30.9 ZMETERS=1 ZDELTA=100 % rivshrink dem.riv demsmall.riv 2 rivshrink: shrinking RivaFile dem.riv rivshrink: shrink by a factor of 2 rivshrink: creating RivaFile demsmall.riv Shrinking a DEM. rivshrink: new size is 49 x 86 % rivheader dem.riv RivaFile: demsmall.riv LBLSIZE=1024 TYPE='DEM' NL=86 NS=49 BPP=2 SUNFORMAT=1 PROJECTION='CYLINDRICAL' LONG0=-117.917 LAT0=38.4167 LONG1=-114.667 LAT1=33.6667 PIXMETERS=61.8 ZMETERS=1 ZDELTA=100 %

See Also

RivaFile Format, rivheader.

Privacy / Copyrights
FIRST GOV   NASA Home Page This page, http://pat.jpl.nasa.gov/RIVA//public/RIVA/rivshrink.html, is maintained by Peggy Li and was last modified Friday, 15-Aug-2003 11:54:23 PDT, CL 03-2169
spacer