Changeset 709 in Sophya for trunk/SophyaPI/PIext/nobjmgr.cc


Ignore:
Timestamp:
Jan 21, 2000, 5:59:42 PM (26 years ago)
Author:
ercodmgr
Message:

petites Corrections diverses - Reza 21/01/2000

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/nobjmgr.cc

    r685 r709  
    2121#ifdef SANS_EVOLPLANCK
    2222#include "fitsimage.h" 
     23#else
     24#include "fitsioserver.h" 
    2325#endif
    2426
     
    840842void NamedObjMgr::ReadFits(string const & flnm, string & nobj)
    841843{
    842 bool ok = true;
     844bool ok = false;
     845
    843846#ifdef SANS_EVOLPLANCK
    844 RzImage* obj;
    845 #else
    846 //CMV_A_FAIRE RzImage* obj;
    847 #endif
    848 
    849 //  obj = RzReadFits((char*)flnm.c_str(), ImgOffX, ImgOffY, ImgSizX, ImgSizY, ImgBitSgn);
    850 #ifdef SANS_EVOLPLANCK
     847RzImage* obj=NULL;
    851848TRY{
    852849  obj = RzReadFits((char*)flnm.c_str());
    853850  if (obj == NULL)   ok = false;
     851  else ok = true;
    854852}  CATCH(merr) {
    855853  printf("NamedObjMgr::ReadFITS(_Error Exception= %ld (%s) \n", (long)merr, PeidaExc(merr));
    856854  ok = false;
    857855} ENDTRY;
    858 if (ok) {
     856
     857#else
     858
     859 AnyDataObj * obj=NULL;
     860 FitsIoServer fios;
     861 char fitsfile[512];
     862 strncpy(fitsfile, flnm.c_str(), 512); fitsfile[511] = '\0';
     863 int hdu = 1;
     864 // Nous essayons de lire jusqu'a l'entete numero 3
     865 while (hdu < 4) {
     866   try {
     867     cout << "NamedObjMgr::ReadFITS() - Trying to read " << flnm
     868          << " HDU= " << hdu << endl;
     869     obj = fios.loadobj(fitsfile, hdu);
     870     if(obj) {
     871       ok = true;
     872       hdu = 9999;
     873     }
     874   }
     875   catch(IOExc exc) {
     876     cerr << "NamedObjMgr::ReadFITS() - IOExc " << exc.Msg() << endl;
     877     hdu++;
     878   }
     879   catch(...) {
     880     cerr << "NamedObjMgr::ReadFITS() - Error reading " << flnm << endl;
     881     hdu++;
     882     //     ok = false;
     883     // hdu = 99999;
     884   }
     885 }
     886#endif
     887if (ok && (obj != NULL)) {
    859888  if (nobj.length()<1)  nobj = servnobjm->FileName2Name(flnm);
    860889  AddObj((AnyDataObj*)obj, nobj);
    861890}
    862 #else
    863   printf("NamedObjMgr::ReadFITS( NON-Disponible EVOL-PLANCK) \n");
    864 #endif
    865891return;
    866892}
Note: See TracChangeset for help on using the changeset viewer.