Changeset 21363 for trunk/psModules/src/camera/pmFPAfileIO.c
- Timestamp:
- Feb 5, 2009, 4:31:25 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/camera/pmFPAfileIO.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAfileIO.c
r20937 r21363 173 173 status = pmFPAviewReadFitsMask(view, file, config); 174 174 break; 175 case PM_FPA_FILE_ WEIGHT:176 status = pmFPAviewReadFits Weight(view, file, config);175 case PM_FPA_FILE_VARIANCE: 176 status = pmFPAviewReadFitsVariance(view, file, config); 177 177 break; 178 178 case PM_FPA_FILE_HEADER: … … 262 262 case PM_FPA_FILE_IMAGE: 263 263 case PM_FPA_FILE_MASK: 264 case PM_FPA_FILE_ WEIGHT:264 case PM_FPA_FILE_VARIANCE: 265 265 case PM_FPA_FILE_FRINGE: 266 266 case PM_FPA_FILE_DARK: { … … 427 427 status = pmFPAviewWriteFitsMask(view, file, config); 428 428 break; 429 case PM_FPA_FILE_ WEIGHT:430 status = pmFPAviewWriteFits Weight(view, file, config);429 case PM_FPA_FILE_VARIANCE: 430 status = pmFPAviewWriteFitsVariance(view, file, config); 431 431 break; 432 432 case PM_FPA_FILE_HEADER: … … 524 524 case PM_FPA_FILE_IMAGE: 525 525 case PM_FPA_FILE_MASK: 526 case PM_FPA_FILE_ WEIGHT:526 case PM_FPA_FILE_VARIANCE: 527 527 case PM_FPA_FILE_HEADER: 528 528 case PM_FPA_FILE_FRINGE: … … 589 589 case PM_FPA_FILE_IMAGE: 590 590 case PM_FPA_FILE_MASK: 591 case PM_FPA_FILE_ WEIGHT:591 case PM_FPA_FILE_VARIANCE: 592 592 case PM_FPA_FILE_HEADER: 593 593 case PM_FPA_FILE_FRINGE: … … 730 730 psString tmpName = pmConfigConvertFilename (file->filename, config, create, false); 731 731 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; 734 734 } 735 735 psFree (file->filename); … … 740 740 case PM_FPA_FILE_IMAGE: 741 741 case PM_FPA_FILE_MASK: 742 case PM_FPA_FILE_ WEIGHT:742 case PM_FPA_FILE_VARIANCE: 743 743 case PM_FPA_FILE_HEADER: 744 744 case PM_FPA_FILE_FRINGE: … … 771 771 } 772 772 773 // XXX if we have a mask file, then we need to read the mask bit names774 // defined for this file775 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 782 773 // determine the current format from the header 783 774 // determine camera if not specified already 784 775 // 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); 789 780 if (!file->format) { 790 781 psError(PS_ERR_IO, false, "Failed to read CCD format from %s\n", file->filename); … … 794 785 psFree(phu); 795 786 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; 810 801 } 811 802 … … 938 929 case PM_FPA_FILE_IMAGE: 939 930 case PM_FPA_FILE_MASK: 940 case PM_FPA_FILE_ WEIGHT:931 case PM_FPA_FILE_VARIANCE: 941 932 case PM_FPA_FILE_DARK: 942 933 case PM_FPA_FILE_FRINGE:
Note:
See TracChangeset
for help on using the changeset viewer.
