/** @file  psFitsHeader.h
 *
 *  @brief Contains Fits header I/O routines
 *
 *  @ingroup FileIO
 *
 *  @author Robert DeSonia, MHPCC
 *
 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
 *  @date $Date: 2006-04-04 19:52:42 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
 */

#ifndef PS_FITSHEADER_H
#define PS_FITSHEADER_H

#include "psFits.h"
#include "psMetadata.h"

/// @addtogroup FileIO
/// @{

/** Reads the header of the current HDU.
 *
 *  @return psMetadata*   the header data
 */
psMetadata* psFitsReadHeader(
    psMetadata* out,
    ///< The psMetadata to add the header data.  If null, a new psMetadata is created.
    const psFits* fits                 ///< the psFits object
);

/** Reads the header of all HDUs.  The current HDU is not changed.
 *
 *  @return psMetadata*      the header data set as a number of metadata entries
 */
psMetadata* psFitsReadHeaderSet(
    psMetadata* out,                         ///< output metadata or NULL if new psMetadata is to be created.
    const psFits* fits                       ///< the psFits object
);

/** Writes the values of the metadata to the current HDU header.
 *
 *  @return bool        if TRUE, the write was successful, otherwise FALSE.
 */
bool psFitsWriteHeader(
    const psMetadata* output,          ///< the psMetadata data in which to write
    psFits* fits                       ///< the psFits object
);

/** psFitsHeaderValidate validates the supplied header so that it is in
 *  compliance to the FITS standard for header keyword names and types.
 *
 *  @return bool        TRUE if the resulting header conforms to the FITS
 *                      standard, otherwise FALSE
 */
bool psFitsHeaderValidate(psMetadata *header);

/// @}

#endif // #ifndef PS_FITS_H
