IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 7229


Ignore:
Timestamp:
May 26, 2006, 3:49:22 PM (20 years ago)
Author:
Paul Price
Message:

Changing p_psFitsWriteHeader to psFitsWriteHeader (no check on the HDU). Changing psFitsWriteHeader to psFitsWriteBlank (generate blank HDU with header only).

Location:
trunk/psLib/src/fits
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/fits/psFitsHeader.c

    r7227 r7229  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2006-05-26 03:24:49 $
     9 *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2006-05-27 01:49:22 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    219219
    220220
    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                         )
     221bool psFitsWriteHeader(psMetadata *output, // Metadata that is to be output into the FITS file
     222                       psFits *fits     // The FITS file handle
     223                      )
    226224{
    227225    if (!fits) {
     
    314312}
    315313
    316 bool psFitsWriteHeader(psMetadata* output,
    317                        psFits* fits)
     314bool psFitsWriteBlank(psMetadata* output,
     315                      psFits* fits)
    318316{
    319317    if (!fits) {
     
    327325    }
    328326
    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);
    344338}
    345339
  • trunk/psLib/src/fits/psFitsHeader.h

    r7227 r7229  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2006-05-26 03:24:49 $
     9 *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2006-05-27 01:49:22 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    4242
    4343/** 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.
    4545 *
    4646 * @return bool         if TRUE, the write was successful, otherwise FALSE.
    4747 */
    48 bool p_psFitsWriteHeader(
     48bool psFitsWriteHeader(
    4949    psMetadata* output,                 ///< the psMetadata data in which to write
    5050    psFits* fits                        ///< the psFits object
    5151);
    5252
    53 /** Writes the values of the metadata to an HDU header.
     53/** Writes a "blank" --- a header only, with no image or table.
    5454 *
    5555 *  @return bool        if TRUE, the write was successful, otherwise FALSE.
    5656 */
    57 bool psFitsWriteHeader(
     57bool psFitsWriteBlank(
    5858    psMetadata* output,                 ///< the psMetadata data in which to write
    59     psFits* fits                       ///< the psFits object
     59    psFits* fits                        ///< the psFits object
    6060);
    6161
  • trunk/psLib/src/fits/psFitsImage.c

    r7227 r7229  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2006-05-26 03:24:49 $
     9 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2006-05-27 01:49:22 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    335335    } else {
    336336        if (!after) {
    337             int chdu = psFitsGetExtNum(fits);   // Current HDU number
    338             if (chdu == 0) {
     337            if (psFitsGetExtNum(fits) == 0) {
    339338                // We're creating a replacement primary HDU.
    340339                // Set status to signal fits_insert_img to insert a new primary HDU
     
    349348    }
    350349
    351     if (header && !p_psFitsWriteHeader(header, fits)) {
     350    if (header && !psFitsWriteHeader(header, fits)) {
    352351        psError(PS_ERR_IO, false, "Unable to write FITS header.\n");
    353352        return false;
Note: See TracChangeset for help on using the changeset viewer.