c_appcoeff - Apply predetermined calibration coefficients to one line of image data.

SYNTAX

FUNCTION c_appcoeff ( model, calstr, channel, maxchan, minmax, omin, omax, buffer, offset1, offset2, coeff )

    struct MODEL *model;
    struct CALSTR *calstr;
    long channel[];
    long maxchan;
    char *minmax;
    double omin[];
    double omax[];
    unsigned char *buffer;
    long offset1[];
    long offset2[];
    struct COEFFSTR *coeff;

PARAMETERS

model (struct MODEL *, input)

Structure containing the model and orbital information.

calstr (struct CALSTR *, input)

Structure containing the calibration parameters.

channel (long[], input)

The AVHRR channels to process.

maxchan (long, input)

The maximum number of channels to process.

minmax (char *, input)

Flag specifying whether to calculate the minimum/maximum value:

    YES -   Calculate minimum/maximum values
    NO  -   Do not calculate minimum/maximum values

omin (double[], input/output)

The minimum pixel value array.

omax (double[], input/output)

The maximum pixel value array.

buffer (unsigned char *, input/output)

The buffer containing one line of image data (input/output).

offset1 (long[], input)

The array of offsets into "buffer" for the input bands.

offset2 (long[], input)

The array of offsets into "buffer" for the output bands.

coeff (struct COEFFSTR *, input/output)

Structure containing the calibration coefficients.

DESCRIPTION

An optical and thermal look-up table is generated for all possible values in the scan line. These look-up table values are then used to determine the scan line of calibrated values.

Reflectance formula for optical channels:

      A = order0 + order1*D

The following formula is used to convert the reflectance value to radiance:

      R = A (F / (100 * PI * W))

   Where:
      R - Radiance
      A - Reflectance
      F - Integrated solar spectral irradiance
      W - Equivalent width of the spectral response function

Temperature formula for thermal channels:

      E = order0 + order1*D + order2*D*D

Energy is then converted in temperature (T) by using the inverse of
Planck's radiation function as shown in the following equation:

                    C2*CWN
             ___________________
     T =
                  C1 * CWN**3
          ln( 1 + ___________ )
                      E

   Where E is energy from the above formula, C1 is a constant equal to
   1.1910659E-5, C2 is a constant equal to 1.438833, and CWN is the
   central wave number given for each channel of each satellite for
   a specified surface temperature.

RETURN VALUE

c_appcoeff() returns

    E_SUCC --> Successful completion
    E_FAIL --> Operation failed