[471] | 1 | #ifndef FITSIOSERVER_SEEN
|
---|
| 2 | #define FITSIOSERVER_SEEN
|
---|
| 3 |
|
---|
[663] | 4 | #include "machdefs.h"
|
---|
[854] | 5 | #include "array.h"
|
---|
| 6 | #include "skymap.h"
|
---|
[477] | 7 | #include "ntuple.h"
|
---|
| 8 | #include "cimage.h"
|
---|
[838] | 9 | #include "FitsIO/fitsio.h"
|
---|
[663] | 10 |
|
---|
[477] | 11 | #define LEN_KEYWORD 9
|
---|
| 12 |
|
---|
[471] | 13 | class FitsIoServer
|
---|
| 14 | {
|
---|
[477] | 15 |
|
---|
[471] | 16 | public :
|
---|
| 17 |
|
---|
[689] | 18 | FitsIoServer() : FITS_tab_typ_(0),i_4tab_(NULL),r_4tab_(NULL),r_8tab_(NULL)
|
---|
| 19 | {;}
|
---|
[695] | 20 | virtual ~FitsIoServer()
|
---|
[477] | 21 | {
|
---|
| 22 | if (i_4tab_ != NULL) delete [] i_4tab_;
|
---|
[488] | 23 | if (r_4tab_ != NULL) delete [] r_4tab_;
|
---|
| 24 | if (r_8tab_ != NULL) delete [] r_8tab_;
|
---|
[477] | 25 | }
|
---|
| 26 |
|
---|
[482] | 27 | void load(TMatrix<double>& mat, char flnm[]);
|
---|
[605] | 28 | void load(TMatrix<float>& mat, char flnm[]);
|
---|
| 29 | void load(TMatrix<int_4>& mat, char flnm[]);
|
---|
[482] | 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[]);
|
---|
[854] | 36 | void load(SphereHEALPix<float>& sph, char flnm[], int nth=1);
|
---|
| 37 | void load(SphereHEALPix<double>& sph, char flnm[], int nth=1);
|
---|
| 38 | void load(SphereHEALPix<double>& sph1,SphereHEALPix<double>& sph2,SphereHEALPix<double>& sph3, char filename[]);
|
---|
| 39 | void load(SphereHEALPix<float>& sph1,SphereHEALPix<float>& sph2,SphereHEALPix<float>& sph3, char filename[]);
|
---|
[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[]);
|
---|
[838] | 46 |
|
---|
| 47 | // nth : numero d'ordre de la sphere sur le fichier de sauvegarde
|
---|
| 48 | // si on veut sauver une seule sphere : nth=1
|
---|
| 49 | // so veut sauver par exemple 3 spheres, on appelle 3 fois save
|
---|
| 50 | // avec respectivement nth=1, 2, 3
|
---|
[854] | 51 | void save(SphereHEALPix<float>& sph, char filename[], int nth=1);
|
---|
| 52 | void save(SphereHEALPix<double>& sph, char filename[], int nth=1);
|
---|
[838] | 53 |
|
---|
[854] | 54 | void save(SphereHEALPix<double>& sph1,SphereHEALPix<double>& sph2,SphereHEALPix<double>& sph3, char filename[]);
|
---|
| 55 | void save(SphereHEALPix<float>& sph1,SphereHEALPix<float>& sph2,SphereHEALPix<float>& sph3, char filename[]);
|
---|
[838] | 56 | void save(const LocalMap<double>& locm, char flnm[]);
|
---|
[488] | 57 | void save(const ImageR4& DpcImg,char flnm[]);
|
---|
| 58 | void save(const ImageI4& DpcImg,char flnm[]);
|
---|
[477] | 59 | void sinus_picture_projection(SphericalMap<double>& sph, char flnm[]);
|
---|
| 60 | void sinus_picture_projection(SphericalMap<float>& sph, char flnm[]);
|
---|
[564] | 61 | void Mollweide_picture_projection(SphericalMap<float>& sph, char flnm[]);
|
---|
[603] | 62 | void Mollweide_picture_projection(SphericalMap<double>& sph, char flnm[]);
|
---|
[477] | 63 | void picture(LocalMap<double>& lcm, char flnm[]);
|
---|
| 64 | void readheader(char flnm[]);
|
---|
| 65 |
|
---|
[689] | 66 | virtual AnyDataObj* loadobj(char flnm[],int hdunum = 1);
|
---|
| 67 |
|
---|
[477] | 68 | private :
|
---|
| 69 |
|
---|
| 70 | // creer, ecrire une imageformat FITS, a partir des tableaux de donnees
|
---|
| 71 | // dtab_, ftab_ prealablement remplis
|
---|
[689] | 72 | void planck_write_img(char flnm[],int naxis,int n1,int n2,int n3,DVList &dvl);
|
---|
[477] | 73 |
|
---|
[689] | 74 | void planck_read_img(char flnm[],int &naxis,int &n1,int &n2,int &n3,DVList &dvl);
|
---|
[838] | 75 | void planck_read_bntbl(char flnm[], int hdunum, int& npixels, DVList& dvl,int tfields=1);
|
---|
| 76 | void planck_write_bntbl(char flnm[], int npixels, char typeOfContent[], char extname[], char comment1[], DVList& dvl, int tfields=1, int nth=1);
|
---|
[477] | 77 | void write_picture(long* naxes,float* map,char* filename) const;
|
---|
| 78 |
|
---|
[603] | 79 | void printerror(int& status) const;
|
---|
| 80 | void printerror(int& status, char* texte) const;
|
---|
[477] | 81 | bool check_keyword(fitsfile*,int,char keyword[]);
|
---|
| 82 |
|
---|
| 83 | inline int key_type_PL2FITS(char typ)
|
---|
| 84 | {
|
---|
| 85 | switch (typ)
|
---|
| 86 | {
|
---|
| 87 | case 'I' :
|
---|
| 88 | return TINT;
|
---|
| 89 | case 'D' :
|
---|
| 90 | return TDOUBLE;
|
---|
| 91 | case 'S' :
|
---|
| 92 | return TSTRING;
|
---|
| 93 | default :
|
---|
| 94 | cout << " FITSIOSERVER : type de donnee non prevu " << endl;
|
---|
| 95 | return 0;
|
---|
| 96 | }
|
---|
| 97 | }
|
---|
| 98 |
|
---|
| 99 | int FITS_tab_typ_;
|
---|
[479] | 100 | int_4* i_4tab_;
|
---|
[488] | 101 | r_4* r_4tab_;
|
---|
| 102 | r_8* r_8tab_;
|
---|
[471] | 103 | };
|
---|
[477] | 104 |
|
---|
[471] | 105 | #endif
|
---|
| 106 |
|
---|
| 107 |
|
---|
| 108 |
|
---|