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