Changeset 19385 for trunk/psModules/src/camera/pmHDU.c
- Timestamp:
- Sep 4, 2008, 10:21:35 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/camera/pmHDU.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmHDU.c
r15973 r19385 9 9 10 10 #include "pmConfig.h" 11 #include "pmConfigMask.h" 11 12 #include "pmHDU.h" 12 13 #include "pmFPA.h" … … 164 165 // Write an HDU to a FITS file 165 166 static bool hduWrite(pmHDU *hdu, // HDU to write 166 psArray *images, // Images to write 167 const psArray *images, // Images to write 168 const psArray *masks, // Masks to use when writing 169 psMaskType maskVal,// Value to mask 167 170 psFits *fits // FITS file to which to write 168 171 ) … … 205 208 if (images) { 206 209 psTrace("psModules.camera", 9, "Writing pixels for %s\n", hdu->extname); 207 if (!psFitsWriteImageCube (fits, hdu->header, images, extname)) {210 if (!psFitsWriteImageCubeWithMask(fits, hdu->header, images, masks, maskVal, extname)) { 208 211 psError(PS_ERR_IO, false, "Unable to write image to extension %s\n", hdu->extname); 209 212 return false; … … 214 217 215 218 // XXX: Add a region specifier? 216 bool pmHDUWrite(pmHDU *hdu, psFits *fits) 217 { 218 PS_ASSERT_PTR_NON_NULL(hdu, false); 219 PS_ASSERT_PTR_NON_NULL(fits, false); 220 221 return hduWrite(hdu, hdu->images, fits); 222 } 223 224 bool pmHDUWriteMask(pmHDU *hdu, psFits *fits) 225 { 226 PS_ASSERT_PTR_NON_NULL(hdu, false); 227 PS_ASSERT_PTR_NON_NULL(fits, false); 228 229 return hduWrite(hdu, hdu->masks, fits); 230 } 231 232 bool pmHDUWriteWeight(pmHDU *hdu, psFits *fits) 233 { 234 PS_ASSERT_PTR_NON_NULL(hdu, false); 235 PS_ASSERT_PTR_NON_NULL(fits, false); 236 237 return hduWrite(hdu, hdu->weights, fits); 238 } 219 bool pmHDUWrite(pmHDU *hdu, psFits *fits, const pmConfig *config) 220 { 221 PS_ASSERT_PTR_NON_NULL(hdu, false); 222 PS_ASSERT_PTR_NON_NULL(fits, false); 223 224 psMaskType maskVal = pmConfigMaskGet("MASK.VALUE", config); // Value to mask 225 return hduWrite(hdu, hdu->images, hdu->masks, maskVal, fits); 226 } 227 228 bool pmHDUWriteMask(pmHDU *hdu, psFits *fits, const pmConfig *config) 229 { 230 PS_ASSERT_PTR_NON_NULL(hdu, false); 231 PS_ASSERT_PTR_NON_NULL(fits, false); 232 233 // We don't supply a mask because we're writing the mask! 234 return hduWrite(hdu, hdu->masks, NULL, 0, fits); 235 } 236 237 bool pmHDUWriteWeight(pmHDU *hdu, psFits *fits, const pmConfig *config) 238 { 239 PS_ASSERT_PTR_NON_NULL(hdu, false); 240 PS_ASSERT_PTR_NON_NULL(fits, false); 241 242 psMaskType maskVal = pmConfigMaskGet("MASK.VALUE", config); // Value to mask 243 return hduWrite(hdu, hdu->weights, hdu->masks, maskVal, fits); 244 }
Note:
See TracChangeset
for help on using the changeset viewer.
