source: Sophya/trunk/SophyaExt/FitsIOServer/fitsioserver.h@ 1004

Last change on this file since 1004 was 883, checked in by ansari, 25 years ago

modifs .h ds fitsioserver.h , Reza 11/4/2000

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