Changeset 709 in Sophya for trunk/SophyaPI/PIext/nobjmgr.cc
- Timestamp:
- Jan 21, 2000, 5:59:42 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/nobjmgr.cc
r685 r709 21 21 #ifdef SANS_EVOLPLANCK 22 22 #include "fitsimage.h" 23 #else 24 #include "fitsioserver.h" 23 25 #endif 24 26 … … 840 842 void NamedObjMgr::ReadFits(string const & flnm, string & nobj) 841 843 { 842 bool ok = true; 844 bool ok = false; 845 843 846 #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 847 RzImage* obj=NULL; 851 848 TRY{ 852 849 obj = RzReadFits((char*)flnm.c_str()); 853 850 if (obj == NULL) ok = false; 851 else ok = true; 854 852 } CATCH(merr) { 855 853 printf("NamedObjMgr::ReadFITS(_Error Exception= %ld (%s) \n", (long)merr, PeidaExc(merr)); 856 854 ok = false; 857 855 } 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 887 if (ok && (obj != NULL)) { 859 888 if (nobj.length()<1) nobj = servnobjm->FileName2Name(flnm); 860 889 AddObj((AnyDataObj*)obj, nobj); 861 890 } 862 #else863 printf("NamedObjMgr::ReadFITS( NON-Disponible EVOL-PLANCK) \n");864 #endif865 891 return; 866 892 }
Note:
See TracChangeset
for help on using the changeset viewer.