| 1 | #ifndef FITSFILE_H
 | 
|---|
| 2 | #define FITSFILE_H
 | 
|---|
| 3 | 
 | 
|---|
| 4 | #include "ndatablock.h"
 | 
|---|
| 5 | #include "dvlist.h"
 | 
|---|
| 6 | #include "FitsIO/fitsio.h" 
 | 
|---|
| 7 | 
 | 
|---|
| 8 | #define OPENFILE    0
 | 
|---|
| 9 | #define CREATEFILE  1
 | 
|---|
| 10 | #define LEN_KEYWORD 9
 | 
|---|
| 11 | 
 | 
|---|
| 12 | // classes for saving/loading SOPHYA objects to/from FITS files...
 | 
|---|
| 13 | // Guy le Meur (september 2000)
 | 
|---|
| 14 | 
 | 
|---|
| 15 | 
 | 
|---|
| 16 | namespace SOPHYA {
 | 
|---|
| 17 | 
 | 
|---|
| 18 |   struct BnTblLine;
 | 
|---|
| 19 |   class BufferLine;
 | 
|---|
| 20 |   class FitsFile;
 | 
|---|
| 21 |   class FitsInFile;
 | 
|---|
| 22 |   class FitsOutFile;
 | 
|---|
| 23 | 
 | 
|---|
| 24 | 
 | 
|---|
| 25 | 
 | 
|---|
| 26 | class  FitsKeyword
 | 
|---|
| 27 | {
 | 
|---|
| 28 | 
 | 
|---|
| 29 |  public:
 | 
|---|
| 30 | 
 | 
|---|
| 31 | FitsKeyword();
 | 
|---|
| 32 | FitsKeyword(string comment);
 | 
|---|
| 33 | FitsKeyword(string keyname, string value, string comment); 
 | 
|---|
| 34 | FitsKeyword(string keyname, string value, string comment, char type); 
 | 
|---|
| 35 | void writeOnFits(fitsfile* ptr);
 | 
|---|
| 36 | 
 | 
|---|
| 37 | void Print();
 | 
|---|
| 38 | 
 | 
|---|
| 39 |  private:
 | 
|---|
| 40 | 
 | 
|---|
| 41 |   char datatype_;
 | 
|---|
| 42 |   string keyname_;
 | 
|---|
| 43 |   double dvalue_;
 | 
|---|
| 44 |   int ivalue_;
 | 
|---|
| 45 |   string svalue_;
 | 
|---|
| 46 |   string comment_;
 | 
|---|
| 47 | };
 | 
|---|
| 48 | 
 | 
|---|
| 49 | 
 | 
|---|
| 50 | 
 | 
|---|
| 51 | //
 | 
|---|
| 52 | //! Class for managing Interface for SOPHYA objects to FITS Format Files (uses cfitsio lib)
 | 
|---|
| 53 | 
 | 
|---|
| 54 | class FitsIOHandler {
 | 
|---|
| 55 | 
 | 
|---|
| 56 | 
 | 
|---|
| 57 |  public:
 | 
|---|
| 58 | 
 | 
|---|
| 59 |    virtual ~FitsIOHandler() {}
 | 
|---|
| 60 |    void   Read(char flnm[],int hdunum= 0);
 | 
|---|
| 61 |    void   Write(char flnm[]) ;
 | 
|---|
| 62 |    void   Read(FitsInFile& ifts, int hdunum=0);
 | 
|---|
| 63 |    void   Write(FitsOutFile& ofts) ;
 | 
|---|
| 64 | 
 | 
|---|
| 65 | 
 | 
|---|
| 66 |  protected:
 | 
|---|
| 67 |   
 | 
|---|
| 68 |    virtual void    ReadFromFits(FitsInFile& is)=0;           
 | 
|---|
| 69 |    virtual void    WriteToFits(FitsOutFile& os) =0;   
 | 
|---|
| 70 |         
 | 
|---|
| 71 |    friend class FitsInFile;
 | 
|---|
| 72 |    friend class FitsOutFile;
 | 
|---|
| 73 |   };
 | 
|---|
| 74 | 
 | 
|---|
| 75 | 
 | 
|---|
| 76 | //! Class (virtual) for managing FITS format files
 | 
|---|
| 77 |  class FitsFile {
 | 
|---|
| 78 | 
 | 
|---|
| 79 |  public:
 | 
|---|
| 80 | 
 | 
|---|
| 81 |    enum WriteMode {append, clear, unknown};
 | 
|---|
| 82 | 
 | 
|---|
| 83 |    enum FitsExtensionType {
 | 
|---|
| 84 |      FitsExtensionType_NULL,
 | 
|---|
| 85 |      FitsExtensionType_IMAGE,
 | 
|---|
| 86 |      FitsExtensionType_ASCII_TBL,
 | 
|---|
| 87 |      FitsExtensionType_BINARY_TBL,
 | 
|---|
| 88 |      FitsExtensionType_EOF,
 | 
|---|
| 89 |      FitsExtensionType_ERROR
 | 
|---|
| 90 |    };
 | 
|---|
| 91 |    enum FitsDataType {
 | 
|---|
| 92 |      FitsDataType_NULL,
 | 
|---|
| 93 |      FitsDataType_double,
 | 
|---|
| 94 |      FitsDataType_float,
 | 
|---|
| 95 |      FitsDataType_int,
 | 
|---|
| 96 |      FitsDataType_char,
 | 
|---|
| 97 |      FitsDataType_ASCII,
 | 
|---|
| 98 |      FitsDataType_long,
 | 
|---|
| 99 |      FitsDataType_byte,
 | 
|---|
| 100 |      FitsDataType_short
 | 
|---|
| 101 |    };
 | 
|---|
| 102 | 
 | 
|---|
| 103 | 
 | 
|---|
| 104 | class BufferLine
 | 
|---|
| 105 | 
 | 
|---|
| 106 |   {
 | 
|---|
| 107 |     public :
 | 
|---|
| 108 | 
 | 
|---|
| 109 | BufferLine() {;}
 | 
|---|
| 110 | BufferLine(const vector<FitsFile::FitsDataType>& types);
 | 
|---|
| 111 | inline const vector< pair<FitsFile::FitsDataType, int> >& identificateur() const {return id_;}
 | 
|---|
| 112 |  inline r_8&    r_8Array(int k) { return ddata_[k];}
 | 
|---|
| 113 |  inline const r_8&    r_8Array(int k) const { return ddata_[k];}
 | 
|---|
| 114 |  inline r_4& r_4Array(int k) { return fdata_[k];}
 | 
|---|
| 115 |  inline const r_4& r_4Array(int k) const { return fdata_[k];}
 | 
|---|
| 116 | 
 | 
|---|
| 117 | 
 | 
|---|
| 118 |  inline int_2& int_2Array(int k) { return shdata_[k];}
 | 
|---|
| 119 |  inline const int_2& int_2Array(int k) const { return shdata_[k];}
 | 
|---|
| 120 |  inline int_4& int_4Array(int k) { return idata_[k];}
 | 
|---|
| 121 |  inline const int_4& int_4Array(int k) const { return idata_[k];}
 | 
|---|
| 122 | 
 | 
|---|
| 123 | 
 | 
|---|
| 124 |  inline int_8& int_8Array(int k) { return ldata_[k];}
 | 
|---|
| 125 |  inline const int_8& int_8Array(int k) const { return ldata_[k];}
 | 
|---|
| 126 |  inline string& stringArray(int k) { return cdata_[k];}
 | 
|---|
| 127 |  inline const string& stringArray(int k) const { return cdata_[k];}
 | 
|---|
| 128 |  inline unsigned char& u_charArray(int k) { return bdata_[k];}
 | 
|---|
| 129 |  inline const unsigned char& u_charArray(int k) const { return bdata_[k];}
 | 
|---|
| 130 | 
 | 
|---|
| 131 | 
 | 
|---|
| 132 |  void Print() const;
 | 
|---|
| 133 | 
 | 
|---|
| 134 | 
 | 
|---|
| 135 |     private :
 | 
|---|
| 136 |       // la paire contient le type de la variable et le rang dans le tableau
 | 
|---|
| 137 |       // du type
 | 
|---|
| 138 |    vector< pair<FitsFile::FitsDataType, int> > id_;
 | 
|---|
| 139 |    vector<r_8>     ddata_;
 | 
|---|
| 140 |    vector<r_4>     fdata_;
 | 
|---|
| 141 |    vector<int_2>   shdata_; 
 | 
|---|
| 142 |    vector<int_4>   idata_; 
 | 
|---|
| 143 |    vector<int_8>   ldata_;
 | 
|---|
| 144 |    vector<string>  cdata_;
 | 
|---|
| 145 |    vector<unsigned char>   bdata_;
 | 
|---|
| 146 |   };
 | 
|---|
| 147 | 
 | 
|---|
| 148 | 
 | 
|---|
| 149 | 
 | 
|---|
| 150 |    FitsFile() { InitNull(); };
 | 
|---|
| 151 |    virtual ~FitsFile();
 | 
|---|
| 152 |    static string GetErrStatus(int status);
 | 
|---|
| 153 |    inline  int   statusF() const { return fits_status_;}
 | 
|---|
| 154 |    inline void firstImageOnPrimaryHeader(bool choice) {imageOnPrimary_=choice;}
 | 
|---|
| 155 |    inline int currentHeaderIndex() {return hdunum_;}
 | 
|---|
| 156 |  
 | 
|---|
| 157 | 
 | 
|---|
| 158 |  protected:
 | 
|---|
| 159 | 
 | 
|---|
| 160 | 
 | 
|---|
| 161 | 
 | 
|---|
| 162 | 
 | 
|---|
| 163 | 
 | 
|---|
| 164 | 
 | 
|---|
| 165 | void         ResetStatus(int& status) ; 
 | 
|---|
| 166 | static  void printerror(int&) ;
 | 
|---|
| 167 | static  void printerror(int&,char* texte) ;
 | 
|---|
| 168 | static  void printerrorAndContinue(int& status, char* texte);
 | 
|---|
| 169 | inline void  InitNull() 
 | 
|---|
| 170 |   {
 | 
|---|
| 171 |     fptr_ = NULL; 
 | 
|---|
| 172 |     hdutype_= FitsExtensionType_NULL; 
 | 
|---|
| 173 |     hdunum_ = 0; 
 | 
|---|
| 174 |     fits_status_ = 0; imageOnPrimary_ = true;
 | 
|---|
| 175 |   }
 | 
|---|
| 176 | inline fitsfile* fitsfilePtr() const {return fptr_;}
 | 
|---|
| 177 | 
 | 
|---|
| 178 | 
 | 
|---|
| 179 | 
 | 
|---|
| 180 |    fitsfile *fptr_;     /**<  pointer to the FITS file, defined in fitsio.h */
 | 
|---|
| 181 |    FitsExtensionType hdutype_;        /**<  image or bintable ? */
 | 
|---|
| 182 |    int hdunum_;         /**<   index of header to be read/written */
 | 
|---|
| 183 |    int fits_status_;    /**< last status returned by fitsio library. updated only by several methods */
 | 
|---|
| 184 |    bool imageOnPrimary_;
 | 
|---|
| 185 | 
 | 
|---|
| 186 |    BufferLine bfl_;
 | 
|---|
| 187 | 
 | 
|---|
| 188 | 
 | 
|---|
| 189 |  };
 | 
|---|
| 190 | 
 | 
|---|
| 191 | //! Class for saving  SOPHYA objects on FITS Format Files (uses cfitsio lib)
 | 
|---|
| 192 | 
 | 
|---|
| 193 |  class FitsInFile : public  FitsFile {
 | 
|---|
| 194 | 
 | 
|---|
| 195 |  public:
 | 
|---|
| 196 |    FitsInFile();
 | 
|---|
| 197 |    FitsInFile(string const & flnm);
 | 
|---|
| 198 |    FitsInFile(const char * flnm);
 | 
|---|
| 199 |    ~FitsInFile() { ; };
 | 
|---|
| 200 | 
 | 
|---|
| 201 |    static int  NbBlocks(char flnm[]);
 | 
|---|
| 202 |    int  NbBlocks();
 | 
|---|
| 203 |    static void GetBlockType(char flnm[], int hdunum, FitsExtensionType& typeOfExtension, int& naxis, vector<int>& naxisn, FitsDataType& dataType, DVList& dvl  );
 | 
|---|
| 204 | 
 | 
|---|
| 205 |    void  ReadHeader(int hdunum);
 | 
|---|
| 206 | bool hasKeyword(int hdunum, string keyw);
 | 
|---|
| 207 | string getStringKeyword(int hdunum, string keyname,int& retStatus);
 | 
|---|
| 208 | 
 | 
|---|
| 209 |   /*! \return a reference on a DVList containing the keywords from FITS file */
 | 
|---|
| 210 |   inline const DVList& DVListFromFits() const { return dvl_;}
 | 
|---|
| 211 | 
 | 
|---|
| 212 |   void GetKeywordsFromHeader (int hdunum, list<FitsKeyword>& mots_cles) const;
 | 
|---|
| 213 | 
 | 
|---|
| 214 | 
 | 
|---|
| 215 |   DVList  DVListFromPrimaryHeader() const;
 | 
|---|
| 216 |   void    moveToFollowingHeader();
 | 
|---|
| 217 | 
 | 
|---|
| 218 | 
 | 
|---|
| 219 | 
 | 
|---|
| 220 | 
 | 
|---|
| 221 |        //////////////////////////////////////////////////////////
 | 
|---|
| 222 |        ///////   methods for managing extensions ////////////////
 | 
|---|
| 223 |        //////////////////////////////////////////////////////////
 | 
|---|
| 224 | 
 | 
|---|
| 225 | 
 | 
|---|
| 226 | /////////////////////////////////////////////////////////////
 | 
|---|
| 227 | //       methods for managing FITS IMAGE extension
 | 
|---|
| 228 | ///////////////////////////////////////////////////
 | 
|---|
| 229 | 
 | 
|---|
| 230 | 
 | 
|---|
| 231 | 
 | 
|---|
| 232 | /*! \return true if the current header  corresponds to a FITS image extension */
 | 
|---|
| 233 | inline bool IsFitsImage() const { return (hdutype_ == FitsExtensionType_IMAGE);}
 | 
|---|
| 234 | 
 | 
|---|
| 235 | 
 | 
|---|
| 236 | 
 | 
|---|
| 237 |   /*! \return number of dimensions of an image extension : NAXIS parameter (in FITS notations)   */
 | 
|---|
| 238 | inline int nbDimOfImage() const {return naxis_;}
 | 
|---|
| 239 | 
 | 
|---|
| 240 | /*! \return a reference on a vector containing sizes of the NAXIS dimensions : NAXIS1, NAXIS2, NAXIS3 etc.  */
 | 
|---|
| 241 |  inline const vector<int>& dimOfImageAxes() const { return naxisn_;}
 | 
|---|
| 242 | 
 | 
|---|
| 243 | 
 | 
|---|
| 244 | /*! \return total number of data in the current IMAGE extension */
 | 
|---|
| 245 | inline int nbOfImageData() const { return nbData_; }
 | 
|---|
| 246 | 
 | 
|---|
| 247 | /*! \return data type of the current IMAGE extension */
 | 
|---|
| 248 | inline FitsFile::FitsDataType ImageType() const {return imageDataType_;}
 | 
|---|
| 249 | 
 | 
|---|
| 250 | 
 | 
|---|
| 251 | 
 | 
|---|
| 252 | //////////////////////////////////////////////////////////////////////////
 | 
|---|
| 253 | //       methods for managing FITS BINARY TABLE or ASCII TABLE extension
 | 
|---|
| 254 | ////////////////////////////////////////////////////////////////////////
 | 
|---|
| 255 | 
 | 
|---|
| 256 | 
 | 
|---|
| 257 | 
 | 
|---|
| 258 | 
 | 
|---|
| 259 | /*! \return true if the current header  corresponds to a FITS ASCII or BINTABLE extension */
 | 
|---|
| 260 | inline bool IsFitsTable() const {return (hdutype_ == FitsExtensionType_ASCII_TBL || hdutype_ == FitsExtensionType_BINARY_TBL);}
 | 
|---|
| 261 | 
 | 
|---|
| 262 | 
 | 
|---|
| 263 | 
 | 
|---|
| 264 | 
 | 
|---|
| 265 |  static  void GetBinTabParameters(fitsfile* fileptr, int& nbcols, int& nrows,
 | 
|---|
| 266 |                                   vector<int>& repeat,
 | 
|---|
| 267 |                                   vector<string>& noms, 
 | 
|---|
| 268 |                                   vector<FitsDataType>& types,   
 | 
|---|
| 269 |                                   vector<int>&  taille_des_chaines);
 | 
|---|
| 270 |  FitsDataType   ColTypeFromFits(int nocol) const;
 | 
|---|
| 271 |  string ColNameFromFits(int nocol) const;
 | 
|---|
| 272 |  int    ColStringLengthFromFits(int nocol) const;
 | 
|---|
| 273 |  const BufferLine& GetBufferLine(long NoLine); 
 | 
|---|
| 274 |  void   GetBinTabLine(int NoLine, double* ddata, float* fdata, int* idata, char
 | 
|---|
| 275 | ** cdata) ;
 | 
|---|
| 276 |  void   GetBinTabLine(long NoLine, BnTblLine& ligne) ;
 | 
|---|
| 277 |  void   GetBinTabLine(int NoLine, float* fdata) ;
 | 
|---|
| 278 |  void   GetBinTabFCol(r_8* valeurs, int nentries, int NoCol) const;
 | 
|---|
| 279 |  void   GetBinTabFCol(r_4* valeurs, int nentries, int NoCol) const;
 | 
|---|
| 280 |  void   GetBinTabFCol(int_4* valeurs, int nentries,  int NoCol) const;
 | 
|---|
| 281 |  void   GetBinTabFCol(char** valeurs,int nentries, int NoCol) const;
 | 
|---|
| 282 | 
 | 
|---|
| 283 | /////////////////////////////////////////////////////////////
 | 
|---|
| 284 | //       methods for managing any type of FITS extension
 | 
|---|
| 285 | ////////////////////////////////////////////////////////
 | 
|---|
| 286 | 
 | 
|---|
| 287 | /*! \return true if the current header  is beyond the maximum */
 | 
|---|
| 288 | inline bool IsFitsEOF() const {return (hdutype_ == FitsExtensionType_EOF);}
 | 
|---|
| 289 | /*! \return true if the current header  is incorrect, following a cfitsio, movavs error */
 | 
|---|
| 290 | inline bool IsFitsERROR() const {return (hdutype_ == FitsExtensionType_ERROR);}
 | 
|---|
| 291 | 
 | 
|---|
| 292 |   int     NbColsFromFits() const;
 | 
|---|
| 293 |   int     NentriesFromFits(int nocol) const;
 | 
|---|
| 294 | 
 | 
|---|
| 295 | 
 | 
|---|
| 296 |   void    GetSingleColumn(r_8* map, int nentries) const;
 | 
|---|
| 297 | 
 | 
|---|
| 298 |   void    GetSingleColumn(r_4*  map, int nentries) const;
 | 
|---|
| 299 | 
 | 
|---|
| 300 |   void    GetSingleColumn(int_4* map, int nentries) const;
 | 
|---|
| 301 | 
 | 
|---|
| 302 | 
 | 
|---|
| 303 | 
 | 
|---|
| 304 | 
 | 
|---|
| 305 | 
 | 
|---|
| 306 |   private :
 | 
|---|
| 307 | 
 | 
|---|
| 308 | void InitNull();
 | 
|---|
| 309 | 
 | 
|---|
| 310 | void getHeaderWithSophyaObject();
 | 
|---|
| 311 | static void KeywordsIntoDVList(fitsfile* fileptr, DVList& dvl, int hdunum); 
 | 
|---|
| 312 | static  void GetImageParameters (fitsfile* fileptr,FitsDataType& dataType,int& naxis,vector<int>& naxisn);
 | 
|---|
| 313 | 
 | 
|---|
| 314 |  FitsDataType imageDataType_;          /**< fits-Image parameter (bitpix)*/
 | 
|---|
| 315 |  int naxis_;           /**< fits-Image parameter */
 | 
|---|
| 316 |  vector<int> naxisn_;  /**< fits-Image parameters : sizes of dimensions */
 | 
|---|
| 317 |  int nbData_;          /*< fits-Image parameter: number of data */
 | 
|---|
| 318 |  int nrows_;           /**< Bintable parameter */
 | 
|---|
| 319 |  vector<int> repeat_;  /**< Bintable parameter */
 | 
|---|
| 320 |  int nbcols_;          /**< Bintable parameter */
 | 
|---|
| 321 |  vector<string> noms_; /**< Bintable parameter: column names */
 | 
|---|
| 322 |  vector<FitsDataType> types_;  /**< Bintable parameters: types of columns (D: double, E: float, I: integers,  A: char*) */
 | 
|---|
| 323 |  DVList dvl_;          /**< DVList for transferring keywords */
 | 
|---|
| 324 |  vector<int>  taille_des_chaines_; /**< Bintable parameters:   length of the char* variables */
 | 
|---|
| 325 | 
 | 
|---|
| 326 |   double dnull_;
 | 
|---|
| 327 |   float fnull_;
 | 
|---|
| 328 |   int inull_;
 | 
|---|
| 329 |   string cnull_;
 | 
|---|
| 330 | 
 | 
|---|
| 331 |  
 | 
|---|
| 332 | 
 | 
|---|
| 333 |  };
 | 
|---|
| 334 | 
 | 
|---|
| 335 | //! Class for loading  SOPHYA objects from FITS Format Files (uses cfitsio lib)
 | 
|---|
| 336 | 
 | 
|---|
| 337 |  class FitsOutFile : public  FitsFile {
 | 
|---|
| 338 | 
 | 
|---|
| 339 |  public:
 | 
|---|
| 340 | 
 | 
|---|
| 341 |    FitsOutFile();
 | 
|---|
| 342 |    FitsOutFile(string const & flnm, WriteMode wrm = unknown );
 | 
|---|
| 343 |    FitsOutFile(const char * flnm, WriteMode wrm = unknown );
 | 
|---|
| 344 |    ~FitsOutFile() { if (dvlToPrimary_ != NULL) delete dvlToPrimary_;};
 | 
|---|
| 345 |    inline void InitNull() {dvlToPrimary_ = NULL;}
 | 
|---|
| 346 | 
 | 
|---|
| 347 |        //////////////////////////////////////////////////////////
 | 
|---|
| 348 |        ///////   methods for managing extensions ////////////////
 | 
|---|
| 349 |        //////////////////////////////////////////////////////////
 | 
|---|
| 350 | 
 | 
|---|
| 351 | 
 | 
|---|
| 352 | 
 | 
|---|
| 353 | /////////////////////////////////////////////////////////////
 | 
|---|
| 354 | //       methods for managing FITS IMAGE extension
 | 
|---|
| 355 | ///////////////////////////////////////////////////
 | 
|---|
| 356 | 
 | 
|---|
| 357 | 
 | 
|---|
| 358 |    void makeHeaderImageOnFits(char type, int nbdim, int* naxisn, DVList* dvl) ;
 | 
|---|
| 359 |    void PutImageToFits( int nbData, r_8* map) const;
 | 
|---|
| 360 |    void PutImageToFits(int nbData, r_4* map ) const;
 | 
|---|
| 361 |    void PutImageToFits(int nbData, int_4* map) const;
 | 
|---|
| 362 | 
 | 
|---|
| 363 | 
 | 
|---|
| 364 | 
 | 
|---|
| 365 | //////////////////////////////////////////////////////////////////////////
 | 
|---|
| 366 | //       methods for managing FITS BINARY TABLE or ASCII TABLE extension
 | 
|---|
| 367 | ////////////////////////////////////////////////////////////////////////
 | 
|---|
| 368 | 
 | 
|---|
| 369 | 
 | 
|---|
| 370 | 
 | 
|---|
| 371 |    void makeHeaderBntblOnFits ( string fieldType, vector<string> Noms, int nentries, int tfields, DVList* dvl, string extname,  vector<int> taille_des_chaines) ;
 | 
|---|
| 372 |    void appendInputHeader(FitsInFile& headerin, int hdunum);
 | 
|---|
| 373 |    void writeAppendedHeaderOnFits();
 | 
|---|
| 374 |    void PrintHeaderToBeAppended();
 | 
|---|
| 375 |    void insertCommentLineOnHeader(string comment);
 | 
|---|
| 376 |    void insertKeywordOnHeader(string keyname, double value, string comment); 
 | 
|---|
| 377 |    void insertKeywordOnHeader(string keyname, int value, string comment); 
 | 
|---|
| 378 |    void insertKeywordOnHeader(string keyname, string value, string comment); 
 | 
|---|
| 379 |    void PutColToFits(int nocol, int nentries, r_8* donnees) const;
 | 
|---|
| 380 |    void PutColToFits(int nocol, int nentries, r_4* donnees) const;
 | 
|---|
| 381 |    void PutColToFits(int nocol, int nentries, int_4* donnees) const;
 | 
|---|
| 382 |    void PutColToFits(int nocol, int nentries, char** donnees) const;
 | 
|---|
| 383 |    void PutBinTabLine(long NoLine,  BnTblLine& ligne) const;
 | 
|---|
| 384 | 
 | 
|---|
| 385 | 
 | 
|---|
| 386 | /////////////////////////////////////////////////////////////
 | 
|---|
| 387 | //       methods for managing any type of FITS extension
 | 
|---|
| 388 | ////////////////////////////////////////////////////////
 | 
|---|
| 389 | 
 | 
|---|
| 390 | 
 | 
|---|
| 391 | void  DVListIntoPrimaryHeader(DVList& dvl) ;
 | 
|---|
| 392 | 
 | 
|---|
| 393 | 
 | 
|---|
| 394 | 
 | 
|---|
| 395 |   private :
 | 
|---|
| 396 | 
 | 
|---|
| 397 |   void openoutputfitsfile(const char * flnm, WriteMode wrm);
 | 
|---|
| 398 |   void writeSignatureOnFits(int hdunum) const; 
 | 
|---|
| 399 |   void addKeywordsOfDVList( DVList& dvl) const;
 | 
|---|
| 400 |   void addDVListOnPrimary();
 | 
|---|
| 401 | 
 | 
|---|
| 402 |   DVList* dvlToPrimary_; /**< for transferring keywords when creating primary header */
 | 
|---|
| 403 |   list<FitsKeyword>  mots_cles_;
 | 
|---|
| 404 | 
 | 
|---|
| 405 |  };
 | 
|---|
| 406 | 
 | 
|---|
| 407 |  struct BnTblLine 
 | 
|---|
| 408 |  {
 | 
|---|
| 409 |    BnTblLine() {}
 | 
|---|
| 410 |    void setFormat(int dc, int fc, int ic, int lc, int bc, int cc, vector<string> names);
 | 
|---|
| 411 |    bool sameFormat(const BnTblLine& btl) const;
 | 
|---|
| 412 | 
 | 
|---|
| 413 |    void Print();
 | 
|---|
| 414 | 
 | 
|---|
| 415 |    vector<double> ddata_;
 | 
|---|
| 416 |    vector<float>  fdata_;
 | 
|---|
| 417 |    vector<int>    idata_; 
 | 
|---|
| 418 |    vector<string>  cdata_;
 | 
|---|
| 419 |    vector<string> ColName_;
 | 
|---|
| 420 |    vector<long>   ldata_;
 | 
|---|
| 421 |    vector<unsigned char>   bdata_;
 | 
|---|
| 422 | 
 | 
|---|
| 423 |  };
 | 
|---|
| 424 | 
 | 
|---|
| 425 | 
 | 
|---|
| 426 | 
 | 
|---|
| 427 | } // Fin du namespace
 | 
|---|
| 428 | 
 | 
|---|
| 429 | #endif
 | 
|---|