IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 5, 2009, 4:31:25 PM (17 years ago)
Author:
Paul Price
Message:

Merging pap_branch_20090128. Resolved a small number of conflicts. Compiles, but not tested in detail.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmFPAfileIO.c

    r20937 r21363  
    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:
     
    771771          }
    772772
    773           // XXX if we have a mask file, then we need to read the mask bit names
    774           // defined for this file
    775           if (file->type == PM_FPA_FILE_MASK) {
    776             if (!pmConfigMaskReadHeader (config, phu)) {
    777                 psError(PS_ERR_IO, false, "error in mask bits");
    778                 return false;
    779             }
    780           }
    781 
    782773          // determine the current format from the header
    783774          // determine camera if not specified already
    784775          // XXX can I actually reach this with camera not specified??
    785           psMetadata *camera = NULL;
    786           psString formatName = NULL;
    787           psString cameraName = NULL;
    788           file->format = pmConfigCameraFormatFromHeader (&camera, &cameraName, &formatName, config, phu, true);
     776          psMetadata *camera = NULL;
     777          psString formatName = NULL;
     778          psString cameraName = NULL;
     779          file->format = pmConfigCameraFormatFromHeader(&camera, &cameraName, &formatName, config, phu, true);
    789780          if (!file->format) {
    790781            psError(PS_ERR_IO, false, "Failed to read CCD format from %s\n", file->filename);
     
    794785          psFree(phu);
    795786
    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;
     787          pmFPA *newFPA = pmFPAConstruct (camera, formatName);
     788          if (!newFPA) {
     789              psError(PS_ERR_IO, false, "Failed to construct FPA from %s for %s", file->filename, formatName);
     790              psFree(camera);
     791              psFree(formatName);
     792              return NULL;
     793          }
     794          psFree(camera);
     795          psFree(formatName);
     796          psFree(cameraName);
     797
     798          // XXX this is really dangerous...
     799          psFree (file->fpa);
     800          file->fpa = newFPA;
    810801        }
    811802
     
    938929      case PM_FPA_FILE_IMAGE:
    939930      case PM_FPA_FILE_MASK:
    940       case PM_FPA_FILE_WEIGHT:
     931      case PM_FPA_FILE_VARIANCE:
    941932      case PM_FPA_FILE_DARK:
    942933      case PM_FPA_FILE_FRINGE:
Note: See TracChangeset for help on using the changeset viewer.