IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9463


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.

Location:
trunk/ppMerge/src
Files:
5 edited

Legend:

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

    r8883 r9463  
    7171    psFree(config);
    7272
    73     psLibFinalize();
    7473    pmConceptsDone();
    7574    pmConfigDone();
     75    psLibFinalize();
    7676
    7777//    ppMemCheck();
  • trunk/ppMerge/src/ppMergeCombine.c

    r9376 r9463  
    258258                }
    259259
     260                // Set the dark time for the output image, since we normalised
     261                if (options->darktime) {
     262                    psMetadataItem *darkItem = psMetadataLookup(cell->concepts, "CELL.DARKTIME");
     263                    darkItem->data.F32 = 1.0;
     264                    psMetadataItem *expItem = psMetadataLookup(cell->concepts, "CELL.EXPOSURE");
     265                    expItem->data.F32 = 1.0;
     266                }
     267
    260268                memCheck();
    261269#endif
  • trunk/ppMerge/src/ppMergeOptions.c

    r9385 r9463  
    3434    options->zero = false;
    3535    options->scale = false;
    36     options->exptime = false;
     36    options->darktime = false;
    3737    options->shutter = false;
    3838    options->sample = 1;
     
    147147            options->zero = false;
    148148            options->scale = false;
    149             options->exptime = false;
     149            options->darktime = false;
    150150            options->shutter = false;
    151151        } else if (strcasecmp(type, "DARK") == 0) {
    152152            options->zero = false;
    153153            options->scale = false;
    154             options->exptime = true;
     154            options->darktime = true;
    155155            options->shutter = false;
    156156        } else if (strcasecmp(type, "FLAT") == 0) {
    157157            options->zero = false;
    158158            options->scale = true;
    159             options->exptime = false;
     159            options->darktime = false;
    160160            options->shutter = false;
    161161        } else if (strcasecmp(type, "FRINGE") == 0) {
    162162            options->zero = true;
    163163            options->scale = true;
    164             options->exptime = false;
     164            options->darktime = false;
    165165            options->shutter = false;
    166166        } else if (strcasecmp(type, "SHUTTER") == 0) {
    167167            options->zero = false;
    168168            options->scale = false;
    169             options->exptime = false;
     169            options->darktime = false;
    170170            options->shutter = true;
    171171        } else {
     
    173173            options->zero = false;
    174174            options->scale = false;
    175             options->exptime = false;
     175            options->darktime = false;
    176176            options->shutter = false;
    177177        }
     
    180180        options->zero = false;
    181181        options->scale = false;
    182         options->exptime = false;
     182        options->darktime = false;
    183183    }
    184184
     
    186186#if 0
    187187    // Or you can set them individually
    188     OPTION_PARSE(options->zero,    config->arguments, "-zero",    Bool);
    189     OPTION_PARSE(options->scale,   config->arguments, "-scale",   Bool);
    190     OPTION_PARSE(options->exptime, config->arguments, "-exptime", Bool);
     188    OPTION_PARSE(options->zero,     config->arguments, "-zero",    Bool);
     189    OPTION_PARSE(options->scale,    config->arguments, "-scale",   Bool);
     190    OPTION_PARSE(options->darktime, config->arguments, "-exptime", Bool);
    191191#endif
    192192
  • trunk/ppMerge/src/ppMergeOptions.h

    r9341 r9463  
    2121    bool zero;                          // Subtract background before combining?
    2222    bool scale;                         // Scale by the background before combining?
    23     bool exptime;                       // Normalise by the exposure time?
     23    bool darktime;                      // Normalise by the dark time (time since flush)?
    2424    bool shutter;                       // Generate shutter correction?
    2525    unsigned int sample;                // Sampling factor for measuring the background
  • 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.