IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 19, 2010, 2:30:36 PM (16 years ago)
Author:
Paul Price
Message:

Recipe value GAIN.OVERRIDE specifies whether the gain should be set to unity in the event it is non-finite in ppImage and ppMerge. This seems to be a problem for GPC1, where some gains are not set because they haven't been measured. GAIN.OVERRIDE is turned on for ppImage on GPC1, and off for everything else.

File:
1 edited

Legend:

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

    r24909 r26629  
    6767        pmChip *chip;                   ///< Chip of interest
    6868        while ((chip = pmFPAviewNextChip(view, fpa, 1))) {
    69             if (!chip->process || !chip->file_exists) {
    70                 continue;
    71             }
     69            if (!chip->process || !chip->file_exists) {
     70                continue;
     71            }
    7272            if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
    7373                goto ERROR;
     
    7676            pmCell *cell;               ///< Cell of interest
    7777            while ((cell = pmFPAviewNextCell(view, fpa, 1))) {
    78                 if (!cell->process || !cell->file_exists) {
    79                     continue;
    80                 }
     78                if (!cell->process || !cell->file_exists) {
     79                    continue;
     80                }
    8181                if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
    8282                    goto ERROR;
     
    8787                }
    8888
    89                 // skip cells with video data
     89                // skip cells with video data
    9090                if (cell->readouts->n > 1) {
    91                     // psError(PS_ERR_BAD_PARAMETER_VALUE, true, "File %d chip %d cell %d contains more than one readout (%ld)", i, view->chip, view->cell, cell->readouts->n);
    92                     // goto ERROR;
    93                   psWarning("File %d chip %d cell %d contains more than one readout (%ld), skipping", i, view->chip, view->cell, cell->readouts->n);
    94                   continue;
     91                    // psError(PS_ERR_BAD_PARAMETER_VALUE, true, "File %d chip %d cell %d contains more than one readout (%ld)", i, view->chip, view->cell, cell->readouts->n);
     92                    // goto ERROR;
     93                  psWarning("File %d chip %d cell %d contains more than one readout (%ld), skipping",
     94                            i, view->chip, view->cell, cell->readouts->n);
     95                  continue;
    9596                }
    9697                pmReadout *readout = cell->readouts->data[0]; ///< Readout of interest
     
    104105                      float gain = psMetadataLookupF32(NULL, cell->concepts, "CELL.GAIN"); ///< Cell gain
    105106                      if (!isfinite(gain)) {
    106                         // psError(PS_ERR_BAD_PARAMETER_VALUE, false,
    107                         // "CELL.GAIN for file %d chip %d cell %d is not set.",
    108                         // i, view->chip, view->cell);
    109                         // goto ERROR;
    110                         psWarning ("CELL.GAIN for file %d chip %d cell %d is NaN", i, view->chip, view->cell);
     107                          psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes,
     108                                                                        PPMERGE_RECIPE); // Recipe
     109                          psAssert(recipe, "Should be there!");
     110                          bool override = psMetadataLookupBool(NULL, recipe,
     111                                                               "GAIN.OVERRIDE"); // Override the bad gain?
     112                          if (override) {
     113                              psWarning("CELL.GAIN is not set for readout (%d,%d,%d) on file %d "
     114                                        "--- setting to unity.",
     115                                        view->chip, view->cell, view->readout, i);
     116                              psMetadataItem *item = psMetadataLookup(cell->concepts,
     117                                                                      "CELL.GAIN"); // Item with gain
     118                              psAssert(item, "Should be there!");
     119                              item->data.F32 = 1.0;
     120                          } else {
     121                              // psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     122                              // "CELL.GAIN for file %d chip %d cell %d is not set.",
     123                              // i, view->chip, view->cell);
     124                              // goto ERROR;
     125                              psWarning("CELL.GAIN for file %d chip %d cell %d is NaN",
     126                                        i, view->chip, view->cell);
     127                          }
    111128                      }
    112129                      gains->data.F32[cellNum] = gain;
     
    118135                        // i, view->chip, view->cell);
    119136                        // goto ERROR;
    120                         psWarning ("Unable to get statistics for file %d chip %d cell %d", i, view->chip, view->cell);
     137                        psWarning ("Unable to get statistics for file %d chip %d cell %d",
     138                                   i, view->chip, view->cell);
    121139                        background->data.F32[i][cellNum] = NAN;
    122140                      } else {
Note: See TracChangeset for help on using the changeset viewer.