Changeset 15180 for trunk/psModules/src/camera/pmFPAfileIO.c
- Timestamp:
- Oct 3, 2007, 11:32:43 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/camera/pmFPAfileIO.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAfileIO.c
r15140 r15180 359 359 return false; 360 360 } 361 362 // do we need to write out a PHU? 363 if (!pmFPAfileWritePHU(file, fileView, config)) { 364 psError(PS_ERR_IO, false, "failed to write phu for %s (%s)", file->filename, file->name); 365 return false; 366 } 367 361 368 psFree (fileView); 362 369 } 363 370 364 // do we need to write out a PHU? 365 if (level >= file->fileLevel) { 366 if (!pmFPAfileWritePHU (file, view, config)) { 367 psError(PS_ERR_IO, false, "failed to write phu for %s (%s)", file->filename, file->name); 371 if (file->compression) { 372 psTrace("psModules.camera", 7, "Setting compression for %s (%s)\n", file->filename, file->name); 373 if (!psFitsCompressionApply(file->fits, file->compression)) { 374 psError(PS_ERR_UNKNOWN, false, "Unable to set compression options for %s (%s) (%d:%d:%d)\n", 375 file->filename, file->name, view->chip, view->cell, view->readout); 368 376 return false; 369 377 } … … 667 675 case PM_FPA_FILE_CMF: 668 676 case PM_FPA_FILE_PSF: 669 psTrace ("psModules.camera", 5, "opening %s (%s) (%d:%d:%d)\n", file->filename, file->name, view->chip, view->cell, view->readout); 677 psTrace ("psModules.camera", 5, "opening %s (%s) (%d:%d:%d)\n", 678 file->filename, file->name, view->chip, view->cell, view->readout); 670 679 file->fits = psFitsOpen (file->filename, mode); 671 680 if (file->fits == NULL) { … … 679 688 psMetadata *fileMenu = psMetadataLookupMetadata (NULL, file->format, "FILE"); 680 689 if (!fileMenu) { 681 psError (PS_ERR_IO, true, "FILE METADATA missing from camera format %s\n", file->formatName); 690 psError (PS_ERR_IO, true, "FILE METADATA missing from camera format %s\n", 691 config->formatName); 682 692 return false; 683 693 } … … 688 698 } 689 699 690 // In some cases, we need to read the PHU after we've opened the file. This happens for 691 // the images supplied by the detrend database, which are only identified here (pmConfigConvertFilename). 700 if (file->compression) { 701 psTrace("psModules.camera", 7, "Setting compression for %s (%s)\n", file->filename, file->name); 702 if (!psFitsCompressionApply(file->fits, file->compression)) { 703 psError(PS_ERR_UNKNOWN, false, "Unable to set compression options for %s (%s) (%d:%d:%d)\n", 704 file->filename, file->name, view->chip, view->cell, view->readout); 705 return false; 706 } 707 } 708 709 // In some cases, we need to read the PHU after we've opened the file. This happens for the images 710 // supplied by the detrend database, which are only identified here (pmConfigConvertFilename). 692 711 if (!pmFPAfileReadPHU (file, view, config)) { 693 psError (PS_ERR_IO, true, "error reading PHU for %s (%s) (%d:%d:%d)\n", file->filename, file->name, view->chip, view->cell, view->readout); 712 psError (PS_ERR_IO, true, "error reading PHU for %s (%s) (%d:%d:%d)\n", 713 file->filename, file->name, view->chip, view->cell, view->readout); 694 714 return false; 695 715 } … … 758 778 return false; 759 779 } 760 file->formatName = psStringCopy(config->formatName);780 file->formatName = psStringCopy(config->formatName); 761 781 762 782 } else { … … 796 816 case PM_FPA_FILE_WEIGHT: 797 817 case PM_FPA_FILE_FRINGE: 798 status = pmFPAviewFitsWritePHU (view, file, config);799 break;818 status = pmFPAviewFitsWritePHU (view, file, config); 819 break; 800 820 case PM_FPA_FILE_CMF: 801 status = pmSource_CMF_WritePHU (view, file, config);802 break;821 status = pmSource_CMF_WritePHU (view, file, config); 822 break; 803 823 case PM_FPA_FILE_PSF: 804 status = pmPSFmodelWritePHU (view, file, config);805 break;824 status = pmPSFmodelWritePHU (view, file, config); 825 break; 806 826 case PM_FPA_FILE_SX: 807 827 case PM_FPA_FILE_RAW:
Note:
See TracChangeset
for help on using the changeset viewer.
