landsat2acres

Description

landsat2acres de-interleaves a 4-band Band-Interleaved-by-Line (BIL) Landsat MSS raw tape file into four single-band ACRES-format 8-bit image files (<out>.band1 through <out>.band4).

CLI Options & Usage

landsat2acres -in <raw_landsat> -out <acres_prefix> [-rows <n>] [-cols <n>]
  • -in <raw_landsat>: Input 4-band BIL Landsat image (with 90-byte header).
  • -out <acres_prefix>: Output prefix producing <acres_prefix>.band1, .band2, .band3, and .band4.
  • -rows <n>: Number of scanlines per band (default: 2400).
  • -cols <n>: Number of pixels per scanline (default: 3240).

Algorithm

  1. Reads the 90-byte header from <raw_landsat>, updates the 16-bit rows (header[4]) and cols (header[3]) fields, and writes the 90-byte ACRES header to all four output .band1..4 files.
  2. Iterates over 0 .. rows-1, reading four consecutive cols-byte lines (band 1..4) per scanline row and writing each to its corresponding band file.