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