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

Last change on this file since 838 was 838, checked in by ansari, 25 years ago

gorski change en healpix

File size: 3.9 KB
Line 
1#ifndef FITSIOSERVER_SEEN
2#define FITSIOSERVER_SEEN
3
4#include "machdefs.h"
5#include "tvector.h"
6#include "sphericalmap.h"
7#include "spherehealpix.h"
8#include "localmap.h"
9#include "ntuple.h"
10//#include "outilsinit.h"
11#include "cimage.h"
12#include "dvlist.h"
13#include "anydataobj.h"
14#include "FitsIO/fitsio.h"
15
16#define LEN_KEYWORD 9
17
18class FitsIoServer
19{
20
21public :
22
23 FitsIoServer() : FITS_tab_typ_(0),i_4tab_(NULL),r_4tab_(NULL),r_8tab_(NULL)
24 {;}
25 virtual ~FitsIoServer()
26 {
27 if (i_4tab_ != NULL) delete [] i_4tab_;
28 if (r_4tab_ != NULL) delete [] r_4tab_;
29 if (r_8tab_ != NULL) delete [] r_8tab_;
30 }
31
32 void load(TMatrix<double>& mat, char flnm[]);
33 void load(TMatrix<float>& mat, char flnm[]);
34 void load(TMatrix<int_4>& mat, char flnm[]);
35 void load(NTuple& ntpl,char flnm[],int hdunum);
36 void load(SphericalMap<double>& sph, char flnm[]);
37 void load(SphericalMap<float>& sph, char flnm[]);
38 void load(LocalMap<double>& sph, char flnm[]);
39 void load(ImageR4& DpcImg,char flnm[]);
40 void load(ImageI4& DpcImg,char flnm[]);
41 void load(SphereHealpix<float>& sph, char flnm[], int nth=1);
42 void load(SphereHealpix<double>& sph, char flnm[], int nth=1);
43 void load(SphereHealpix<double>& sph1,SphereHealpix<double>& sph2,SphereHealpix<double>& sph3, char filename[]);
44 void load(SphereHealpix<float>& sph1,SphereHealpix<float>& sph2,SphereHealpix<float>& sph3, char filename[]);
45 void save(TMatrix<double>& mat, char flnm[]);
46 void save(TMatrix<float>& mat, char flnm[]);
47 void save(TMatrix<int_4>& mat, char flnm[]);
48 void save(NTuple& ntpl,char flnm[]);
49 void save(SphericalMap<double>& sph, char flnm[]);
50 void save(SphericalMap<float>& sph, char flnm[]);
51
52 // nth : numero d'ordre de la sphere sur le fichier de sauvegarde
53 // si on veut sauver une seule sphere : nth=1
54 // so veut sauver par exemple 3 spheres, on appelle 3 fois save
55 // avec respectivement nth=1, 2, 3
56 void save(SphereHealpix<float>& sph, char filename[], int nth=1);
57 void save(SphereHealpix<double>& sph, char filename[], int nth=1);
58
59 void save(SphereHealpix<double>& sph1,SphereHealpix<double>& sph2,SphereHealpix<double>& sph3, char filename[]);
60 void save(SphereHealpix<float>& sph1,SphereHealpix<float>& sph2,SphereHealpix<float>& sph3, char filename[]);
61 void save(const LocalMap<double>& locm, char flnm[]);
62 void save(const ImageR4& DpcImg,char flnm[]);
63 void save(const ImageI4& DpcImg,char flnm[]);
64 void sinus_picture_projection(SphericalMap<double>& sph, char flnm[]);
65 void sinus_picture_projection(SphericalMap<float>& sph, char flnm[]);
66 void Mollweide_picture_projection(SphericalMap<float>& sph, char flnm[]);
67 void Mollweide_picture_projection(SphericalMap<double>& sph, char flnm[]);
68 void picture(LocalMap<double>& lcm, char flnm[]);
69 void readheader(char flnm[]);
70
71 virtual AnyDataObj* loadobj(char flnm[],int hdunum = 1);
72
73 private :
74
75 // creer, ecrire une imageformat FITS, a partir des tableaux de donnees
76 // dtab_, ftab_ prealablement remplis
77 void planck_write_img(char flnm[],int naxis,int n1,int n2,int n3,DVList &dvl);
78
79 void planck_read_img(char flnm[],int &naxis,int &n1,int &n2,int &n3,DVList &dvl);
80 void planck_read_bntbl(char flnm[], int hdunum, int& npixels, DVList& dvl,int tfields=1);
81 void planck_write_bntbl(char flnm[], int npixels, char typeOfContent[], char extname[], char comment1[], DVList& dvl, int tfields=1, int nth=1);
82 void write_picture(long* naxes,float* map,char* filename) const;
83
84 void printerror(int& status) const;
85 void printerror(int& status, char* texte) const;
86 bool check_keyword(fitsfile*,int,char keyword[]);
87
88 inline int key_type_PL2FITS(char typ)
89 {
90 switch (typ)
91 {
92 case 'I' :
93 return TINT;
94 case 'D' :
95 return TDOUBLE;
96 case 'S' :
97 return TSTRING;
98 default :
99 cout << " FITSIOSERVER : type de donnee non prevu " << endl;
100 return 0;
101 }
102 }
103
104 int FITS_tab_typ_;
105 int_4* i_4tab_;
106 r_4* r_4tab_;
107 r_8* r_8tab_;
108};
109
110#endif
111
112
113
Note: See TracBrowser for help on using the repository browser.