Changeset 293 in Sophya for trunk/SophyaPI/PIext/nobjmgr.cc
- Timestamp:
- May 11, 1999, 6:04:58 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/nobjmgr.cc
r179 r293 15 15 #include "strutil.h" 16 16 #include "datatypes.h" 17 #include "fitsimage.h"18 17 19 18 #include "nobjmgr.h" … … 26 25 #include "matrix.h" 27 26 #include "cvector.h" 28 #include "zfidu.h" 29 30 #include "fft.h" 27 28 // EVOL-PLANCK 29 #ifdef SANS_EVOLPLANCK 30 #include "fitsimage.h" 31 #include "zfidu.h" 32 #endif 33 31 34 #include "fct1dfit.h" 32 35 #include "fct2dfit.h" … … 45 48 46 49 // Si le module StarReco++ a ete compile (Pour les StarList, Transfo, etc ... 47 #if ndef SANS_StarReco50 #ifdef SANS_EVOLPLANCK 48 51 #include "pistlist.h" 49 52 #include "transfo.h" … … 388 391 TRY{ 389 392 // obj = RzReadFits((char*)flnm.c_str(), ImgOffX, ImgOffY, ImgSizX, ImgSizY, ImgBitSgn); 393 #ifdef SANS_EVOLPLANCK 390 394 obj = RzReadFits((char*)flnm.c_str()); 395 #else 396 printf("NamedObjMgr::ReadFITS( NON-Disponible EVOL-PLANCK) \n"); 397 obj = NULL; 398 #endif 391 399 if (obj == NULL) ok = false; 392 400 } CATCH(merr) { … … 438 446 void NamedObjMgr::SaveFits(string const& nom, string const & flnm) 439 447 { 448 449 #ifndef SANS_EVOLPLANCK 450 printf("NamedObjMgr::SaveFITS( NON-Disponible EVOL-PLANCK) \n"); 451 return; 452 453 #else 454 440 455 PPersist* obj=NULL; 441 456 obj = GetObj(nom); 442 457 if (obj == NULL) return; 443 444 458 int cid = obj->ClassId(); 445 459 if ( (cid < ClassId_Image) && ( cid > ClassId_Image+kr_8) ) { … … 485 499 } ENDTRY; 486 500 501 #endif 502 487 503 return; 488 504 } … … 580 596 break; 581 597 598 #ifdef SANS_EVOLPLANCK 582 599 case ClassId_ZFidu : 583 600 ((ZFidu*)obj)->Print(); 584 601 break; 585 602 586 #ifndef SANS_StarReco587 603 case ClassId_StarList : 588 604 ((StarList*)obj)->Print(10, 1, 50); … … 710 726 break; 711 727 728 #ifdef SANS_EVOLPLANCK 712 729 case ClassId_ZFidu : 713 730 { … … 723 740 } 724 741 725 #ifndef SANS_StarReco726 742 case ClassId_StarList : 727 743 { … … 1333 1349 ndata=((RzImage*)obj)->XSize()*((RzImage*)obj)->YSize(); 1334 1350 break; 1335 #if ndef SANS_StarReco1351 #ifdef SANS_EVOLPLANCK 1336 1352 case ClassId_StarList : 1337 1353 ndata=((StarList*)obj)->NbStars(); … … 1392 1408 if (!myImgApp) return; 1393 1409 1394 cmd = "rm " + fname;1410 cmd = "rm -f " + fname; 1395 1411 rc = system(cmd.c_str()); 1396 1412 printf("PlotFunc_Do> %s (Rc=%d)\n", cmd.c_str(), rc); … … 2010 2026 } 2011 2027 2012 /* --Methode-- */2013 void NamedObjMgr::FFT(string const& nom, string dopt)2014 {2015 PPersist* obj=GetObj(nom);2016 if (obj == NULL) {2017 cout << "NamedObjMgr::FFT() Error , Pas d'objet de nom " << nom << endl;2018 return;2019 }2020 if (!myImgApp) return;2021 2022 int cid = obj->ClassId();2023 if (cid != ClassId_Vector) {2024 string ctyp = servnobjm->PClassIdToClassName(cid);2025 cout << "NamedObjMgr::FFT() Error , Objet n'est pas un vecteur " << ctyp << endl;2026 return;2027 }2028 2029 FFT1 fft( *((Vector*)obj) );2030 2031 if (fft.NData() < 1) return;2032 2033 char* ntn[3] = {"refc", "imfc", "pfc"};2034 NTuple* nt = new NTuple(3,ntn); // Creation NTuple2035 Vector* vf = new Vector(fft.NData()/2);2036 2037 float xnt[3];2038 double pf;2039 for(int k=0; k<fft.NData()/2; k++) {2040 xnt[0] = fft.ReF(k); xnt[1] = fft.ImF(k);2041 pf = (xnt[0]*xnt[0]+xnt[1]*xnt[1]);2042 if (pf >= 0.) pf = sqrt(pf);2043 xnt[2] = pf; (*vf)(k) = pf;2044 nt->Fill(xnt);2045 }2046 2047 P1DArrayAdapter* vya = new POVectorAdapter(vf, true);2048 // vya->DefineXCoordinate(xmin, xmax); a determiner2049 PIYfXDrawer* dr = new PIYfXDrawer(vya, NULL, true) ;2050 bool fgsr = true;2051 dopt = "thinline," + dopt;2052 int opt = servnobjm->DecodeDispOption(dopt, fgsr);2053 myImgApp->DispScDrawer(dr, nom, opt);2054 if (fgsr) myImgApp->RestoreGraphicAtt();2055 2056 return;2057 }
Note:
See TracChangeset
for help on using the changeset viewer.