add_hilo

Description

add_hilo is part of the Chavez (1986) spatial-frequency destriping pipeline for ACRES-format Landsat MSS/TM imagery (written by A. Y. / JCU, May 1990). It recombines a high-pass filtered image (<prefix>.high) and a low-pass filtered image (<prefix>.low) generated by lsfilter into a single destriped 8-bit image (<prefix>.des).

CLI Options & Usage

add_hilo -in <prefix>
  • -in <prefix>: Base filename of the ACRES image. Opens <prefix>.high and <prefix>.low for reading and creates <prefix>.des.

Algorithm

  1. Reads the 90-byte ACRES header from <prefix>.high (extracting row = header[4] and col = header[3]), copies the header to <prefix>.des, and skips the header of <prefix>.low.
  2. For every pixel across all row × col samples:
    • Evaluates sum = high_pixel + low_pixel - 128 (removing the 128 DC offset added to negative high-pass residuals by lsfilter).
    • Clamps sum to [1, 255] (0 is reserved for masked/cloud pixels where high == 0 && low == 0, which remain 0).
  3. Writes the reconstructed scanlines to <prefix>.des for subsequent artifact limiting via limit_change and cloud restoration via replacecloud.