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