czcs2acres
Description
czcs2acres de-interleaves a 4-band Band-Interleaved-by-Line (BIL) Nimbus-7 Coastal Zone Color Scanner (CZCS) raw image into four separate ACRES-format 8-bit raster files (<out>.band1 through <out>.band4).
CLI Options & Usage
czcs2acres -in <raw_czcs> -out <acres_prefix> [-rows <n>] [-cols <n>]
-in <raw_czcs>: Input 4-band BIL CZCS image file (begins with a 90-byte header followed by interleaved scanlines).-out <acres_prefix>: Output filename prefix generating<acres_prefix>.band1,.band2,.band3, and.band4.-rows <n>: Number of scanlines per band (default:970).-cols <n>: Number of pixels per scanline (default:1968).
Algorithm
- Reads the initial 90-byte header from
<raw_czcs>, writesrowsandcolsintoheader[4]andheader[3](16-bit integer fields), and writes this 90-byte ACRES header to each of the four output files (.band1...band4). - Loops through
0 .. rows-1; on each iteration, reads four consecutivecols-byte scanlines (one for each spectral bandk = 0..3) and writes each to its respective.band<k+1>output file.