Changeset 3674 in Sophya for trunk/AddOn/TAcq/brparam.cc


Ignore:
Timestamp:
Nov 15, 2009, 1:27:00 AM (16 years ago)
Author:
ansari
Message:

version presque finale mfacq.cc avec reduction de taille de paquets - Reza 14/11/2009

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/AddOn/TAcq/brparam.cc

    r3673 r3674  
    6363
    6464/* --Methode-- */
     65void BRConfList::SetBaseDirectory(string basedir)
     66{
     67  basedir_=basedir;
     68  size_t len = basedir_.length();
     69  if ((len>1)&&(basedir_[len-1]!='/')) basedir_ += '/';
     70}
     71
     72/* --Methode-- */
    6573void BRConfList::Set(BRConfList const & cf)
    6674{
     
    8694
    8795/* --Methode-- */
    88 BRParList::BRParList(string fibres,unsigned int paqsz ,unsigned int nframeDMA,
     96BRParList::BRParList(string fibres,unsigned int paqsz ,unsigned int dmaszkb,
    8997                     int nfiles, string acqmod,int nblocfile,int nmxproc ,
    9098                     string outpath, uint_4 nzon , uint_4 npaqzon, bool fgcntlc)
     
    94102  for (int fib=0; fib<PMAXNBFIBRES;fib++)  FiberNum[fib]=0;
    95103  PaqSize=paqsz;
    96   nbFrameDMA=nframeDMA;
     104  dmasizekb=dmaszkb;
    97105  NbFiles=nfiles;
    98106  AcqMode=acqmod;
     
    105113  savesigfits=true;
    106114  fgnulldev4fits=false;
     115
    107116  fg_hard_ctrlc=fgcntlc;
     117
    108118  fgreducpsize=false;
     119  reducneedcopy=false;
    109120  pqreducmode=BR_CopyRA;
    110121  redpqsize=PaqSize;
    111122  reducoffset=0;
    112123
     124  skysource="";
    113125  monothr=false;
    114126  activate_pattern=false;
     
    130142  for (int fib=0; fib<PMAXNBFIBRES;fib++)  FiberNum[fib]=p.FiberNum[fib];
    131143  PaqSize=p.PaqSize;
    132   nbFrameDMA=p.nbFrameDMA;
     144  dmasizekb=p.dmasizekb;
    133145  NbFiles=p.NbFiles;
    134146  AcqMode=p.AcqMode;
     
    145157
    146158  fgreducpsize=p.fgreducpsize;
     159  reducneedcopy=p.reducneedcopy;
    147160  pqreducmode=p.pqreducmode;
    148161  redpqsize=p.redpqsize;
    149162  reducoffset=p.reducoffset;
    150163
     164  skysource=p.skysource;
     165
    151166  monothr=p.monothr;
    152167  activate_pattern=p.activate_pattern;
     
    158173{
    159174  DataCards conf(file);
    160   FiberListS= conf.SParam("Fibres",0,"1");
    161   PaqSize=(unsigned int)conf.IParam("PaqSZ",0,16424);
    162   nbFrameDMA =(unsigned int) conf.IParam("nbFrameDma",0,32);
    163   NbFiles=conf.IParam("NbFiles",0,1);
    164   NBlocPerFile=conf.IParam("NBlocPerFile",0,10);
    165   NMaxProc=conf.IParam("NMaxProc",0,0);
    166   OutPathName= conf.SParam("OutPathName",0,"TstAcq");
     175  FiberListS= conf.SParam("fibres",0,"1");
     176  OutPathName= conf.SParam("outpathname",0,"TstAcq");
     177  skysource= conf.SParam("skysource",0,"");
     178  PaqSize=(uint_4)conf.IParam("paqsize",0,16424);
     179  dmasizekb =(uint_4) conf.IParam("dmasizekb",0,32);
     180  NbFiles=conf.IParam("nbfiles",0,1);
     181  NBlocPerFile=conf.IParam("nblocperfile",0,10);
    167182  AcqMode =conf.SParam("acqmode",0,"std");
    168   nZones=(unsigned int)conf.IParam("nZones",0,4);
    169   nPaqZone=(uint_4)conf.IParam("nPaqZone",0,128);
    170   fg_hard_ctrlc=conf.HasKey("fg_hard_ctrlc");
     183  nZones=(uint_4)conf.IParam("memmgr",0,4);
     184  nPaqZone=(uint_4)conf.IParam("memmgr",1,128);
     185  if (conf.HasKey("reducpaqsz")) {  // reduction des tailles de paquets
     186    fgreducpsize=true;
     187    redpqsize=(uint_4)conf.IParam("reducpaqsz",0,PaqSize/4);
     188    reducoffset=(uint_4)conf.IParam("reducpaqsz",1,0);
     189  }
     190  NMaxProc=conf.IParam("monitor",0,0);
     191  fg_hard_ctrlc=conf.HasKey("hard_ctrlc");
    171192
    172193  Decode();
     
    191212  }
    192213  string acqmode = AcqMode;
    193   if (acqmode == "std")  swapall = BR_Copy ;
     214  reducneedcopy=false;  pqreducmode=BR_TwoChanReduc;
     215  if (acqmode == "std")   swapall = BR_Copy ; 
    194216  if (acqmode == "nosw")   swapall = BR_Copy ;
    195217  if (acqmode == "nof")  { swapall = BR_Copy ; savesigfits = false; }
    196   if (acqmode == "fft1c")  swapall = BR_FFTOneChan;
    197   if (acqmode == "fft2c")  swapall = BR_FFTTwoChan;
    198   if (acqmode == "fft1cnof")  { swapall = BR_FFTOneChan;  savesigfits = false; }
    199   if (acqmode == "fft2cnof")  { swapall = BR_FFTTwoChan;  savesigfits = false; }
     218  if (acqmode == "fft1c")  { swapall = BR_FFTOneChan; reducneedcopy=true;  pqreducmode=BR_OneChanReducK0; }
     219  if (acqmode == "fft2c")  { swapall = BR_FFTTwoChan;  reducneedcopy=true;  pqreducmode=BR_TwoChanReducK0; }
     220  if (acqmode == "fft1cnof") 
     221    { swapall = BR_FFTOneChan;  savesigfits = false; reducneedcopy=true;  pqreducmode=BR_OneChanReducK0;  }
     222  if (acqmode == "fft2cnof") 
     223    { swapall = BR_FFTTwoChan;  savesigfits = false; reducneedcopy=true;  pqreducmode=BR_TwoChanReducK0; }
    200224  if (acqmode == "mono")  { monothr = true;   swapall = BR_Copy; }
    201225  if (acqmode == "monodirect")  { monothr = true;  swapall =  BR_CopyHDR;}
     
    206230
    207231  if (acqmode == "swapall")  swapall = BR_SwapAll;
    208   if (acqmode == "fft1csw")  swapall = BR_FFTOneChanSwapAll;
    209   if (acqmode == "fft2csw")  swapall = BR_FFTTwoChanSwapAll;
    210   if (acqmode == "fft1cswnof")  { swapall = BR_FFTOneChanSwapAll;  savesigfits = false; }
    211   if (acqmode == "fft2cswnof")  { swapall = BR_FFTTwoChanSwapAll;  savesigfits = false; }
     232  if (acqmode == "fft1csw")
     233    { swapall = BR_FFTOneChanSwapAll;  reducneedcopy=true;  pqreducmode=BR_OneChanReducK0; }
     234  if (acqmode == "fft2csw")
     235    { swapall = BR_FFTTwoChanSwapAll;  reducneedcopy=true;  pqreducmode=BR_TwoChanReducK0; }
     236  if (acqmode == "fft1cswnof") 
     237    { swapall = BR_FFTOneChanSwapAll;  savesigfits = false; reducneedcopy=true;  pqreducmode=BR_OneChanReducK0; }
     238  if (acqmode == "fft2cswnof") 
     239    { swapall = BR_FFTTwoChanSwapAll;  savesigfits = false; reducneedcopy=true;  pqreducmode=BR_TwoChanReducK0; }
    212240  if ((acqmode == "swh") || (acqmode == "mxs") || (acqmode == "monoswh") )  swapall = BR_SwapHDR;
    213241  if ((acqmode == "swapallnof") || (acqmode == "mxs") )  savesigfits = false;
     
    217245  if (acqmode == "swap32")   swapall = BR_Swap32 ;
    218246  if (acqmode == "nof32")   { swapall = BR_Swap32 ; savesigfits = false; }
    219   if (acqmode == "fft1c32")  swapall = BR_FFTOneChanSwap32;
    220   if (acqmode == "fft2c32")  swapall = BR_FFTTwoChanSwap32;
    221   if (acqmode == "fft1cnof32")  { swapall = BR_FFTOneChanSwap32;  savesigfits = false; }
    222   if (acqmode == "fft2cnof32")  { swapall = BR_FFTTwoChanSwap32;  savesigfits = false; }
     247  if (acqmode == "fft1c32") 
     248    { swapall = BR_FFTOneChanSwap32; reducneedcopy=true;  pqreducmode=BR_OneChanReducK0; }
     249  if (acqmode == "fft2c32") 
     250    { swapall = BR_FFTTwoChanSwap32; reducneedcopy=true;  pqreducmode=BR_TwoChanReducK0; }
     251  if (acqmode == "fft1cnof32") 
     252    { swapall = BR_FFTOneChanSwap32;  savesigfits = false; reducneedcopy=true;  pqreducmode=BR_OneChanReducK0; }
     253  if (acqmode == "fft2cnof32") 
     254    { swapall = BR_FFTTwoChanSwap32;  savesigfits = false; reducneedcopy=true;  pqreducmode=BR_TwoChanReducK0; }
     255
     256  if (fgreducpsize) {
     257    if (redpqsize>=PaqSize) fgreducpsize=false;
     258    else {
     259      if(reducoffset>(PaqSize-redpqsize)/2) reducoffset=(PaqSize-redpqsize)/2;
     260    }
     261  }
    223262}
    224263
     
    229268  os << " FiberListS=" << FiberListS ;
    230269  os << " PaqSize=" <<PaqSize;
    231   os << " nbFrameDMA=" <<nbFrameDMA << endl;
     270  os << " DMA_Size_kb=" <<dmasizekb << endl;
    232271  os << " AcqMode="<<AcqMode;
    233272  os << " Type of acquisition :" << BRPaquet::FmtConvToString( swapall) << endl;
     273  os << " SkySource=" << skysource;
    234274  os << " NbFiles="<<NbFiles;
    235275  os << " NBlocPerFile="<<NBlocPerFile;
    236276  os << " OutPathName="<<OutPathName << endl;
    237277  os << " MemMgr: nZones="<<nZones;
    238   os << " nPaqZone="<<nPaqZone;
     278  os << " nPaqZone="<<nPaqZone<<endl;
     279  if (fgreducpsize) {
     280    os << " PaquetSize Reduction, ReducedSize=" << redpqsize << " Offset=" << reducoffset << endl;
     281  }
    239282  os << " fg_hard_ctrlc=" << ((fg_hard_ctrlc)?"true":"false");
    240283  os << " Save to fits " << ((savesigfits)?"true":"false") << endl;
Note: See TracChangeset for help on using the changeset viewer.