[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[]);
|
---|
| 30 | void load(NTuple& ntpl,char flnm[],int hdunum);
|
---|
[477] | 31 | void load(SphericalMap<double>& sph, char flnm[]);
|
---|
| 32 | void load(SphericalMap<float>& sph, char flnm[]);
|
---|
| 33 | void load(LocalMap<double>& sph, char flnm[]);
|
---|
[482] | 34 | void load(ImageR4& DpcImg,char flnm[]);
|
---|
| 35 | void load(ImageI4& DpcImg,char flnm[]);
|
---|
[564] | 36 | void load(SphereGorski<float>& sph, char flnm[], int hdunum);
|
---|
[482] | 37 | void save(TMatrix<double>& mat, char flnm[]);
|
---|
| 38 | void save(NTuple& ntpl,char flnm[]);
|
---|
[477] | 39 | void save(SphericalMap<double>& sph, char flnm[]);
|
---|
| 40 | void save(SphericalMap<float>& sph, char flnm[]);
|
---|
| 41 | void save(LocalMap<double>& locm, char flnm[]);
|
---|
[488] | 42 | void save(const ImageR4& DpcImg,char flnm[]);
|
---|
| 43 | void save(const ImageI4& DpcImg,char flnm[]);
|
---|
[477] | 44 | void sinus_picture_projection(SphericalMap<double>& sph, char flnm[]);
|
---|
| 45 | void sinus_picture_projection(SphericalMap<float>& sph, char flnm[]);
|
---|
[564] | 46 | void Mollweide_picture_projection(SphericalMap<float>& sph, char flnm[]);
|
---|
[477] | 47 | void picture(LocalMap<double>& lcm, char flnm[]);
|
---|
| 48 |
|
---|
| 49 |
|
---|
| 50 |
|
---|
| 51 | void readheader(char flnm[]);
|
---|
| 52 |
|
---|
| 53 | private :
|
---|
| 54 |
|
---|
| 55 |
|
---|
| 56 | // creer, ecrire une imageformat FITS, a partir des tableaux de donnees
|
---|
| 57 | // dtab_, ftab_ prealablement remplis
|
---|
[482] | 58 | void planck_write_img(char flnm[],int naxis,int n1,int n2,int n3,DVList& dvl);
|
---|
[477] | 59 |
|
---|
[482] | 60 | void planck_read_img(char flnm[],long& naxis,int& n1,int& n2,int& n3,DVList& dvl);
|
---|
[564] | 61 | void planck_read_bntbl(char flnm[], int hdunum, int& npixels, DVList& dvl);
|
---|
[477] | 62 | void write_picture(long* naxes,float* map,char* filename) const;
|
---|
| 63 |
|
---|
| 64 | void printerror(int status) const;
|
---|
| 65 |
|
---|
| 66 | bool check_keyword(fitsfile*,int,char keyword[]);
|
---|
| 67 |
|
---|
| 68 | inline int key_type_PL2FITS(char typ)
|
---|
| 69 | {
|
---|
| 70 | switch (typ)
|
---|
| 71 | {
|
---|
| 72 | case 'I' :
|
---|
| 73 | return TINT;
|
---|
| 74 | case 'D' :
|
---|
| 75 | return TDOUBLE;
|
---|
| 76 | case 'S' :
|
---|
| 77 | return TSTRING;
|
---|
| 78 | default :
|
---|
| 79 | cout << " FITSIOSERVER : type de donnee non prevu " << endl;
|
---|
| 80 | return 0;
|
---|
| 81 | }
|
---|
| 82 | }
|
---|
| 83 |
|
---|
| 84 | int FITS_tab_typ_;
|
---|
[479] | 85 | int_4* i_4tab_;
|
---|
[488] | 86 | r_4* r_4tab_;
|
---|
| 87 | r_8* r_8tab_;
|
---|
[471] | 88 | };
|
---|
[477] | 89 |
|
---|
[471] | 90 | #endif
|
---|
| 91 |
|
---|
| 92 |
|
---|
| 93 |
|
---|