Ignore:
Timestamp:
Jan 13, 2006, 11:05:52 AM (20 years ago)
Author:
ansari
Message:

Mise en place de l heritage FitsIOHandler (ancien) de FitsHandlerInterface pour une gestion commune - a partir de FitsManager - Reza 13/01/2006

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaExt/FitsIOServer/fitsspherehealpix.cc

    r2874 r2897  
    7171}
    7272
     73template <class T>
     74int FITS_SphereHEALPix<T>::CheckHandling(AnyDataObj & o)
     75{
     76  if ( typeid(o) == typeid( SphereHEALPix< T > ) ) return 2;
     77  SphereHEALPix<T> * po = dynamic_cast< SphereHEALPix<T> * >(&o);
     78  if (po == NULL) return 0;
     79  else return 1;
     80}
     81
     82template <class T>
     83int FITS_SphereHEALPix<T>::CheckReadability(FitsInOutFile& is)
     84{
     85  if (is.CurrentHDUType() !=  BINARY_TBL ) return 0;
     86  string key;
     87  key = "PIXTYPE";
     88  if ( is.KeyValue(key) != "HEALPIX")  return 0;
     89
     90  bool nosk = false;
     91  key = "ORDERING";
     92  is.KeyValue(key, nosk);
     93  bool nosk2 = false;
     94  key = "NSIDE";
     95  is.KeyValue(key, nosk2);
     96  if (nosk || nosk2) return 0;
     97
     98  vector<string> colnames;
     99  vector<int> coltypes;
     100  vector<long> repcnt;
     101  vector<long> width;
     102  long ncols = is.GetColInfo(colnames, coltypes, repcnt, width);
     103  if (ncols < 1) return 0;
     104  T x;
     105  if (coltypes[0] == FitsTypes::DataType(x)) return 2 ;
     106  else return 1;
     107}
     108
     109template <class T>
     110FitsHandlerInterface* FITS_SphereHEALPix<T>::Clone()
     111{
     112  return new FITS_SphereHEALPix<T>() ;
     113}
    73114
    74115
     
    104145  dvl["Content"]= "SphereHEALPix";
    105146  dvl.SetComment("Content", "name of SOPHYA object");
     147  dvl["SOPCLSNM"]= "SOPHYA::SphereHEALPix<T>";
     148  dvl.SetComment("SOPCLSNM", "SOPHYA class name");
    106149 
    107150  // On ecrit les dataBlocks
    108151  vector<string> Noms;   
    109152  Noms.push_back(dvl.GetS("Content"));
    110   string extname("SIMULATION");
     153  //  string extname("SIMULATION");
     154  string extname = os.NextExtensionName();
    111155
    112156  string Type;
Note: See TracChangeset for help on using the changeset viewer.