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

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

Adaptation s SphereHEALPix et deplacement SkyMap/fitsspherehealpix ici

Reza 10/4/2000

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