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