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/ppImageParseCamera.c

    r29833 r33848  
    2222    ppImageOptions *options = ppImageOptionsParse(config);
    2323
     24    // parse the header to extract out whether this OTA has video cells.
     25    // CZW: 2012-05-01 I'm somewhat ashamed of what needs to be done to get to the header. There has to be a simpler way, right?
     26/*     pmFPAview *view = pmFPAviewAlloc(0);// View for level of interest */
     27/*     pmChip *chip;                       // Chip from FPA */
     28/*     while ((chip = pmFPAviewNextChip(view, input->fpa, 1)) != NULL) { */
     29/*       if (!chip->process || !chip->file_exists) { */
     30/*      continue; */
     31/*       } */
     32/* /\*       if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { *\/ */
     33/* /\*  continue; *\/ */
     34/* /\*       } *\/ */
     35/*       psWarning("VIDEO: %d %d %d\n",(int) options->hasVideo,(int) options->useVideoDark, (int) options->useVideoMask); */
     36/*       if (psMetadataLookupStr(NULL,chip->hdu->header,"CELLMODE")) { */
     37/*      psWarning("VIDEO: %d %d %d\n",(int) options->hasVideo,(int) options->useVideoDark, (int) options->useVideoMask); */
     38/*      char *Vptr = strchr(psMetadataLookupStr(NULL,chip->hdu->header,"CELLMODE"),'V'); */
     39/*      if (Vptr) { */
     40/*        options->hasVideo = true; */
     41/*        psWarning("VIDEO: %d %d %d\n",(int) options->hasVideo,(int) options->useVideoDark, (int) options->useVideoMask); */
     42/*      } */
     43/*       } */
     44/*     } */
     45/*     pmFPAviewReset(view); */
     46/*     psFree(view); */
     47   
    2448    // the following are defined from the argument list, if given,
    2549    // otherwise they revert to the config information
     
    4266    }
    4367    if (options->doDark) {
    44         if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.DARK", "DARK",
    45                                PM_FPA_FILE_DARK, PM_DETREND_TYPE_DARK)) {
     68      // Always load the regular Dark
     69      if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.DARK", "DARK",
     70                             PM_FPA_FILE_DARK, PM_DETREND_TYPE_DARK)) {
     71        psError(PS_ERR_IO, false, "Can't find a dark image source");
     72        psFree(options);
     73        return NULL;
     74      }
     75      // Sometimes load the video dark if we need it.
     76      if (options->useVideoDark) {
     77        if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.VIDEODARK", "DARK",
     78                               PM_FPA_FILE_DARK, PM_DETREND_TYPE_VIDEODARK)) {
    4679            psError(PS_ERR_IO, false, "Can't find a dark image source");
    4780            psFree(options);
    4881            return NULL;
    4982        }
     83      }
    5084    }
    5185    if (options->doMask) {
    52         if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.MASK", "MASK",
    53                                PM_FPA_FILE_MASK, PM_DETREND_TYPE_MASK)) {
     86      // Always load the regular mask
     87      if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.MASK", "MASK",
     88                             PM_FPA_FILE_MASK, PM_DETREND_TYPE_MASK)) {
     89        psError(PS_ERR_IO, false, "Can't find a mask image source");
     90        psFree(options);
     91        return NULL;
     92      }
     93
     94      if (options->useVideoMask) {
     95        if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.VIDEOMASK", "MASK",
     96                               PM_FPA_FILE_MASK, PM_DETREND_TYPE_VIDEOMASK)) {
    5497            psError(PS_ERR_IO, false, "Can't find a mask image source");
    5598            psFree(options);
    5699            return NULL;
    57100        }
     101      }
    58102    }
    59103    if (options->doShutter) {
Note: See TracChangeset for help on using the changeset viewer.