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
- Angle Range Setup:
- The
minangandmaxangparameters (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
ratearray is calculated for each possible grazing angle DN value. Thisrateis higher for angles closer to thecentreang(midpoint ofminangandmaxang), creating a weighting function.
- The
- 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_headerto get image dimensions (cols,rows) and then loads the entire image data into memory.
- The tool processes up to 10 pairs of backscatter (
- Stacking Process:
- An output
stackimage and aweightimage are initialized.stackwill store the final backscatter values, andweightwill store the “rate” of the source image that contributed that pixel, ensuring that higher-priority (closer tocentreang) 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 theminangandmaxangrange:- It checks if the
rateof the current input pixel’s grazing angle is greater than theweightalready stored in theweightarray 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 thestackimage, and the currentrateis stored in theweightarray.
- It checks if the
- If the grazing angle pixel (
- An output
- Output: After processing all input mosaics, the final
stackimage is written to the output file specified by-outstack.