IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 10, 2006, 10:59:09 AM (20 years ago)
Author:
Paul Price
Message:

Set CELL.DARKTIME and CELL.EXPOSURE when we've normalised by the dark time. Change options->exptime to options->darktime to properly indicate just what we're normalising by. Normalise by CELL.DARKTIME instead of CELL.EXPOSURE.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppMerge/src/ppMergeScaleZero.c

    r9325 r9463  
    4747    assert(config);
    4848
    49     if (!options->scale && !options->zero && !options->exptime) {
     49    if (!options->scale && !options->zero && !options->darktime) {
    5050        return true;                    // We did everything we were asked for
    5151    }
     
    161161    psStats *bgStats = psStatsAlloc(options->mean); // Statistic to measure the background
    162162    psVector *gains = NULL;             // The gains for each cell
    163     psImage *exptime = NULL;            // The exposure time for each integration of each cell
     163    psImage *darktime = NULL;           // The dark time for each integration of each cell
    164164    if (options->scale) {
    165165        gains = psVectorAlloc(data->numCells, PS_TYPE_F32);
    166166        gains->n = data->numCells;
    167167    }
    168     if (options->exptime) {
    169         exptime = psImageAlloc(data->numCells, filenames->n, PS_TYPE_F32);
     168    if (options->darktime) {
     169        darktime = psImageAlloc(data->numCells, filenames->n, PS_TYPE_F32);
    170170    }
    171171
     
    199199
    200200                // Normalising by the exposure time
    201                 if (options->exptime) {
    202                     exptime->data.F32[i][cellNum] = psMetadataLookupF32(&mdok, cell->concepts,
    203                                                                         "CELL.EXPOSURE");
    204                     if (!mdok || isnan(exptime->data.F32[i][cellNum])) {
    205                         psLogMsg(__func__, PS_LOG_WARN, "CELL.EXPOSURE for file %s chip %d cell %d is not "
     201                if (options->darktime) {
     202                    darktime->data.F32[i][cellNum] = psMetadataLookupF32(&mdok, cell->concepts,
     203                                                                        "CELL.DARKTIME");
     204                    if (!mdok || isnan(darktime->data.F32[i][cellNum])) {
     205                        psLogMsg(__func__, PS_LOG_WARN, "CELL.DARKTIME for file %s chip %d cell %d is not "
    206206                                 "set.\n", name, j, k);
    207                         exptime->data.F32[i][cellNum] = NAN;
     207                        darktime->data.F32[i][cellNum] = NAN;
    208208                        status = false;
    209209                    }
     
    302302    }
    303303
    304     if (options->exptime) {
     304    if (options->darktime) {
    305305        if (!options->scale) {
    306306            // Copy over the exposure times
    307             *scales = psImageCopy(*scales, exptime, PS_TYPE_F32);
     307            *scales = psImageCopy(*scales, darktime, PS_TYPE_F32);
    308308        } else {
    309             *scales = (psImage*)psBinaryOp(*scales, *scales, "*", exptime);
     309            *scales = (psImage*)psBinaryOp(*scales, *scales, "*", darktime);
    310310        }
    311311    }
Note: See TracChangeset for help on using the changeset viewer.