IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 3, 2012, 5:51:09 PM (14 years ago)
Author:
watersc1
Message:

Upgrade to ppImage to make videodark/masks work.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage/src/ppImageDetrendReadout.c

    r33590 r33848  
    3535      }
    3636    }
    37 
     37    // Check to see if we're in a chip that contains video
     38    bool hasVideo = false;
     39    {
     40      if (psMetadataLookupStr(NULL,input->parent->parent->hdu->header,"CELLMODE")) {
     41        psWarning("VIDEO: %d %d %d\n",(int) options->hasVideo,(int) options->useVideoDark, (int) options->useVideoMask);
     42        char *Vptr = strchr(psMetadataLookupStr(NULL,input->parent->parent->hdu->header,"CELLMODE"),'V');
     43        if (Vptr) {
     44          hasVideo = true;
     45          psWarning("VIDEO: %d %d %d\n",(int) options->hasVideo,(int) options->useVideoDark, (int) options->useVideoMask);
     46        }
     47      }
     48    }
     49
     50   
    3851    // Masking on the basis of pixel value needs to be done before anything else, so the values are pristine.
    3952    if (options->doMaskBuild) {
     
    4457    // apply the externally supplied mask to the input->mask pixels
    4558    if (options->doMask) {
    46         pmReadout *mask = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.MASK");
    47         pmMaskBadPixels(input, mask, options->maskValue);
     59      pmReadout *mask;
     60      if ((options->useVideoMask)&&(hasVideo)) {
     61        mask = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.VIDEOMASK");
     62      }
     63      else {
     64        mask = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.MASK");
     65      }
     66      pmMaskBadPixels(input, mask, options->maskValue);
    4867    }
    4968    if (options->doMaskBurntool) {
     
    8099        psMetadata *recipe = psMetadataLookupPtr (&mdok, config->recipes, RECIPE_NAME);
    81100        assert(mdok && recipe);
    82         if (psMetadataLookupBool(&mdok, recipe, "OLDDARK")) {
     101
     102        if ((options->useVideoDark)&&(hasVideo)) {
     103          if (psMetadataLookupBool(&mdok, recipe, "OLDDARK")) {
     104            oldDark = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.VIDEODARK");
     105          } else {
     106            dark = pmFPAfileThisCell(config->files, detview, "PPIMAGE.VIDEODARK");
     107          }
     108        }
     109        else {
     110          if (psMetadataLookupBool(&mdok, recipe, "OLDDARK")) {
    83111            oldDark = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.DARK");
    84         } else {
     112          } else {
    85113            dark = pmFPAfileThisCell(config->files, detview, "PPIMAGE.DARK");
    86         }
     114          }
     115        }
    87116    }
    88117
Note: See TracChangeset for help on using the changeset viewer.