ccupdt - Recalculate and update calibration coefficients once per calibration period

SYNTAX

FUNCTION ccupdt(curlin, mnr_frm, illum, ocoeffs, coeffs, lastcoeffs, prtcnt, cntsum, prtsmp, prtndx, nxtprt, prtpop, sampls, intsum, spcsum, start, cpriod, aij, bi, nsp, bnmrp, enmr, n, model)

    long	 curlin;
    short	 mnr_frm[];
    long	 illum;
    long	 ocoeffs[];
    long	 coeffs[];
    long	 lastcoeffs[];
    long	 prtcnt[];
    long	 cntsum[];
    long	 prtsmp[];
    long	 prtndx[];
    long	 *nxtprt;
    long	 prtpop;
    long	 *sampls;
    long	 intsum[];
    long	 spcsum[];
    long	 start;
    long	 cpriod;
    double	 aij[][5];
    double	 bi[];
    double	 nsp[];
    double	 bnmrp[][60];
    double	 enmr[][60];
    long	 n[];
    struct MODEL *model;

PARAMETERS

curlin (long, input)

Current line within image.

mnr_frm (short[], input)

Buffer containing HRPT minor frame data. This data may be acquired by calling c_lsread() or c_arcread(), for example.

illum (long, input)

Illumination correction flag:

     = TRUE  (1)	Perform illumination correction
     = FALSE (0)	Don't perform illumination correction

ocoeffs (long[], input / output)

Optical coefficients. These coefficients define the gain and offset for AVHRR channels 1 and 2. They are only updated if illum is set to TRUE. These values may be obtained from a visual degradation table by calling osscals(), for example.

coeffs (long[], output)

Calibration coefficients. These values define the gain and offset for AVHRR channels 1 through 5.

lastcoeffs (long[], input / output)

Previous set of Calibration coefficients. These values are used when dropped lines make it necessary to use the previous coefficients. These values define the gain and offset for AVHRR channels 1 through 5. Upon the first call to ccupdt(), initial values should be (2**30, 0, 2**30, 0, 2**30, 0, 2**30, 0, 2**30, 0), where "2**30" is 2 raised to the power of 30.

prtcnt (long[], input / output)

Platinum resistance thermometer (PRT) counts.

cntsum (long[], input / output)

Sum of PRT counts.

prtsmp (long[], input / output)

Number of samples of PRT counts.

prtndx (long[], input / output)

Offsets to find the four sample PRT values.

nxtprt (long *, input / output)

Index into the PRT counts prtcnt of the next PRT.

prtpop (long, input)

PRT population.

sampls (long *, input)

Number of samples of target & space counts.

intsum (long[], input / output)

Sum of internal counts.

spcsum (long[], input / output)

Sum of space counts.

start (long, input)

Starting line (for computing coefficient change).

cpriod (long, input)

Calibration period.

aij (double[][5], input)

Coefficients for computing temperature from PRT values.

bi (double[], input)

PRT weighting factors.

nsp (double[], input)

Radiance of space values.

bnmrp (double[][60], input)

Numerator of beta function.

enmr (double[][60], input)

Numerator of exponential function.

n (long[], input)

The number of points for which the normalized response function has been evaluated.

model (struct MODEL *, input)

Model and orbital information.

DESCRIPTION

Find the nader sample based on the AVHRR image type. Using the start of the calibration period and the past PRT population generate coefficients for the previous period and initialize for the new period. Compute sums for each of the 4 PRT's. Convert the PRT count sums to temperatures. Convert the average temperature to radiance for channels 3, 4, and 5. Compute the gain and the intercept. For optical channels, do illumination correction if asked for, or use values already calculated in getcals(). Test for zero coefficients and set up the new set of previous coefficients. Re-initialize summation variables to start a new calibration period. Update the PRT data. Check the first PRT reference value so that the four PRT sample values will be synchronized. Update the space and blackbody data if the line is not a dropped line.

RETURN VALUE

ccupdt() returns

    TRUE  --> The coefficients have been recalculated
    FALSE --> The coefficients have not been recalculated