Changeset 7168 for trunk/psModules/src/camera/pmFPAWrite.c
- Timestamp:
- May 22, 2006, 2:23:08 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/camera/pmFPAWrite.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAWrite.c
r7097 r7168 6 6 #include "pmHDU.h" 7 7 #include "pmHDUUtils.h" 8 #include "pmHDUGenerate.h" 8 9 #include "pmConcepts.h" 9 10 11 #include "pmFPAWrite.h" 10 12 11 13 bool pmReadoutWriteNext(pmReadout *readout, // Readout to write … … 51 53 return false; 52 54 } 53 psImage *image = hdu->images->data[z]; // The image from the HDU to write55 psImage *image = readout->image; // The image from the HDU to write 54 56 if (readout->row0 == 0 && readout->col0 == 0 && z == 0) { 55 57 // Then we can assume that nothing has been written to the FITS file for now … … 68 70 69 71 // We can simply update an existing HDU 70 if (!psFitsMoveExtName(fits, hdu->extname)) { 72 if (((hdu->phu || strcasecmp(hdu->extname, "PHU") == 0) && !psFitsMoveExtNum(fits, 0, false)) || 73 !psFitsMoveExtName(fits, hdu->extname)) { 71 74 psError(PS_ERR_IO, false, "Unable to move to extension %s\n", hdu->extname); 72 75 return false; … … 86 89 pmHDU *hdu = cell->hdu; // The HDU 87 90 if (hdu && ((!pixels && hdu->phu) || pixels)) { 91 if (pixels && !hdu->images && !pmHDUGenerateForCell(cell)) { 92 psError(PS_ERR_IO, false, "Unable to generate HDU for cell.\n"); 93 return false; 94 } 88 95 bool status = pmConceptsWriteCell(cell, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CAMERA | 89 96 PM_CONCEPT_SOURCE_DEFAULTS, false, NULL); … … 107 114 pmHDU *hdu = chip->hdu; // The HDU 108 115 if (hdu && ((!pixels && hdu->phu) || pixels)) { 116 if (pixels && !hdu->images && !pmHDUGenerateForChip(chip)) { 117 psError(PS_ERR_IO, false, "Unable to generate HDU for chip.\n"); 118 return false; 119 } 109 120 bool status = pmConceptsWriteChip(chip, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CAMERA | 110 121 PM_CONCEPT_SOURCE_DEFAULTS, false, NULL); … … 130 141 131 142 132 133 143 bool pmFPAWrite(pmFPA *fpa, // FPA to write 134 144 psFits *fits, // FITS file to which to write … … 139 149 pmHDU *hdu = fpa->hdu; // The HDU 140 150 if (hdu && ((!pixels && hdu->phu) || pixels)) { 151 if (pixels && !hdu->images && !pmHDUGenerateForFPA(fpa)) { 152 psError(PS_ERR_IO, false, "Unable to generate HDU for FPA.\n"); 153 return false; 154 } 141 155 bool status = pmConceptsWriteFPA(fpa, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CAMERA | 142 156 PM_CONCEPT_SOURCE_DEFAULTS, NULL);
Note:
See TracChangeset
for help on using the changeset viewer.
