selective_back
Description
selective_back is a utility designed for advanced analysis of backscatter strength and grazing angle mosaics. Similar to build_back_mos, it processes input backscatter and impinging (grazing) angle images to understand their statistical relationship. However, selective_back offers more flexibility by allowing analysis either within a user-defined geographic region (-top_y, -bot_y, -left_x, -right_x) or specifically for pixels within a certain value range of an external classification image (-class, -range). It computes mean and standard deviation of backscatter for various grazing angle bins and can visualize these statistics or apply color coding to an image.
Usage
selective_back [-image <image_file>] [-color <value>] [-dB <min_dB> <max_dB>] [-table <prefix>] [(-top_y <y0> -bot_y <y1> -left_x <x0> -right_x <x1>) | (-class <class_file> -range <low> <high>)] [-bksct <bksct_file> -imping <imping_file>]
Note: When using the geographic region (-top_y, etc.) or classification (-class) options, you generally provide backscatter and impinging angle files directly (-bksct, -imping) rather than relying on the hardcoded mos/lineN_ files. The hardcoded files are a fallback.
Arguments
| Option | Description | Default |
|---|---|---|
-image <image_file> | An optional image file (ACRES format) to be “painted” with a specified color (-color) where classification criteria are met. | (None) |
-color <value> | The 8-bit color value to “paint” pixels in the image_file if using the -image and -class options. | 5 |
-dB <min_dB> <max_dB> | Defines the minimum and maximum decibel range for the output table’s y-axis, allowing for specific scaling of backscatter values. | -70 -30 |
-table <prefix> | Required. Specifies a prefix for output files. The tool will generate: <prefix>.table (image), and <prefix>.mean (ASCII stats). | |
-top_y <y0> | Top row of the geographic region of interest. | -1 (use full image) |
-bot_y <y1> | Bottom row of the geographic region of interest. | -1 (use full image) |
-left_x <x0> | Left column of the geographic region of interest. | -1 (use full image) |
-right_x <x1> | Right column of the geographic region of interest. | -1 (use full image) |
-class <class_file> | An external classification image file (ACRES format). Pixels from the backscatter/impinging mosaics will only be processed if their corresponding pixel in this file falls within the -range. | (None) |
-range <low> <high> | When used with -class, specifies the inclusive range of pixel values in the classification image to consider. | 0 255 |
-bksct <bksct_file> | Required (if not using hardcoded files). Path to an individual backscatter mosaic file (ACRES format). | (Hardcoded mos/lineN_bksct.mos) |
-imping <imping_file> | Required (if not using hardcoded files). Path to an individual impinging (grazing) angle mosaic file (ACRES format). | (Hardcoded mos/lineN_imping.mos) |
How It Works
- Initialization:
- A 2D array
table_pointer[241][241]is initialized to accumulate backscatter vs. grazing angle density, mapping 8-bit DN values to the 0-240 range for both axes. - Arrays for
aver,std_dev,sum,sum_weightare initialized for statistical calculations. - Output files (
.table,.mean) are opened.
- A 2D array
- Input Loading (Flexible):
- Hardcoded Files (Default
phase3_flag): The tool can automatically load up to 10 pairs of backscatter and impinging angle mosaic files from predefined paths (mos/lineN_bksct.mos,mos/lineN_imping.mos). - Explicit Files (
-bksct,-imping): Alternatively, a single pair of backscatter and impinging angle files can be specified directly. - Classification Image (
-class): If provided, this image is loaded, and only pixels corresponding to valid ranges in this image are processed. - Output Image (
-image): If provided, this image is also loaded for potential “painting” based on classification.
- Hardcoded Files (Default
- Data Accumulation:
- The tool iterates through pixels within the specified region of interest (either geographic or defined by classification).
- For each pixel:
- It extracts backscatter (
back_stbd,back_port) and grazing angle (graz_stbd,graz_port) values. - Classification Filtering: If
-classis used, it checks if the corresponding pixel in theclass_datafalls withinrange_botandrange_top. If not, the backscatter and grazing angle values for that pixel are ignored. - If valid, it increments a counter in the
table_pointerarray at the corresponding backscatter and grazing angle bin.
- It extracts backscatter (
- Mean and Standard Deviation Calculation:
- After accumulating all data, for each grazing angle bin (
ifrom 0 to 240):- 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 (
- Output Table Generation:
- The
table_pointerarray is visually enhanced by marking theaverline (value 3) andaver +/- std_devlines (value 4). - A
JHC_header(table_head) is created defining the dimensions and dB 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. - Image “Painting” (Optional): If
image_flagandclass_flagare enabled, pixels meeting the classification criteria within theimage_fileare set to the specifiedcolor.