IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 6, 2008, 10:49:03 AM (18 years ago)
Author:
Paul Price
Message:

Changing to produce multi-darks instead of boring old darks. This allows us to fit the dark current as a function of temperature, time since PON, etc. In fact, what's fit is very configurable.

File:
1 edited

Legend:

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

    r13957 r16842  
    2525    assert(config);
    2626
    27     if (!options->scale && !options->zero && !options->darktime && !options->shutter) {
     27    if (!options->scale && !options->zero && !options->shutter) {
    2828        return true;                    // We did everything we were asked for
    2929    }
     
    151151    psStats *bgStats = psStatsAlloc(options->mean); // Statistic to measure the background
    152152    psVector *gains = NULL;             // The gains for each cell
    153     psImage *darktime = NULL;           // The dark time for each integration of each cell
    154153    if (options->scale) {
    155154        gains = psVectorAlloc(data->numCells, PS_TYPE_F32);
    156     }
    157     if (options->darktime) {
    158         darktime = psImageAlloc(data->numCells, filenames->n, PS_TYPE_F32);
    159155    }
    160156
     
    187183                if (!pmCellReadHeader(cell, inFile)) {
    188184                    continue;
    189                 }
    190 
    191                 // Normalising by the exposure time
    192                 if (options->darktime) {
    193                     darktime->data.F32[i][cellNum] = psMetadataLookupF32(NULL, cell->concepts,
    194                                                                          "CELL.DARKTIME");
    195                     if (isnan(darktime->data.F32[i][cellNum])) {
    196                         psWarning("CELL.DARKTIME for file %s chip %d cell %d is not set.\n", name, j, k);
    197                         status = false;
    198                     } else {
    199                         view->chip = j;
    200                         view->cell = k;
    201 
    202                         // This step applies the dark exptime / background relationship: F =
    203                         // polymomial(exptime).  Below, the input images are scaled by the
    204                         // output of this relationship.
    205 
    206                         // For devices with linear dark and no residual bias, this relationship
    207                         // is not defined in the configuration system, and the transformation
    208                         // is defined (when loaded by the concepts) to be F = exptime.  Thus,
    209                         // in this case, the resulting dark image consists of counts/sec.
    210 
    211                         // For devices with a different relationship, the transformation yields
    212                         // the expected number of counts in the given exposure, based on the
    213                         // recorded exptime.  Thus, in this case, the resulting dark image
    214                         // should have a median value of 1.0.
    215 
    216                         // note that these corrections must be applied differently when used to
    217                         // correct a science image. 
    218 
    219                         darktime->data.F32[i][cellNum] = pmFPADarkNorm(fpa, view,
    220                                                                        darktime->data.F32[i][cellNum]);
    221                         if (isnan(darktime->data.F32[i][cellNum])) {
    222                             psWarning("Cannot get dark normalisation for file %s chip %d cell %d.\n",
    223                                       name, j, k);
    224                             status = false;
    225                         }
    226                     }
    227185                }
    228186
     
    355313    }
    356314
    357     if (options->darktime) {
    358         if (!options->scale) {
    359             // Copy over the exposure times
    360             *scales = psImageCopy(*scales, darktime, PS_TYPE_F32);
    361         } else {
    362             *scales = (psImage*)psBinaryOp(*scales, *scales, "*", darktime);
    363         }
    364     }
    365 
    366315    if (options->zero) {
    367316        if (!*zeros) {
Note: See TracChangeset for help on using the changeset viewer.