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


Ignore:
Timestamp:
May 11, 1999, 6:04:58 AM (26 years ago)
Author:
ercodmgr
Message:

Adaptation aux "normes DPC", introduction des classes CmdExecutor, ...
Fenetre d'aide en lignes, gestion de modules, ... Reza 11/05/99

File:
1 edited

Legend:

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

    r179 r293  
    1515#include "strutil.h"
    1616#include "datatypes.h"
    17 #include "fitsimage.h"
    1817
    1918#include "nobjmgr.h"
     
    2625#include "matrix.h"
    2726#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
    3134#include "fct1dfit.h"
    3235#include "fct2dfit.h"
     
    4548
    4649//  Si le module StarReco++ a ete compile (Pour les StarList, Transfo, etc ...
    47 #ifndef SANS_StarReco
     50#ifdef SANS_EVOLPLANCK
    4851#include "pistlist.h"
    4952#include "transfo.h"
     
    388391TRY{
    389392//  obj = RzReadFits((char*)flnm.c_str(), ImgOffX, ImgOffY, ImgSizX, ImgSizY, ImgBitSgn);
     393#ifdef SANS_EVOLPLANCK
    390394  obj = RzReadFits((char*)flnm.c_str());
     395#else
     396  printf("NamedObjMgr::ReadFITS( NON-Disponible EVOL-PLANCK) \n");
     397  obj = NULL;
     398#endif
    391399  if (obj == NULL)   ok = false;
    392400}  CATCH(merr) {
     
    438446void NamedObjMgr::SaveFits(string const& nom, string const & flnm)
    439447{
     448
     449#ifndef SANS_EVOLPLANCK
     450printf("NamedObjMgr::SaveFITS( NON-Disponible EVOL-PLANCK) \n");
     451return;
     452
     453#else
     454
    440455PPersist* obj=NULL;
    441456obj = GetObj(nom);
    442457if (obj == NULL)  return;
    443 
    444458int cid = obj->ClassId();
    445459if ( (cid < ClassId_Image) && ( cid > ClassId_Image+kr_8) ) {
     
    485499} ENDTRY;
    486500
     501#endif
     502
    487503return;
    488504}
     
    580596    break;
    581597
     598#ifdef SANS_EVOLPLANCK
    582599  case ClassId_ZFidu :
    583600    ((ZFidu*)obj)->Print();
    584601    break;
    585602
    586 #ifndef SANS_StarReco
    587603  case ClassId_StarList :
    588604    ((StarList*)obj)->Print(10, 1, 50);
     
    710726    break;
    711727
     728#ifdef SANS_EVOLPLANCK
    712729  case ClassId_ZFidu :
    713730    {
     
    723740    }
    724741
    725 #ifndef SANS_StarReco
    726742  case ClassId_StarList :
    727743    {
     
    13331349    ndata=((RzImage*)obj)->XSize()*((RzImage*)obj)->YSize();
    13341350    break;
    1335 #ifndef SANS_StarReco
     1351#ifdef SANS_EVOLPLANCK
    13361352  case ClassId_StarList :
    13371353    ndata=((StarList*)obj)->NbStars();
     
    13921408if (!myImgApp)  return;
    13931409
    1394 cmd = "rm " + fname;
     1410cmd = "rm -f " + fname;
    13951411rc = system(cmd.c_str());
    13961412printf("PlotFunc_Do> %s  (Rc=%d)\n", cmd.c_str(), rc);
     
    20102026}
    20112027
    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 NTuple
    2035 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 determiner
    2049 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.