ANSI-C program: ras_dB.c
NAME
ras_dB - Converts a real valued input data file (float) to
an (8-bit) SUN raster or BMP format image using logarithmic dB
scaling.
SYNOPSIS
ras_dB <pwr> [width] [start] [nlines] [pixavr]
[pixavaz] [min_dB] [max_dB] [dB_offset] [LR] [rasf] [abs_flag]
[inverse] [channel]
<pwr> | intensity image (float) |
<width> | samples per row of pwr |
[start] | starting line of pwr (default=1) |
[nlines] | number of lines to display (default=0: to end of file) |
[pixavr] | number of pixels to average in range (default=1) |
[pixavaz] | number of pixels to average in azimuth (default=1) |
[min_dB] | minimum dB value for display (default=-40.0) |
[max_dB] | maximum dB value for display (default=10.0) |
[dB_offset] | dB value subtracted from input data (default=0.0) |
[LR] | left/right flipping flag, (default=1: normal, -1: mirror image) |
[rasf] | output (or input) rasterfile (default=*.ras: SUN raster format, *.bmp: BMP format) |
[abs_flag] | absolute value flag (default=0: normal, 1: absolute value) |
[inverse] | inverse flag (default=1: float_to_raster, -1: raster_to_float) |
[channel] | RBG channel flag (default=1:red, 2:green, 3:blue) |
EXAMPLE
ras_dB 1825_1868.pwr1 2500 1 0 3 -18.0 -2.0 80.3 -1
1825_1868.pwr1.ras 0
Generates an (8-bit) SUN raster (gray-scaled) from the input backscatter intensity file using logarithmic scaling. The input values are converted to dB scale, 80.3 dB are subtracted, and the result linearly scaled between the input interval (-18.0 -2.0) and the output interval (0,255).
ras_dB 1825_1868.ratio 2500 1 0 3 0.0 5.0 0.0 -1 1825_1868.pwr1.ras 1
Generates an (8-bit) SUN raster (gray-scaled) from the ratio file using logarithmic scaling. The input values are converted to dB scale, 0.0 dB are subtracted, then the absolute value is taken (i.e. it is not distinguished between backscatter increase and decrease) and the result is linearly scaled between the input interval (0.0 5.0) and the output interval (0,255).
DESCRIPTION
ras_dB generates an 8-bit SUN raster or BMP format from a
real valued input data file (float) using logarithmic scaling.In
a first step the input data are converted to dB scale. The
transformation between linear scale (value) and dB scale
(value_in_dB) is defined by
value > 0.0: | value_in_dB = 10.0*log10(value) |
value <= 0.0 | value_in_dB = NULL value (=0.0) |
In a second step the offset value is subtracted from the dB value. With the absolute_flag=1, the absolute value is then taken. In the last step, finally, the dB values are linearly scaled using the indicated minimum and maximum values and converted to the input data range (0 ... 255) of the output 8-bit image.
The inverse operation can also be performed that converts the input raster file back to floating point data. If the input image is 24 bits/pixel, one of the 3 color channels can be selected for the inverse operation. In the case of 8 bits/pixel images, the channel value is derived from one of the channels of the associated color table entry.
OPTIONS
Multi-looking and the selection of a reduced number of lines may
be applied.For the generation of a SUN raster using linear
scaling the program ras_linear, and
for power law scaling the program raspwr may be used.
DIAGNOSTICS
All messages are generally self-explanatory.
NOTES
None.