rivrange


rivrange infile outfile top bottom left right


Description

rivrange extracts a rectangular region from the RivaFile infile and saves it in the RivaFile outfile. The rest of the RivaFile header is copied, and the NS and NL fields are updated with their new values. top and bottom are the starting and ending row indices; top must be less than bottom, and both must be less than NL. left and right are the starting and ending column indices; left must be less than right, and both must be less than NS.

Usage

The following listing shows how to extract a 15x15 pixel region from 'dem.riv':
% 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 % rivrange dem.riv demnew.riv 11 25 21 35 rivrange: extracting RivaFile dem.riv rivrange: creating RivaFile demnew.riv % rivheader demnew.riv RivaFile: demnew.riv LBLSIZE=1024 TYPE='DEM' NL=15 NS=15 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 %

Known Bugs

rivrange ignores the presence of the latitude/longitude boundary fields LONG0, LAT0, LONG1, and LAT1, and does not update them properly. In the example above, note that 'dem2.riv' is only a small part of 'dem.riv', but incorrectly has the same latitude/longitude boundary.

See Also

RivaFile Format, rivheader.

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