00001 /* @file psFitsImage.h 00002 * @brief Contains Fits I/O routines 00003 * 00004 * @author Robert DeSonia, MHPCC 00005 * 00006 * @version $Revision: 1.6 $ $Name: $ 00007 * @date $Date: 2007/01/23 22:47:23 $ 00008 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 00009 */ 00010 00011 #ifndef PS_FITSIMAGE_H 00012 #define PS_FITSIMAGE_H 00013 00014 /// @addtogroup FileIO Input/Output 00015 /// @{ 00016 00017 #include "psFits.h" 00018 #include "psType.h" 00019 #include "psArray.h" 00020 #include "psVector.h" 00021 #include "psMetadata.h" 00022 #include "psImage.h" 00023 00024 /** Reads an image, given the desired region and z-plane. 00025 * 00026 * @return psImage* the read image or NULL if there was an error. 00027 */ 00028 psImage* psFitsReadImage( 00029 const psFits* fits, ///< the psFits object 00030 psRegion region, ///< the region in the FITS image to read 00031 int z ///< the z-plane in the FITS image cube to read 00032 ); 00033 00034 // Read an image into an extant buffer 00035 psImage* psFitsReadImageBuffer(psImage *output, // Output image buffer 00036 const psFits *fits, // the psFits object 00037 psRegion region, // the region in the FITS image to read 00038 int z // the z-plane in the FITS image cube to read 00039 ); 00040 00041 /** Writes an image, given the desired region and z-plane. 00042 * 00043 * @return bool TRUE is the write was successful, otherwise FALSE. 00044 */ 00045 bool psFitsWriteImage( 00046 psFits* fits, ///< the psFits object 00047 const psMetadata* header, ///< header items for the new HDU. Can be NULL. 00048 const psImage* input, ///< the image to output 00049 int depth, ///< the number of z-planes of the FITS image data cube 00050 const char* extname ///< FITS extension name 00051 ); 00052 00053 /** Writes an image, given the desired region and z-plane. A new IMAGE HDU is 00054 * appended to the end of the FITS file. 00055 * 00056 * @return bool TRUE is the write was successful, otherwise FALSE. 00057 */ 00058 bool psFitsInsertImage( 00059 psFits* fits, ///< the psFits object 00060 const psMetadata* header, ///< header items for the new HDU. Can be NULL. 00061 const psImage* input, ///< the image to output 00062 int depth, ///< the number of z-planes of the FITS image data cube 00063 const char* extname, ///< FITS extension name 00064 bool after ///< if TRUE, inserts HDU after current HDU, otherwise before 00065 ); 00066 00067 /** Updates the FITS file image, given the desired region and z-plane. a new 00068 * IMAGE HDU is inserted before or after, depending on the AFTER parameter, 00069 * the current HDU. 00070 * 00071 * @return bool TRUE is the write was successful, otherwise FALSE. 00072 */ 00073 bool psFitsUpdateImage( 00074 psFits* fits, ///< the psFits object 00075 const psImage* input, ///< the image to output 00076 int x0, ///< psImage's x-axis origin in FITS image coordinates 00077 int y0, ///< psImage's y-axis origin in FITS image coordinates 00078 int z ///< the z-planes of the FITS image data cube to write 00079 ); 00080 00081 psArray *psFitsReadImageCube(const psFits *fits, psRegion region); 00082 bool psFitsWriteImageCube(psFits *fits, psMetadata *header, const psArray *input, const char *extname); 00083 bool psFitsUpdateImageCube(psFits *fits, const psArray *input, int x0, int y0); 00084 00085 /// @} 00086 #endif // #ifndef PS_FITS_H
1.5.1