Changeset 30228
- Timestamp:
- Jan 9, 2011, 12:46:38 PM (15 years ago)
- Location:
- branches/eam_branches/ipp-20101205/ppStack/src
- Files:
-
- 3 edited
-
ppStack.h (modified) (1 diff)
-
ppStackConvolve.c (modified) (1 diff)
-
ppStackFiles.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20101205/ppStack/src/ppStack.h
r30015 r30228 192 192 ); 193 193 194 bool ppStackWriteVariance(const char *name, // Name of image 195 psMetadata *header, // Header 196 const psImage *variance, // Variance 197 const psImage *covariance, // Variance 198 pmConfig *config // Configuration 199 ); 200 194 201 /// Return an appropriate exit code based on the error code 195 202 psExit ppStackExitCode(psExit exitValue); -
branches/eam_branches/ipp-20101205/ppStack/src/ppStackConvolve.c
r30015 r30228 171 171 } 172 172 psFree(maskHeader); 173 if (!ppStackWrite Image(options->convVariances->data[i], hdu->header, readout->variance, config)) {173 if (!ppStackWriteVariance(options->convVariances->data[i], hdu->header, readout->variance, readout->covariance->image, config)) { 174 174 psError(PPSTACK_ERR_IO, false, "Unable to write convolved variance %d", i); 175 175 psFree(fpaList); -
branches/eam_branches/ipp-20101205/ppStack/src/ppStackFiles.c
r30015 r30228 200 200 return true; 201 201 } 202 203 // Write an image to a FITS file 204 bool ppStackWriteVariance(const char *name, // Name of image 205 psMetadata *header, // Header 206 const psImage *variance, // Variance 207 const psImage *covariance, // Variance 208 pmConfig *config // Configuration 209 ) 210 { 211 assert(name); 212 assert(variance); 213 214 psString resolved = pmConfigConvertFilename(name, config, true, true); // Resolved file name 215 psFits *fits = psFitsOpen(resolved, "w"); 216 if (!fits) { 217 psError(PPSTACK_ERR_IO, false, "Unable to open FITS file %s to write image.", resolved); 218 psFree(resolved); 219 return false; 220 } 221 if (!psFitsWriteImage(fits, header, variance, 0, NULL)) { 222 psError(PPSTACK_ERR_IO, false, "Unable to write FITS image %s.", resolved); 223 psFitsClose(fits); 224 psFree(resolved); 225 return false; 226 } 227 if (covariance) { 228 psMetadata *tmphead = psMetadataAlloc(); 229 psMetadataAddS32(tmphead, PS_LIST_TAIL, "COVARIANCE.CENTRE.X", PS_META_REPLACE, "center", (int)(covariance->numCols / 2)); 230 psMetadataAddS32(tmphead, PS_LIST_TAIL, "COVARIANCE.CENTRE.Y", PS_META_REPLACE, "center", (int)(covariance->numRows / 2)); 231 if (!psFitsWriteImage(fits, tmphead, covariance, 0, "COVAR_SkyChip_SkyCell")) { 232 psError(PPSTACK_ERR_IO, false, "Unable to write FITS image %s.", resolved); 233 psFitsClose(fits); 234 psFree(resolved); 235 return false; 236 } 237 } 238 if (!psFitsClose(fits)) { 239 psError(PPSTACK_ERR_IO, false, "Unable to close FITS image %s.", resolved); 240 psFree(resolved); 241 return false; 242 } 243 psFree(resolved); 244 return true; 245 }
Note:
See TracChangeset
for help on using the changeset viewer.
