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


Ignore:
Timestamp:
Apr 3, 2006, 2:20:29 PM (19 years ago)
Author:
ansari
Message:

Suppression de toute reference a FITS (en particulier NObjMgrAdapter::ReadFits/SaveFits supprime) dans le module PIext - Makefile et smakefile refait , Reza 3 Avril 2006

File:
1 edited

Legend:

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

    r2762 r2933  
    2424#include "fitsimage.h" 
    2525#else
    26 #include "fitsautoreader.h"
    2726#include "tvector.h"
    2827#include "pitvmaad.h"
     
    11131112}
    11141113
    1115 /* --Methode-- */
    1116 void NamedObjMgr::ReadFits(string const & flnm, string & nobj)
    1117 {
    1118 ZSync zs(*myMutex); zs.NOp();
    1119 #ifdef SANS_EVOLPLANCK
    1120 bool ok = false;
    1121 RzImage* obj=NULL;
    1122 TRY{
    1123   obj = RzReadFits((char*)flnm.c_str());
    1124   if (obj == NULL)   ok = false;
    1125   else ok = true;
    1126 }  CATCH(merr) {
    1127   printf("NamedObjMgr::ReadFITS(_Error Exception= %ld (%s) \n", (long)merr, PeidaExc(merr));
    1128   ok = false;
    1129 } ENDTRY;
    1130 
    1131 if (ok && (obj != NULL)) {
    1132   if (nobj.length()<1)  nobj = servnobjm->FileName2Name(flnm);
    1133   AddObj_P((AnyDataObj*)obj, nobj);
    1134 }
    1135 #else
    1136  try {
    1137    FITS_AutoReader fiar(flnm);
    1138    char bun[16];
    1139    int nhdu = fiar.NbBlocks();
    1140    if (nobj.length()<1)  nobj = servnobjm->FileName2Name(flnm);
    1141    string name;
    1142    AnyDataObj* obj;
    1143    int kon = 1;
    1144    for(int k=1; k<=nhdu; k++) {
    1145      obj = fiar.ReadObject(k);
    1146      if (obj) {
    1147        cout << " NamedObjMgr::ReadFits() " << (string)typeid(*obj).name()
    1148             << "  read From HDU " << k << endl;
    1149        if (typeid(*obj) == typeid(DVList)) {
    1150          delete obj;
    1151          continue;
    1152        }
    1153        if (kon > 1) {
    1154          sprintf(bun, "%d", kon);
    1155          name = nobj + bun;
    1156        }
    1157        else name = nobj;
    1158        AddObj_P(obj, name, false);
    1159        kon++;
    1160      }
    1161      else cerr << " NamedObjMgr::ReadFits()  NULL pointer from FITS_AutoReader" << endl;
    1162    }
    1163  }
    1164  catch(PThrowable & exc) {
    1165    cerr << " NamedObjMgr::ReadFits() / Error - Catched Exception \n "
    1166         << "    Type= " << (string)typeid(exc).name()
    1167         << " - Msg= " << exc.Msg() << endl;
    1168 
    1169    }
    1170 #endif
    1171 
    1172 return;
    1173 }
    11741114
    11751115/* --Methode-- */
     
    13051245}
    13061246
    1307 /* --Methode-- */
    1308 void NamedObjMgr::SaveFits(string& nom, string const & flnm)
    1309 {
    1310 ZSync zs(*myMutex); zs.NOp();
    1311 
    1312 NObjMgrAdapter* obja=NULL;
    1313 obja = GetObjAdapter_P(nom);
    1314 if (obja == NULL)  return;
    1315 cout << "  SaveFits: Object" << nom << " to FITS file " << flnm << endl;
    1316 obja->SaveFits(flnm);
    1317 return;
    1318 }
    1319 
    13201247
    13211248
Note: See TracChangeset for help on using the changeset viewer.