Ignore:
Timestamp:
Oct 19, 1999, 12:11:06 PM (26 years ago)
Author:
ansari
Message:

load et save d'images 19-OCT-99 GLM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaExt/FitsIOServer/fitsioserver.h

    r471 r477  
    66#include "sphericalmap.h"
    77#include "localmap.h"
     8#include "ntuple.h"
     9#include "outilsinit.h"
     10#include "cimage.h"
    811#include "dvlist.h"
     12
     13#define LEN_KEYWORD 9
    914
    1015class FitsIoServer
    1116{
     17
    1218public :
    13 FitsIoServer() : FITS_tab_typ_(0), itab_(NULL), ftab_(NULL), dtab_(NULL) {;}
    14 ~FitsIoServer()
    15   {
    16     if (itab_ != NULL) delete [] itab_;
    17     if (ftab_ != NULL) delete [] ftab_;
    18     if (dtab_ != NULL) delete [] dtab_;
    19   }
    20 void load(SphericalMap<double>& sph, char flnm[]);
    21 void load(SphericalMap<float>& sph, char flnm[]);
    22 void load(TMatrix<double>& mat, char flnm[]);
    23 void load(LocalMap<double>& sph, char flnm[]);
    24 void save(SphericalMap<double>& sph, char flnm[]);
    25 void save(SphericalMap<float>& sph, char flnm[]);
    26 void save(LocalMap<double>& locm, char flnm[]);
    27 void save(TMatrix<double>& mat, char flnm[]);
    28 void sinus_picture_projection(SphericalMap<double>& sph, char flnm[]);
    29 void sinus_picture_projection(SphericalMap<float>& sph, char flnm[]);
    30 void picture(LocalMap<double>& lcm, char flnm[]);
    31 private :
    32 void read_sphere(char flnm[], int& npixels, int& nside);
    33 void planck_write_img( fitsfile *fptr, int naxis,int n1, int n2, int n3, DVList& dvl);
    34 void planck_read_img( fitsfile *fptr, long& naxis,int& n1, int& n2, int& n3, DVList& dvl);
    35 void  write_picture(long* naxes, float* map,  char* filename) const;
    3619
    37 void printerror(int status) const;
    38 inline int key_type_PL2FITS(char typ)
    39   {
    40   switch (typ)
    41     {
    42     case 'I' :
    43       return TINT;
    44     case 'D' :
    45       return TDOUBLE;
    46     case 'S' :
    47       return TSTRING;
    48     default :
    49       cout << " FITSIOSERVER : type de donnee non prevu " << endl;
    50       return 0;
    51     }
    52    
    53   }
    54 int FITS_tab_typ_;
    55 int* itab_;
    56 float* ftab_;
    57 double* dtab_;
     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_;
    5885};
     86
    5987#endif
    6088
Note: See TracChangeset for help on using the changeset viewer.