Changeset 2932 in Sophya for trunk/SophyaExt/FitsIOServer


Ignore:
Timestamp:
Apr 3, 2006, 12:13:59 PM (19 years ago)
Author:
ansari
Message:

Modifs suggere par Casandjian (suppression espace ds les kw fits et conservation des kw de type STRUCT) et petites corrections, maj commentaires auto-doc - Reza 3/4/2006

Location:
trunk/SophyaExt/FitsIOServer
Files:
5 edited

Legend:

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

    r2928 r2932  
    3232//   Enregistrement des classes FitsHandler
    3333  //DBG   cout << " ---- FitsIOServerInitiator / DEBUG ---- debut RegisterHandler " << endl;
    34   FitsManager::RegisterHandler(new FitsArrayHandler<int_2> , "TArray<int_2>");
     34  FitsManager::RegisterHandler(new FitsArrayHandler<int_2> , 1, "TArray<int_2>");
    3535  FitsManager::RegisterHandler(new FitsArrayHandler<int_4> , 1, "TArray<int_4> ");
    3636  FitsManager::RegisterHandler(new FitsArrayHandler<r_4> , 1, "TArray<r_4>");
  • trunk/SophyaExt/FitsIOServer/fitshandler.h

    r2864 r2932  
    2020  //! Return the real data object
    2121  virtual AnyDataObj* DataObj() = 0;       // Retourne l'objet reel
    22   //! Return a positive value if I/O for object \b o can be handled
     22
     23  /*!
     24    \brief Return a positive value if I/O for object \b o can be handled
     25
     26    - Rc= 0 -> Can NOT handle fits I/O operations for the object \b o
     27    - Rc= 1 -> Can handle fits I/O operations for the object \b o
     28    - Rc= 2 -> This is a specific handler for object \b o
     29    - Rc > 2 -> Higher Rc values can be returned if needed
     30      (for subclasses with specific handlers)
     31
     32  */
    2333  virtual int         CheckHandling(AnyDataObj & o) = 0;
    2434  //! Read/write operation will use the object o
    2535  virtual void        SetDataObj(AnyDataObj & o) = 0;
    2636
    27   //! Return a positive value if current HDU can be read by the handler
     37  //!
     38  /*!
     39    \brief Return a positive value if current HDU can be read by the handler
     40
     41    - Rc= 0 -> Can NOT read the current HDU
     42    - Rc= 1 -> Can read the current HDU (generic reader)
     43    - Rc= 2 -> Can read the current HDU, as a specific reader
     44    - Rc > 2 -> Higher Rc values can be returned if needed
     45      (when multiple specific handlers are registered)
     46
     47  */
    2848  virtual int         CheckReadability(FitsInOutFile& is) = 0;
    2949 
  • trunk/SophyaExt/FitsIOServer/fitsinoutfile.cc

    r2864 r2932  
    33#include "segdatablock.h"
    44#include "fitsinoutfile.h"
     5#include "strutil.h"
    56#include <stdio.h>
    67#include <string.h>
     
    514515
    515516/*-- Methode --*/
    516 int FitsInOutFile::GetHeaderRecords(DVList& dvl)
     517/*!
     518  Read the current fits header information as pairs of '(keyword,value)' appended
     519  to the DVList object \b dvl.
     520  \param dvl : DVList object containing filled with (keyword,value) pairs.
     521  \param stripkw : if true (default), remove leading and trailing spaces from keyword
     522  \param keepstkey : if true (default), keep keys of type TYP_STRUC_KEY
     523*/
     524int FitsInOutFile::GetHeaderRecords(DVList& dvl, bool stripkw, bool keepstkey)
    517525{
    518526  int status = 0;
     
    529537    FitsCheckStatus(status, "FitsInOutFile::GetHeaderRecords() Error(2): ");
    530538    int kclas = fits_get_keyclass(record);
    531     if ( (kclas ==  TYP_STRUC_KEY) || (kclas == TYP_NULL_KEY) ) continue;
     539    if ( (!keepstkey && (kclas ==  TYP_STRUC_KEY))
     540         || (kclas == TYP_NULL_KEY) ) continue;
    532541    int len = 0;
    533542    status = 0;
    534543    fits_get_keyname(record, value, &len, &status);
    535544    if (status) continue;
     545    if (stripkw) strip(value, 'B', ' ');
    536546    string keyname = value;
    537547    status = 0;
     
    551561    case 'L' :   // Il faudra traiter le cas des nb complexes
    552562    case 'X' :   // idem pour les valeurs logiques
    553      dvl.SetS(keyname, value);
     563      dvl.SetS(keyname, value);
    554564      break;
    555565    case 'I' :
  • trunk/SophyaExt/FitsIOServer/fitsinoutfile.h

    r2864 r2932  
    179179  string           KeyValue(string const & key, bool& nosk);
    180180 //! Read header records and appends the information to dvl
    181  int               GetHeaderRecords(DVList& dvl);
     181 int               GetHeaderRecords(DVList& dvl,
     182                                    bool stripkw= true, bool keepstkey=true);
    182183 //! Appends a keyword to FITS header
    183184 void              WriteKey(const char * kname, MuTyV const & val,
  • trunk/SophyaExt/FitsIOServer/fitsmanager.cc

    r2901 r2932  
    2525}
    2626/*!
     27  Generic handlers (ImageHDU, TableHDU) will have a higher global priority level
     28  than specific handlers. Use glev=0 for specific handlers and glev=1 for generic
     29  handlers. 
    2730  \param fhi : handler object pointer (created by new) which will be kept in the
    2831  handler list
Note: See TracChangeset for help on using the changeset viewer.