replacecloud
Description
replacecloud (written by A. Y. / JCU, May 1990) is the final step in the cloud-masked Landsat destriping pipeline. After removecloud, lsfilter, add_hilo, and limit_change have been run, replacecloud restores the original unclipped cloud pixels from <cloud_file> back into the destriped ACRES image (-in).
CLI Options & Usage
replacecloud -in <destriped_acres_file> -cloud <cloud_file>
-in <destriped_acres_file>: Destriped ACRES-format 8-bit image (updated in-place).-cloud <cloud_file>:.cloudfile previously extracted byremovecloud.
Algorithm
- Reads the 90-byte ACRES header from
<destriped_acres_file>to determinerowandcol, and skips the 90-byte header of<cloud_file>. - Scans all
row à colpixels in lockstep: wherever<cloud_file>contains a non-zero byte (c != 0), seeks back 1 byte in<destriped_acres_file>and overwrites the clamped pixel with the original cloud intensityc.