User's Guide

BANDRATIO

Computes the ratio of one band to the weighted sum of several bands

Function:

Computes the ratio of one image band to the weighted sum of all the bands in the denominator image. The two input images may be the same or different images, and the denominator image may be single or multiband.

Parameters:

IN
Input images. First image is the numerator image. It must be single band. Second image is the denominator image. It may be single or multiband and it may or may not be the same image as the first image. Acceptable data types are BYTE, INTEGER*2, INTEGER*4, and REAL*4.

OUT
Output ratio image. Its data type is always REAL*4.

NUMERWT(1.0)
Weight to be applied to the numerator image.

DENOMWT(--)
Weights to be applied to the corresponding bands of the denominator image. The default is 1.0 for all bands.

DENOMVAL(1.0)
Denominator value. Value to be used in the denominator in case of division by zero. When the ratio is computed, it is possible that the weighted sum of the bands in the denominator may become zero. In such a case, DENOMVAL will be used in the denominator.

Examples:

  1. LAS> bandratio in=("fg(:4)", "fg(101,101,512,512:1-7)") out=band.out numerwt=2.0 denomwt=(1.0,1.0,2.0,2.0,3.0,3.0,4.0) denomval=0.001

    The input image FG has seven bands with a particular window specified. BAND.OUT is the resultant ratio image. IN(1) is the fourth band of FG. Weight for the numerator NUMERWT is 2.0. Denominator weight values DENOMWT correspond to each band of the IN(2) image. A value of 0.001 is used for the denominator when division by 0 is attempted.

  2. LAS> bandratio in=("fg2(:2)", "fg1(:1-4)+fg2(:1-5)") out=band.out numerwt=2.5 denomwt=(1.0,2.0,3.0,4.0,1.0,2.0,3.0,4.0,5.0)

    The input images FG1 and FG2 have a total of nine bands with the nine weights specified in DENOMWT. BAND.OUT is the resultant ratio image. Band 2 of image FG2 is the image band in the numerator.

Description/Algorithm:

The output image is computed on a pixel-by-pixel basis as follows:


                            NUMERWT * IN1
                                          l,s
       OUT         = --------------------------------
          l,s          tb
                       SUM  DENOMWT  * IN2
                      i = 1        i      i,l,s

where
   NUMERWT   is the weight factor for the numerator

   IN1       is the pixel value at line, sample position 
      l,s    l,s in the image band chosen as the numerator 
             image

   tb        is the total number of bands in the second 
             input image

   DENOMWT   is the i-th element in the weight array for 
          i  the denominator

   IN2       is the pixel value at line, sample position 
      i,l,s  l,s in the i-th band of the denominator image

   OUT       is the pixel value at line, sample position 
      l,s    l,s in the output image

Note:  If the weighted denominator is 0, it is replaced by 
       the value of DENOMVAL.

Nonfatal Error Messages:

  1. [bandratio-warn] Nonfatal error encountered

    A nonfatal error was encountered during processing. The error message that is displayed preceding this message is the specific error that was encountered.

Fatal Error Messages:

  1. [bandratio-single] Numerator image must be single band

    Specify a single band image for the numerator.

  2. [bandratio-fatal] Fatal error encountered

    A fatal error was encountered during processing. Processing is terminated. The error message that is displayed immediately preceding this message is the specific error that was encountered.

  3. [bandatio-alloc] Error allocating dynamic memory

    An error occurred allocating memory. Rerun BANDRATIO and if the error reoccurs contact the system manager.

  4. [bandratio-window] Denominator images do not have same window size

    The denominator images are specified with different window sizes. Rerun BANDRATIO and respecify the window sizes.

User Note:

  1. If two different windows are specified for the numerator and denominator images BANDRATIO takes the smaller of the two windows.