IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26629


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.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippconfig/gpc1/ppImage.config

    r26546 r26629  
    1414
    1515OLDDARK                 BOOL    FALSE
     16
     17GAIN.OVERRIDE           BOOL    TRUE            # Override a non-finite gain?
    1618
    1719# use the deburned image instead of the raw, if it exists
  • trunk/ippconfig/recipes/ppImage.config

    r26602 r26629  
    128128FRINGE.FILTERS  MULTI
    129129FRINGE.FILTERS  STR UNDEF
     130
     131GAIN.OVERRIDE   BOOL    FALSE           # Override a non-finite gain?
    130132
    131133DETREND.CONSTRAINTS  METADATA
  • trunk/ippconfig/recipes/ppMerge.config

    r24839 r26629  
    4343STATS.BY.CHIP       BOOL    TRUE            # measure stats for masking by chip (or by readout)
    4444MASK.GROW.NPIX      S32     3               # measure stats for masking by chip (or by readout)
     45
     46GAIN.OVERRIDE       BOOL    FALSE           # Override non-finite gain?
    4547
    4648# Ordinates for fitting dark current
  • trunk/ppImage/src/ppImageDetrendReadout.c

    r25930 r26629  
    8989            psFree (binning);
    9090        }
     91
     92        // Check that the gain is set
     93        float gain = psMetadataLookupF32(NULL, input->parent->concepts, "CELL.GAIN"); // Gain for cell
     94        if (!isfinite(gain)) {
     95            psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, RECIPE_NAME); // Recipe
     96            psAssert(recipe, "Should be there!");
     97            bool override = psMetadataLookupBool(NULL, recipe, "GAIN.OVERRIDE"); // Override the bad gain?
     98            if (override) {
     99                psWarning("CELL.GAIN is not set for readout (%d,%d,%d) --- setting to unity.",
     100                          view->chip, view->cell, view->readout);
     101                psMetadataItem *item = psMetadataLookup(input->parent->concepts, "CELL.GAIN"); // Gain item
     102                psAssert(item, "Should be there!");
     103                item->data.F32 = 1.0;
     104            } else {
     105                psError(PS_ERR_BAD_PARAMETER_VALUE, false, "CELL.GAIN is not set for readout (%d,%d,%d)",
     106                        view->chip, view->cell, view->readout);
     107                return false;
     108            }
     109        }
     110
    91111        pmReadoutGenerateVariance(input, noiseImage, true);
    92112        psFree (noiseImage);
  • 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.