IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26876


Ignore:
Timestamp:
Feb 10, 2010, 4:18:31 PM (16 years ago)
Author:
eugene
Message:

updates from trunk

Location:
branches/eam_branches/20091201/ppImage/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20091201/ppImage/src/ppImageDefineFile.c

    r23366 r26876  
    1212
    1313    if (!file) {
    14         // look for the file on the RUN metadata
    15         file = pmFPAfileDefineFromRun(&status, NULL, config, filerule);
     14        // look for the file on the argument list
     15        file = pmFPAfileDefineFromArgs(&status, config, filerule, argname);
    1616        if (!status) {
    1717            psError(PS_ERR_UNKNOWN, false, "failed to load file definition");
     
    2020    }
    2121    if (!file) {
    22         // look for the file on the argument list
    23         file = pmFPAfileDefineFromArgs(&status, config, filerule, argname);
     22        // look for the file on the RUN metadata
     23        file = pmFPAfileDefineFromRun(&status, NULL, config, filerule);
    2424        if (!status) {
    2525            psError(PS_ERR_UNKNOWN, false, "failed to load file definition");
  • branches/eam_branches/20091201/ppImage/src/ppImageDetrendReadout.c

    r25930 r26876  
    1414    // find the currently selected readout
    1515    pmReadout *input = pmFPAfileThisReadout(config->files, view, "PPIMAGE.INPUT");
     16
     17    // Check that the gain is set (this is used by both pmReadoutGenerateMask and pmReadoutGenerateVariance)
     18    {
     19      float gain = psMetadataLookupF32(NULL, input->parent->concepts, "CELL.GAIN"); // Gain for cell
     20      if (!isfinite(gain)) {
     21        psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, RECIPE_NAME); // Recipe
     22        psAssert(recipe, "Should be there!");
     23        bool override = psMetadataLookupBool(NULL, recipe, "GAIN.OVERRIDE"); // Override the bad gain?
     24        if (override) {
     25          psWarning("CELL.GAIN is not set for readout (%d,%d,%d) --- setting to unity.", view->chip, view->cell, view->readout);
     26          psMetadataItem *item = psMetadataLookup(input->parent->concepts, "CELL.GAIN"); // Gain item
     27          psAssert(item, "Should be there!");
     28          item->data.F32 = 1.0;
     29
     30          // for unity gain, there is no modification for the readnoise, note that it has (effectively) been updated
     31          psMetadataRemoveKey(input->parent->concepts, "CELL.READNOISE.UPDATE");
     32        } else {
     33          psWarning("CELL.GAIN is NAN for readout (%d,%d,%d), image will be masked.", view->chip, view->cell, view->readout);
     34        }
     35      }
     36    }
    1637
    1738    // Masking on the basis of pixel value needs to be done before anything else, so the values are pristine.
     
    89110            psFree (binning);
    90111        }
     112
    91113        pmReadoutGenerateVariance(input, noiseImage, true);
    92114        psFree (noiseImage);
Note: See TracChangeset for help on using the changeset viewer.