back_stack

Description

back_stack is a utility designed to stack together multiple backscatter strength and grazing angle mosaics into a single output image. The stacking process prioritizes pixels based on a calculated “rate” derived from the grazing angle, effectively giving preference to data from a narrowly defined range of grazing angles. This tool is part of a system for analyzing the angular dependence of backscatter, often used with mosaics generated by tools like mapbeam.

Usage

back_stack -outstack <name_prefix> [-minang <degrees>] [-maxang <degrees>]

Arguments

Option Description Default
-outstack <name_prefix> Required. Specifies the prefix for the output stacked image file. The output file will have a .stack extension. (None)
-minang <degrees> Defines the minimum grazing angle (in degrees) for the “narrowly defined range” that influences pixel prioritization. 30.0
-maxang <degrees> Defines the maximum grazing angle (in degrees) for the “narrowly defined range” that influences pixel prioritization. 60.0

How It Works

  1. Angle Range Setup:
    • The minang and maxang parameters (in degrees) define the preferred range of grazing angles.
    • These are internally converted to corresponding 8-bit digital number ranges (0-239 for 0-90 degrees, offset by 16).
    • A rate array is calculated for each possible grazing angle DN value. This rate is higher for angles closer to the centreang (midpoint of minang and maxang), creating a weighting function.
  2. Input Mosaic Loading:
    • The tool processes up to 10 pairs of backscatter (.mos) and grazing angle (.imping.mos) JHC image files. These filenames are hardcoded within the source (e.g., mos/line1_bksct.mos, mos/line1_imping.mos).
    • For each pair, it reads the JHC_header to get image dimensions (cols, rows) and then loads the entire image data into memory.
  3. Stacking Process:
    • An output stack image and a weight image are initialized. stack will store the final backscatter values, and weight will store the “rate” of the source image that contributed that pixel, ensuring that higher-priority (closer to centreang) data is kept.
    • The tool iterates through each of the 10 input image pairs, and for each pixel (i, j) in the image:
      • If the grazing angle pixel (graz_rec[i]) is valid (not 15) and its converted value falls within the minang and maxang range:
        • It checks if the rate of the current input pixel’s grazing angle is greater than the weight already stored in the weight array for that pixel location.
        • If it is greater, it means the current pixel comes from a more “preferred” grazing angle. So, the backscatter value from back_rec[i] is copied to the stack image, and the current rate is stored in the weight array.
  4. Output: After processing all input mosaics, the final stack image is written to the output file specified by -outstack.