IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 18, 2008, 12:39:44 PM (18 years ago)
Author:
Paul Price
Message:

Configuration wasn't being passed along.

File:
1 edited

Legend:

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

    r18139 r18177  
    438438            PM_CONCEPT_SOURCE_DEFAULTS | PM_CONCEPT_SOURCE_DATABASE; // Concept sources to write
    439439        if (cell) {
    440             if (!pmConceptsWriteCell(cell, sources, true, NULL)) {
     440            if (!pmConceptsWriteCell(cell, sources, true, config)) {
    441441                psError(PS_ERR_IO, false, "Unable to write concepts for cell.\n");
    442442                return false;
    443443            }
    444444        } else if (chip) {
    445             if (!pmConceptsWriteChip(chip, sources, true, true, NULL)) {
     445            if (!pmConceptsWriteChip(chip, sources, true, true, config)) {
    446446                psError(PS_ERR_IO, false, "Unable to write concepts for chip.\n");
    447447                return false;
    448448            }
    449         } else if (!pmConceptsWriteFPA(fpa, sources, true, NULL)) {
     449        } else if (!pmConceptsWriteFPA(fpa, sources, true, config)) {
    450450            psError(PS_ERR_IO, false, "Unable to write concepts for FPA.\n");
    451451            return false;
     
    779779        file->fits->options = psMemIncrRefCounter(file->options);
    780780
    781         // in most cases, we have already open and read the phu and determined the format.
    782         // in some cases, (eg DetDB images), we have only just determined the filename.
    783         // we need to check the file format before we can work with the file
    784         if (!file->format) {
    785           psMetadata *phu = psFitsReadHeader (NULL, file->fits);
    786           if (!phu) {
    787             psError(PS_ERR_IO, false, "Failed to read file header %s\n", file->filename);
    788             return false;
    789           }
    790 
    791           // determine the current format from the header
    792           // determine camera if not specified already
    793           // XXX can I actually reach this with camera not specified??
    794           file->format = pmConfigCameraFormatFromHeader (NULL, NULL, config, phu, true);
    795           if (!file->format) {
    796             psError(PS_ERR_IO, false, "Failed to read CCD format from %s\n", file->filename);
    797             psFree(phu);
    798             return false;
    799           }
    800           psFree(phu);
    801         }
    802 
    803         // if needed, set the optional EXTWORD field based on the camera value
    804         psMetadata *fileMenu = psMetadataLookupMetadata (NULL, file->format, "FILE");
    805         if (!fileMenu) {
    806           psError (PS_ERR_IO, true, "FILE METADATA missing from camera format %s\n",
    807                    config->formatName);
    808           return false;
    809         }
    810         char *extword = psMetadataLookupStr (&status, fileMenu, "EXTWORD");
    811         if (status) {
    812           psFitsSetExtnameWord (file->fits, extword);
    813         }
     781        // in most cases, we have already open and read the phu and determined the format.
     782        // in some cases, (eg DetDB images), we have only just determined the filename.
     783        // we need to check the file format before we can work with the file
     784        if (!file->format) {
     785          psMetadata *phu = psFitsReadHeader (NULL, file->fits);
     786          if (!phu) {
     787            psError(PS_ERR_IO, false, "Failed to read file header %s\n", file->filename);
     788            return false;
     789          }
     790
     791          // determine the current format from the header
     792          // determine camera if not specified already
     793          // XXX can I actually reach this with camera not specified??
     794          file->format = pmConfigCameraFormatFromHeader (NULL, NULL, config, phu, true);
     795          if (!file->format) {
     796            psError(PS_ERR_IO, false, "Failed to read CCD format from %s\n", file->filename);
     797            psFree(phu);
     798            return false;
     799          }
     800          psFree(phu);
     801        }
     802
     803        // if needed, set the optional EXTWORD field based on the camera value
     804        psMetadata *fileMenu = psMetadataLookupMetadata (NULL, file->format, "FILE");
     805        if (!fileMenu) {
     806          psError (PS_ERR_IO, true, "FILE METADATA missing from camera format %s\n",
     807                   config->formatName);
     808          return false;
     809        }
     810        char *extword = psMetadataLookupStr (&status, fileMenu, "EXTWORD");
     811        if (status) {
     812          psFitsSetExtnameWord (file->fits, extword);
     813        }
    814814
    815815        // XXX these are probably only needed for WRITE files
     
    888888    psMetadata *phu = psFitsReadHeader (NULL, file->fits);
    889889    if (!file->format) {
    890         // determine the format (camera is already known); do not load the recipe
     890        // determine the format (camera is already known); do not load the recipe
    891891        file->format = pmConfigCameraFormatFromHeader (NULL, &file->formatName, config, phu, false);
    892892        if (!file->format) {
Note: See TracChangeset for help on using the changeset viewer.