Changeset 7229
- Timestamp:
- May 26, 2006, 3:49:22 PM (20 years ago)
- Location:
- trunk/psLib/src/fits
- Files:
-
- 3 edited
-
psFitsHeader.c (modified) (4 diffs)
-
psFitsHeader.h (modified) (2 diffs)
-
psFitsImage.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/fits/psFitsHeader.c
r7227 r7229 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $10 * @date $Date: 2006-05-2 6 03:24:49$9 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-05-27 01:49:22 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 219 219 220 220 221 // Do the work of writing out the header. 222 // Doesn't check to see if a new HDU needs to be created 223 bool p_psFitsWriteHeader(psMetadata *output, // Metadata that is to be output into the FITS file 224 psFits *fits // The FITS file handle 225 ) 221 bool psFitsWriteHeader(psMetadata *output, // Metadata that is to be output into the FITS file 222 psFits *fits // The FITS file handle 223 ) 226 224 { 227 225 if (!fits) { … … 314 312 } 315 313 316 bool psFitsWrite Header(psMetadata* output,317 psFits* fits)314 bool psFitsWriteBlank(psMetadata* output, 315 psFits* fits) 318 316 { 319 317 if (!fits) { … … 327 325 } 328 326 329 // Check to see if there are any extant HDUs 330 int hdus = psFitsGetSize(fits); // Number of HDUs 331 if (hdus == 0) { 332 // Need to create a dummy image HDU for the primary HDU 333 int status = 0; // Status of cfitsio 334 fits_create_img(fits->fd, 16, 0, NULL, &status); 335 if (status) { 336 char fitsErr[MAX_STRING_LENGTH]; 337 (void)fits_get_errstatus(status, fitsErr); 338 psError(PS_ERR_IO, true, "Unable to create primary header.\n%s\n", fitsErr); 339 return false; 340 } 341 } 342 343 return p_psFitsWriteHeader(output, fits); 327 // Create a dummy image HDU for the primary HDU 328 int status = 0; // Status of cfitsio 329 fits_create_img(fits->fd, 16, 0, NULL, &status); 330 if (status) { 331 char fitsErr[MAX_STRING_LENGTH]; 332 (void)fits_get_errstatus(status, fitsErr); 333 psError(PS_ERR_IO, true, "Unable to create primary header.\n%s\n", fitsErr); 334 return false; 335 } 336 337 return psFitsWriteHeader(output, fits); 344 338 } 345 339 -
trunk/psLib/src/fits/psFitsHeader.h
r7227 r7229 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $10 * @date $Date: 2006-05-2 6 03:24:49$9 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-05-27 01:49:22 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 42 42 43 43 /** Writes the values of the metadata to the current HDU header. 44 * Doesn't check if the header has to be created , so not for general public use.44 * Doesn't check if the header has to be created. 45 45 * 46 46 * @return bool if TRUE, the write was successful, otherwise FALSE. 47 47 */ 48 bool p _psFitsWriteHeader(48 bool psFitsWriteHeader( 49 49 psMetadata* output, ///< the psMetadata data in which to write 50 50 psFits* fits ///< the psFits object 51 51 ); 52 52 53 /** Writes the values of the metadata to an HDU header.53 /** Writes a "blank" --- a header only, with no image or table. 54 54 * 55 55 * @return bool if TRUE, the write was successful, otherwise FALSE. 56 56 */ 57 bool psFitsWrite Header(57 bool psFitsWriteBlank( 58 58 psMetadata* output, ///< the psMetadata data in which to write 59 psFits* fits ///< the psFits object59 psFits* fits ///< the psFits object 60 60 ); 61 61 -
trunk/psLib/src/fits/psFitsImage.c
r7227 r7229 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $10 * @date $Date: 2006-05-2 6 03:24:49$9 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-05-27 01:49:22 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 335 335 } else { 336 336 if (!after) { 337 int chdu = psFitsGetExtNum(fits); // Current HDU number 338 if (chdu == 0) { 337 if (psFitsGetExtNum(fits) == 0) { 339 338 // We're creating a replacement primary HDU. 340 339 // Set status to signal fits_insert_img to insert a new primary HDU … … 349 348 } 350 349 351 if (header && !p _psFitsWriteHeader(header, fits)) {350 if (header && !psFitsWriteHeader(header, fits)) { 352 351 psError(PS_ERR_IO, false, "Unable to write FITS header.\n"); 353 352 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
