IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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).

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.