Changeset 9983 for trunk/psModules/src/camera/pmHDU.c
- Timestamp:
- Nov 14, 2006, 2:40:02 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/camera/pmHDU.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmHDU.c
r9609 r9983 124 124 } 125 125 126 // XXX: Add a region specifier? 127 bool pmHDUWrite(pmHDU *hdu, psFits *fits) 126 // Write an HDU to a FITS file 127 bool hduWrite(pmHDU *hdu, // HDU to write 128 psArray *images, // Images to write 129 psFits *fits // FITS file to which to write 130 ) 128 131 { 129 PS_ASSERT_PTR_NON_NULL(hdu, false);130 PS_ASSERT_PTR_NON_NULL(fits, false);132 assert(hdu); 133 assert(fits); 131 134 132 135 psTrace("psModules.camera", 7, "Writing HDU %s\n", hdu->extname); 133 136 134 if (hdu->images && !hdu->header) { 135 psError(PS_ERR_IO, true, "Both image and table data provided in HDU, but no header --- " 136 "don't know which to write!\n"); 137 return false; 138 } 139 140 if (!hdu->images && !hdu->header) { 137 if (!images && !hdu->header) { 141 138 psLogMsg(__func__, PS_LOG_WARN, "Nothing to write for HDU %s\n", hdu->extname); 142 139 return false; … … 154 151 155 152 // Only a header 156 if (! hdu->images && !psFitsWriteBlank(fits, hdu->header, extname)) {153 if (!images && !psFitsWriteBlank(fits, hdu->header, extname)) { 157 154 psError(PS_ERR_IO, false, "Unable to write header for extension %s\n", extname); 158 155 } 159 156 160 if ( hdu->images) {157 if (images) { 161 158 psTrace("psModules.camera", 9, "Writing pixels for %s\n", hdu->extname); 162 if (!psFitsWriteImageCube(fits, hdu->header, hdu->images, extname)) {159 if (!psFitsWriteImageCube(fits, hdu->header, images, extname)) { 163 160 psError(PS_ERR_IO, false, "Unable to write image to extension %s\n", hdu->extname); 164 161 return false; … … 168 165 } 169 166 167 // XXX: Add a region specifier? 168 bool pmHDUWrite(pmHDU *hdu, psFits *fits) 169 { 170 PS_ASSERT_PTR_NON_NULL(hdu, false); 171 PS_ASSERT_PTR_NON_NULL(fits, false); 172 173 return hduWrite(hdu, hdu->images, fits); 174 } 175 176 bool pmHDUWriteMask(pmHDU *hdu, psFits *fits) 177 { 178 PS_ASSERT_PTR_NON_NULL(hdu, false); 179 PS_ASSERT_PTR_NON_NULL(fits, false); 180 181 return hduWrite(hdu, hdu->masks, fits); 182 } 183
Note:
See TracChangeset
for help on using the changeset viewer.
