IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20400


Ignore:
Timestamp:
Oct 26, 2008, 2:22:46 PM (18 years ago)
Author:
eugene
Message:

for files loaded from the detrend database, re-construct the fpa when the first header is loaded

Location:
trunk/psModules/src/camera
Files:
2 edited

Legend:

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

    r19167 r20400  
    940940        psTrace ("pmFPAfile", 5, "requiring use of detrend database source\n");
    941941        // don't free the file here: it is left on config->files
    942         // to be used optionally by pmFPAfileDefineFromDetDB (or others)
     942        // to be used optionally by pmFPAfileDefineFromDetDB (or others) XXX potentially free the fpa...
    943943        if (success) {
    944944            *success = true;
     
    10091009            return NULL;
    10101010        }
     1011
     1012        // XXX A TEST: this is a provisional fpa until we read the first header for this pmFPAfile
     1013        // we are going to replace it when we determine the true file.  blow this away here...
     1014        psFree (file->fpa);
     1015        file->fpa = NULL;
    10111016    }
    10121017
  • trunk/psModules/src/camera/pmFPAfileIO.c

    r20254 r20400  
    781781          // determine camera if not specified already
    782782          // XXX can I actually reach this with camera not specified??
    783           file->format = pmConfigCameraFormatFromHeader (NULL, NULL, config, phu, true);
     783          psMetadata *camera = NULL;
     784          psString formatName = NULL;
     785          file->format = pmConfigCameraFormatFromHeader (&camera, &formatName, config, phu, true);
    784786          if (!file->format) {
    785787            psError(PS_ERR_IO, false, "Failed to read CCD format from %s\n", file->filename);
     
    788790          }
    789791          psFree(phu);
     792
     793          pmFPA *newFPA = pmFPAConstruct (camera, formatName);
     794          if (!newFPA) {
     795              psError(PS_ERR_IO, false, "Failed to construct FPA from %s for %s", file->filename, formatName);
     796              psFree(camera);
     797              psFree(formatName);
     798              return NULL;
     799          }
     800          psFree(camera);
     801          psFree(formatName);
     802
     803          // XXX this is really dangerous...
     804          psFree (file->fpa);
     805          file->fpa = newFPA;
    790806        }
    791807
Note: See TracChangeset for help on using the changeset viewer.