build_back
Description
build_back is a utility designed to analyze the relationship between backscatter strength and grazing angle by constructing a density plot (or βtableβ) and deriving statistical information. It processes backscatter and grazing angle data from multiple JCU GLORIA files, calculates the mean and standard deviation of backscatter for various grazing angle bins, and outputs this information as both a visual table and an ASCII file. An option for histogram equalization is also available.
Usage
build_back [-table <prefix>] [-eq] [-first <record>] [-last <record>]
Interactive prompts: The tool will interactively ask for input backscatter and impinging (grazing) angle filenames.
Arguments
| Option | Description |
|---|---|
-table <prefix> | Required. Specifies a prefix for output files. The tool will generate: <prefix>.table (image), <prefix>.mean (ASCII stats), and <prefix>.resp (response function). |
-eq | If specified, histogram equalization will be applied to the table_pointer data, normalizing the density so itβs not a function of the number of values in each grazing angle bin. |
-first <record> | Specifies the first record number to include in the statistical analysis. |
-last <record> | Specifies the last record number to include in the statistical analysis. |
How It Works
- Initialization:
- A 2D array
table_pointer[241][481]is initialized. This array will represent the density of backscatter (y-axis, 0-240 DN) versus grazing angle (x-axis, -90 to 90 degrees, mapped to 0-480 bins). - Arrays for
aver,std_dev,sum,sum_weight, andmax_weightare initialized for statistical calculations. - Output files (
.table,.mean,.resp) are opened.
- A 2D array
- Interactive Input: The tool repeatedly prompts the user to enter paths for backscatter and impinging angle files.
- Data Accumulation: For each pair of input files provided:
- It reads each GLORIA record from both the backscatter and grazing angle files.
- For each pixel in the record, it extracts
back_stbd/back_portandgraz_stbd/graz_portvalues. - If a pixelβs backscatter and grazing angle values are valid (typically > 15), it increments a counter in the
table_pointerarray at the corresponding backscatter and grazing angle bin.
- Mean and Standard Deviation Calculation:
- After accumulating all data, for each grazing angle bin (
ifrom 0 to 480):- Mean Backscatter (
aver[i]): Calculated by summingj * (count_at_j)for all backscatter valuesjin that grazing angle bin, divided by the totalsum_weight. - Standard Deviation (
std_dev[i]): Calculated from the squared differences between each backscatter value and the mean, weighted bycount_at_j.
- Mean Backscatter (
- After accumulating all data, for each grazing angle bin (
- Histogram Equalization (Optional): If
-eqis specified, the counts intable_pointerare equalized to normalize the density across different grazing angle bins. - Output Table Generation:
- The
table_pointerarray is visually enhanced by marking theaverline (value 3) andaver +/- std_devlines (value 4, with neighbors at value 5). - A
JHC_header(table_head) is created defining the dimensions and ranges of the output table image. - The
table_headand the populatedtable_pointerarray are written to the<prefix>.tablefile.
- The
- ASCII Output:
- The calculated
aver,aver - std_dev, andaver + std_devvalues for each grazing angle bin are written to the<prefix>.meanASCII file. - The inverted mean backscatter (240.0 -
aver[i]) is written to the<prefix>.respASCII file.
- The calculated