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

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

Preparation pour tag V_Oct99 , Reza 29/11/99

File size: 3.1 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 "spheregorski.h"
8#include "localmap.h"
9#include "ntuple.h"
10#include "outilsinit.h"
11#include "cimage.h"
12#include "dvlist.h"
13
14#include <fitsio.h> /* entre <> pour que mkmflib fonctionne correctement */
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 ~FitsIoServer()
25 {
26 if (i_4tab_ != NULL) delete [] i_4tab_;
27 if (r_4tab_ != NULL) delete [] r_4tab_;
28 if (r_8tab_ != NULL) delete [] r_8tab_;
29 }
30
31 void load(TMatrix<double>& mat, char flnm[]);
32 void load(TMatrix<float>& mat, char flnm[]);
33 void load(TMatrix<int_4>& mat, char flnm[]);
34 void load(NTuple& ntpl,char flnm[],int hdunum);
35 void load(SphericalMap<double>& sph, char flnm[]);
36 void load(SphericalMap<float>& sph, char flnm[]);
37 void load(LocalMap<double>& sph, char flnm[]);
38 void load(ImageR4& DpcImg,char flnm[]);
39 void load(ImageI4& DpcImg,char flnm[]);
40 void load(SphereGorski<float>& sph, char flnm[], int hdunum=2);
41 void load(SphereGorski<double>& sph, char flnm[], int hdunum=2);
42 void save(TMatrix<double>& mat, char flnm[]);
43 void save(TMatrix<float>& mat, char flnm[]);
44 void save(TMatrix<int_4>& mat, char flnm[]);
45 void save(NTuple& ntpl,char flnm[]);
46 void save(SphericalMap<double>& sph, char flnm[]);
47 void save(SphericalMap<float>& sph, char flnm[]);
48 void save(SphereGorski<float>& sph, char filename[]);
49 void save(SphereGorski<double>& sph, char filename[]);
50 void save(LocalMap<double>& locm, char flnm[]);
51 void save(const ImageR4& DpcImg,char flnm[]);
52 void save(const ImageI4& DpcImg,char flnm[]);
53 void sinus_picture_projection(SphericalMap<double>& sph, char flnm[]);
54 void sinus_picture_projection(SphericalMap<float>& sph, char flnm[]);
55 void Mollweide_picture_projection(SphericalMap<float>& sph, char flnm[]);
56 void Mollweide_picture_projection(SphericalMap<double>& sph, char flnm[]);
57 void picture(LocalMap<double>& lcm, char flnm[]);
58
59
60
61 void readheader(char flnm[]);
62
63 private :
64
65
66 // creer, ecrire une imageformat FITS, a partir des tableaux de donnees
67 // dtab_, ftab_ prealablement remplis
68 void planck_write_img(char flnm[],int naxis,int n1,int n2,int n3,DVList& dvl);
69
70 void planck_read_img(char flnm[],long& naxis,int& n1,int& n2,int& n3,DVList& dvl);
71 void planck_read_bntbl(char flnm[], int hdunum, int& npixels, DVList& dvl);
72 void planck_write_bntbl(char flnm[], int npixels, char typeOfContent[], char extname[], char comment1[], DVList& dvl);
73 void write_picture(long* naxes,float* map,char* filename) const;
74
75 void printerror(int& status) const;
76 void printerror(int& status, char* texte) const;
77 bool check_keyword(fitsfile*,int,char keyword[]);
78
79 inline int key_type_PL2FITS(char typ)
80 {
81 switch (typ)
82 {
83 case 'I' :
84 return TINT;
85 case 'D' :
86 return TDOUBLE;
87 case 'S' :
88 return TSTRING;
89 default :
90 cout << " FITSIOSERVER : type de donnee non prevu " << endl;
91 return 0;
92 }
93 }
94
95 int FITS_tab_typ_;
96 int_4* i_4tab_;
97 r_4* r_4tab_;
98 r_8* r_8tab_;
99};
100
101#endif
102
103
104
Note: See TracBrowser for help on using the repository browser.