source: Sophya/trunk/SophyaExt/FitsIOServer/fitsioserver.h@ 488

Last change on this file since 488 was 488, checked in by ansari, 26 years ago

quelques const et autres delete[] 21-OCT-99 GLM

File size: 2.2 KB
Line 
1#ifndef FITSIOSERVER_SEEN
2#define FITSIOSERVER_SEEN
3
4#include "fitsio.h"
5#include "tvector.h"
6#include "sphericalmap.h"
7#include "localmap.h"
8#include "ntuple.h"
9#include "outilsinit.h"
10#include "cimage.h"
11#include "dvlist.h"
12
13#define LEN_KEYWORD 9
14
15class FitsIoServer
16{
17
18public :
19
20 FitsIoServer() : FITS_tab_typ_(0),i_4tab_(NULL),r_4tab_(NULL),r_8tab_(NULL) {;}
21 ~FitsIoServer()
22 {
23 if (i_4tab_ != NULL) delete [] i_4tab_;
24 if (r_4tab_ != NULL) delete [] r_4tab_;
25 if (r_8tab_ != NULL) delete [] r_8tab_;
26 }
27
28 void load(TMatrix<double>& mat, char flnm[]);
29 void load(NTuple& ntpl,char flnm[],int hdunum);
30 void load(SphericalMap<double>& sph, char flnm[]);
31 void load(SphericalMap<float>& sph, char flnm[]);
32 void load(LocalMap<double>& sph, char flnm[]);
33 void load(ImageR4& DpcImg,char flnm[]);
34 void load(ImageI4& DpcImg,char flnm[]);
35 void save(TMatrix<double>& mat, char flnm[]);
36 void save(NTuple& ntpl,char flnm[]);
37 void save(SphericalMap<double>& sph, char flnm[]);
38 void save(SphericalMap<float>& sph, char flnm[]);
39 void save(LocalMap<double>& locm, char flnm[]);
40 void save(const ImageR4& DpcImg,char flnm[]);
41 void save(const ImageI4& DpcImg,char flnm[]);
42 void sinus_picture_projection(SphericalMap<double>& sph, char flnm[]);
43 void sinus_picture_projection(SphericalMap<float>& sph, char flnm[]);
44 void picture(LocalMap<double>& lcm, char flnm[]);
45
46
47
48 void readheader(char flnm[]);
49
50 private :
51
52
53 // creer, ecrire une imageformat FITS, a partir des tableaux de donnees
54 // dtab_, ftab_ prealablement remplis
55 void planck_write_img(char flnm[],int naxis,int n1,int n2,int n3,DVList& dvl);
56
57 void planck_read_img(char flnm[],long& naxis,int& n1,int& n2,int& n3,DVList& dvl);
58 void write_picture(long* naxes,float* map,char* filename) const;
59
60 void printerror(int status) const;
61
62 bool check_keyword(fitsfile*,int,char keyword[]);
63
64 inline int key_type_PL2FITS(char typ)
65 {
66 switch (typ)
67 {
68 case 'I' :
69 return TINT;
70 case 'D' :
71 return TDOUBLE;
72 case 'S' :
73 return TSTRING;
74 default :
75 cout << " FITSIOSERVER : type de donnee non prevu " << endl;
76 return 0;
77 }
78 }
79
80 int FITS_tab_typ_;
81 int_4* i_4tab_;
82 r_4* r_4tab_;
83 r_8* r_8tab_;
84};
85
86#endif
87
88
89
Note: See TracBrowser for help on using the repository browser.