IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 28, 2009, 2:33:51 PM (17 years ago)
Author:
Paul Price
Message:

Changing pmReadout.weight to variance. Adding pmReadout.covariance which will carry around a covariance pseudo-matrix, allowing us to calculate the pixel-to-pixel variance. pmReadout.covariance now exists and is set, but no mechanism yet to read/write, or use it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/pap_branch_20090128/psModules/src/camera/pmFPAfileIO.c

    r20937 r21211  
    173173        status = pmFPAviewReadFitsMask(view, file, config);
    174174        break;
    175       case PM_FPA_FILE_WEIGHT:
    176         status = pmFPAviewReadFitsWeight(view, file, config);
     175      case PM_FPA_FILE_VARIANCE:
     176        status = pmFPAviewReadFitsVariance(view, file, config);
    177177        break;
    178178      case PM_FPA_FILE_HEADER:
     
    262262      case PM_FPA_FILE_IMAGE:
    263263      case PM_FPA_FILE_MASK:
    264       case PM_FPA_FILE_WEIGHT:
     264      case PM_FPA_FILE_VARIANCE:
    265265      case PM_FPA_FILE_FRINGE:
    266266      case PM_FPA_FILE_DARK: {
     
    427427        status = pmFPAviewWriteFitsMask(view, file, config);
    428428        break;
    429       case PM_FPA_FILE_WEIGHT:
    430         status = pmFPAviewWriteFitsWeight(view, file, config);
     429      case PM_FPA_FILE_VARIANCE:
     430        status = pmFPAviewWriteFitsVariance(view, file, config);
    431431        break;
    432432      case PM_FPA_FILE_HEADER:
     
    524524      case PM_FPA_FILE_IMAGE:
    525525      case PM_FPA_FILE_MASK:
    526       case PM_FPA_FILE_WEIGHT:
     526      case PM_FPA_FILE_VARIANCE:
    527527      case PM_FPA_FILE_HEADER:
    528528      case PM_FPA_FILE_FRINGE:
     
    589589      case PM_FPA_FILE_IMAGE:
    590590      case PM_FPA_FILE_MASK:
    591       case PM_FPA_FILE_WEIGHT:
     591      case PM_FPA_FILE_VARIANCE:
    592592      case PM_FPA_FILE_HEADER:
    593593      case PM_FPA_FILE_FRINGE:
     
    730730    psString tmpName = pmConfigConvertFilename (file->filename, config, create, false);
    731731    if (!tmpName) {
    732         psError(PS_ERR_IO, false, "failed to determine real name from template for %s\n", file->filename);
    733         return false;
     732        psError(PS_ERR_IO, false, "failed to determine real name from template for %s\n", file->filename);
     733        return false;
    734734    }
    735735    psFree (file->filename);
     
    740740      case PM_FPA_FILE_IMAGE:
    741741      case PM_FPA_FILE_MASK:
    742       case PM_FPA_FILE_WEIGHT:
     742      case PM_FPA_FILE_VARIANCE:
    743743      case PM_FPA_FILE_HEADER:
    744744      case PM_FPA_FILE_FRINGE:
     
    783783          // determine camera if not specified already
    784784          // XXX can I actually reach this with camera not specified??
    785           psMetadata *camera = NULL;
    786           psString formatName = NULL;
    787           psString cameraName = NULL;
     785          psMetadata *camera = NULL;
     786          psString formatName = NULL;
     787          psString cameraName = NULL;
    788788          file->format = pmConfigCameraFormatFromHeader (&camera, &cameraName, &formatName, config, phu, true);
    789789          if (!file->format) {
     
    794794          psFree(phu);
    795795
    796           pmFPA *newFPA = pmFPAConstruct (camera, formatName);
    797           if (!newFPA) {
    798               psError(PS_ERR_IO, false, "Failed to construct FPA from %s for %s", file->filename, formatName);
    799               psFree(camera);
    800               psFree(formatName);
    801               return NULL;
    802           }
    803           psFree(camera);
    804           psFree(formatName);
    805           psFree(cameraName);
    806 
    807           // XXX this is really dangerous...
    808           psFree (file->fpa);
    809           file->fpa = newFPA;
     796          pmFPA *newFPA = pmFPAConstruct (camera, formatName);
     797          if (!newFPA) {
     798              psError(PS_ERR_IO, false, "Failed to construct FPA from %s for %s", file->filename, formatName);
     799              psFree(camera);
     800              psFree(formatName);
     801              return NULL;
     802          }
     803          psFree(camera);
     804          psFree(formatName);
     805          psFree(cameraName);
     806
     807          // XXX this is really dangerous...
     808          psFree (file->fpa);
     809          file->fpa = newFPA;
    810810        }
    811811
     
    938938      case PM_FPA_FILE_IMAGE:
    939939      case PM_FPA_FILE_MASK:
    940       case PM_FPA_FILE_WEIGHT:
     940      case PM_FPA_FILE_VARIANCE:
    941941      case PM_FPA_FILE_DARK:
    942942      case PM_FPA_FILE_FRINGE:
Note: See TracChangeset for help on using the changeset viewer.