IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 18, 2007, 5:59:32 PM (19 years ago)
Author:
Paul Price
Message:

Changes to allow shutter correction to be processed piece by piece.

File:
1 edited

Legend:

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

    r13769 r13873  
    8383bool ppMergeCombine(psImage *scales,    // Scales for each cell of each integration, or NULL
    8484                    psImage *zeros,     // Zeros for each cell of each integration, or NULL
     85                    psArray *shutters, // Shutter correction data for each cell, or NULL
    8586                    ppMergeData *data,  // Data
    8687                    ppMergeOptions *options, // Options
     
    100101                      zeros->numCols == data->numCells &&
    101102                      zeros->numRows == filenames->n));
     103    assert(!options->shutter || shutters);
     104    assert(!shutters || (shutters->n == data->numCells));
    102105
    103106    // Iterate over the FPA
     
    143146            }
    144147
     148            float shutterRef;           // Reference shutter correction
     149            if (options->shutter) {
     150                shutterRef = pmShutterCorrectionReference(shutters->data[cellNum]);
     151            }
     152
    145153            do {
    146154                numRead = 0;
     
    162170
    163171                    // Only reading and writing the first readout in each cell (plane 0)
    164                     bool readOK;
     172                    bool readOK;
    165173                    if (pmReadoutReadNext(&readOK, stack->data[i], fits, 0, options->rows)) {
    166                         if (!readOK) {
    167                             psError(PS_ERR_IO, false, "Failed to read concepts for cell.\n");
    168                             psErrorStackPrint(stderr, "trouble reading data!\n");
    169                             exit (1);
    170                         }
     174                        if (!readOK) {
     175                            psError(PS_ERR_IO, false, "Failed to read concepts for cell.\n");
     176                            psErrorStackPrint(stderr, "trouble reading data!\n");
     177                            exit (1);
     178                        }
    171179                        // If we're creating a bias or a dark, we don't want to generate a mask
    172180                        if ((options->zero || options->scale || options->shutter || options->mask) &&
     
    198206
    199207                    if (options->shutter) {
    200                         pmShutterCorrectionMeasure(readout, stack, options->shutterSize,
    201                                                    options->mean, options->stdev,
    202                                                    options->shutterIter,
    203                                                    options->shutterRej,
    204                                                    options->combine->maskVal);
     208                        pmShutterCorrectionGenerate(readout, NULL, stack, shutterRef, shutters->data[cellNum],
     209                                                    options->shutterIter, options->shutterRej,
     210                                                    options->combine->maskVal);
    205211                    } else {
    206212                        pmReadoutCombine(readout, stack, cellZeros, cellScales, options->combine);
     
    271277            // Statistics on the merged cell
    272278            if (data->statsFile) {
    273                 if (!data->stats) {
    274                     data->stats = psMetadataAlloc();
    275                 }
    276                 if (!ppStats(data->stats,
    277                              data->out,
    278                              view,
    279                              options->combine->maskVal,
    280                              config)) {
     279                if (!data->stats) {
     280                    data->stats = psMetadataAlloc();
     281                }
     282                if (!ppStats(data->stats, data->out, view, options->combine->maskVal, config)) {
    281283                    psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to generate stats for image.\n");
    282                     return false;
    283                 }
    284             }
     284                    return false;
     285                }
     286            }
    285287
    286288            // We threw away the bias sections --- record this
Note: See TracChangeset for help on using the changeset viewer.