Changeset 2054 in Sophya for trunk


Ignore:
Timestamp:
Jun 11, 2002, 7:14:26 PM (23 years ago)
Author:
ansari
Message:

corrections pour proj ds localmap - Reza 11/6/2002

Location:
trunk/ArchTOIPipe
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/ArchTOIPipe/ProcWSophya/simcleaner.cc

    r2048 r2054  
    2020  SetCleanForMeanThrNSig();
    2121  SetFlaggingThrNSig();
    22 
     22 
    2323  SetRange();
     24  SetFlagMask();
     25
    2426  FillMeanSigNTuple();
    2527  char* noms[] = {"sn","mean","sigma"};
     
    2931  totnbblock = 0;
    3032  ns_outofrange = ns_flag1p = ns_flag2p = ns_flag1m = ns_flag2m = 0;
     33  ns_inflagged = 0;
     34  ns_cleannsig = 0;
    3135  gl_sum = gl_sum2 = 0.;  ns_glms = 0;
    3236}
     
    5155  TOIProcessor::PrintStatus(os);
    5256  os << " ProcessedSampleCount=" << ProcessedSampleCount()
     57     << " NS_InFlagged= " << ns_inflagged
    5358     << " NS_OutOfRange= " << ns_outofrange
     59     << " NS_CleanNSig= " << ns_cleannsig << endl
    5460     << " NS_Flag1(+)= " << ns_flag1p << " NS_Flag2(+)= " << ns_flag2p
    5561     << " NS_Flag1(-)= " << ns_flag1m << " NS_Flag2(-)= " << ns_flag2m << endl;
     
    131137      double cleanthrmin = range_min;
    132138      double cleanthrmax = range_max;
    133       if ((kb > 0) && ( ns_glms > wsize/2) ) {
     139      if ((kb > mNbW/2) && ( ns_glms > 3*wsize) ) {
    134140        cleanthrmin = cur_mean-nsigclean*cur_sig;
    135141        cleanthrmax = cur_mean+nsigclean*cur_sig;
     
    137143      for(j=0; j<wsize; j++) {
    138144        double x = vin(j);
     145        if ((vfg(j)&flag_mask)) { ns_inflagged++; continue; }
    139146        if ((x > range_max) || (x < range_min) ) continue;
    140         if ((x > cleanthrmax) || (x < cleanthrmin) )  continue;   
     147        if ((x > cleanthrmax) || (x < cleanthrmin) )  {
     148          ns_cleannsig++;
     149          continue;       
     150        }   
    141151        sum += x;  sum2 += x*x;   nok++;
    142152      }
     
    295305      if (fgout)  for(j=0; j<wsize; j++) {
    296306        double x = vinc(j);
     307        if ((vfgc(j)&flag_mask))  ns_inflagged++;
    297308        if ((x > range_max) || (x < range_min) ) {
    298309          ns_outofrange++; vfgc(j) |= FlgToiOut;
  • trunk/ArchTOIPipe/ProcWSophya/simcleaner.h

    r2048 r2054  
    4040  inline void   GetRange(double& min, double& max) const
    4141    { min = range_min; max = range_max; }
    42   inline void   SetCleanForMeanThrNSig(double ns=3.)
     42  inline void   SetFlagMask(uint_8 mask = 0)  // Aucun flag utilise par defaut
     43    { flag_mask = mask; }
     44  inline uint_8 GetFlagMask() { return flag_mask; }
     45
     46  inline void   SetCleanForMeanThrNSig(double ns=5.)
    4347    { nsigclean = ns; }
    4448  inline double GetCleanForMeanThrNSig()
     
    7579  int min_npt2;       // Min NPoints a += nsig2
    7680  double range_min, range_max;  // Range acceptable pour in
     81  uint_8 flag_mask;     // mask de flag utilise
     82  int_4 ns_inflagged;     // Nb d'echantillons flagges
     83
    7784  int_4 ns_outofrange;  // Nb de points out of range
     85  int_4 ns_cleannsig;   // Nb de points nettoyes a +/- nsigclean
    7886  int_4 ns_flag1p;       // Nb de points flagges avec nsig1 (> mean)
    7987  int_4 ns_flag2p;       // Nb de points flagges avec nsig2 (> mean)
  • trunk/ArchTOIPipe/ProcWSophya/toi2map.cc

    r2012 r2054  
    33//                               Christophe Magneville
    44//                               Reza Ansari
    5 // $Id: toi2map.cc,v 1.25 2002-05-16 20:39:52 ansari Exp $
     5// $Id: toi2map.cc,v 1.26 2002-06-11 17:14:25 ansari Exp $
    66
    77#include "machdefs.h"
     
    194194
    195195  int_4 ipix = mMap->PixIndexSph(theta,phi);
     196  if ((ipix < 0) || (ipix >= mMap->NbPixels()) ) continue;
    196197  (*mMap)(ipix) += bolo;   
    197198  ((*mWMap)(ipix)) += 1;
  • trunk/ArchTOIPipe/TestPipes/aksj02.cc

    r2050 r2054  
    4040  else {
    4141    cout << "\n Usage : aksj02 [-intoi toiname] [-start snb] [-end sne] \n"
    42          << "         [-dbg] [-wtoi sz] [-wclean wsz,nbw] [-range min,max] \n"
     42         << "         [-dbg] [-wtoi sz] [-wclean wsz,nbw] [-range min,max] [-cleannsig nsig]\n"
    4343         << "         [-soff wsz,nptfit,degpol] [-soffnt PPFName] \n"
    4444         << "         [-soff2 wsz,nptfit,degpol] [-soff2nt PPFName] \n"
     
    4646         << "         [-bgalcut bmin,bmax]  [-bgal2cut bmin,bmax] \n"
    4747         << "         [-gfilt wsz,sigma] \n"
    48          << "         [-nooutflg] [-wrtms] [-wrtifo] [-prstat] [-useseqbuff] \n"
     48         << "         [-nooutflg] [-wrtms] [-wrtifo] [-noprstat] [-useseqbuff] \n"
    4949         << "         inFitsName outFitsName \n"
    5050         << "   -dbg : sets TOISeqBuffered debug level to 1 \n"
     
    5656         << "   -wtoi sz : sets TOISeqBuff buffer size (def= 8192)\n"
    5757         << "   -wclean wsz,nbw : sets cleaner window parameters (256,5) \n"
     58         << "   -cleannsig nsig : Sets cleanner ThrNSig (default = 999999.) \n"
    5859         << "   -soff wsz,nptfit,degpol : set SimpleOffsetEstimator parameters\n"
    5960         << "   -soffnt PPFName : Writes out SimpleOffsetEstimator NTuple \n"
     
    9798  int wdegli = 512;
    9899 
    99   int wfft = 4096;
    100   int keepfft = 0;
    101100  int nmax = 10;
    102101  int istart = 0;
     
    109108  int clean_wsz = 256;
    110109  int clean_nbw = 5;
     110  double clean_nsig = 999999.;
    111111
    112112  // SimpleOffsetEstimator parameters
     
    154154
    155155  bool fg_f_filt = false;
    156   bool fg_killfreq = false;
    157   int bf_killfreq = 1;
    158   int nharm_killfreq = 1;
    159   double sigf_killfreq = 1.;
    160156
    161157  if (narg < 4) Usage(true);
     
    181177      sscanf(arg[ia+1],"%d,%d",  &clean_wsz, &clean_nbw);
    182178    }   
     179    else if (strcmp(arg[ia],"-cleannsig") == 0) {
     180      if (ia == narg-1) Usage(true); 
     181      clean_nsig = atof(arg[ia+1]); ia++;
     182    }   
     183    else if (strcmp(arg[ia],"-cleannsig") == 0) {
     184      if (ia == narg-1) Usage(true); 
     185      clean_nsig = atof(arg[ia+1]); ia++;
     186    }   
    183187    else if (strcmp(arg[ia],"-soff") == 0) {
    184188      if (ia == narg-1) Usage(true);
     
    291295         << " - " << range_max << endl;
    292296    cleaner.SetRange(range_min, range_max);
     297    cleaner.SetCleanForMeanThrNSig(clean_nsig);
    293298
    294299    cout << "> Creating SimpleOffsetEstimator(" << soff_mwsz << "," << soff_nptfit
  • trunk/ArchTOIPipe/TestPipes/toistat.cc

    r2047 r2054  
    4444    cout << " toistat : produce a stat NTuple (mean,sigma) from a TOI" << endl;
    4545    cout << "\n Usage : toistat [-intoi toiname] [-start snb] [-end sne] \n"
    46          << "         [-wtoi sz] [-wclean wsz,nbw] [-range min,max] \n"
     46         << "         [-wtoi sz] [-wclean wsz,nbw] [-range min,max] [-cleannsig nsig] \n"
    4747         << "         [-outppf] [-noprstat] [-useseqbuff] \n"
    4848         << "         inFitsName outFileName \n"
     
    5454         << "   -wtoi sz : sets TOISeqBuff buffer size (def= 8192)\n"
    5555         << "   -wclean wsz,nbw : sets cleaner window parameters (256,5) \n"
     56         << "   -cleannsig nsig : Sets cleanner ThrNSig (default = 999999.) \n"
    5657         << "   -outppf : Write the NTuple in PPF format (default: FITS) \n"
    5758         << "   -noprstat : DO NOT PrintStat with ProcSampleCounter \n"
     
    8889  int clean_wsz = 256;
    8990  int clean_nbw = 5;
     91  double clean_nsig = 999999.;
    9092
    9193  // File names
     
    115117      sscanf(arg[ia+1],"%d,%d",  &clean_wsz, &clean_nbw);
    116118    }   
     119    else if (strcmp(arg[ia],"-cleannsig") == 0) {
     120      if (ia == narg-1) Usage(true); 
     121      clean_nsig = atof(arg[ia+1]); ia++;
     122    }   
    117123    else if (strcmp(arg[ia],"-range") == 0) {
    118124      if (ia == narg-1) Usage(true);
     
    127133
    128134    else if (strcmp(arg[ia],"-noprstat") == 0)  fgprstat = false;
     135    else if (strcmp(arg[ia],"-prstat") == 0)  fgprstat = true;
    129136    else if (strcmp(arg[ia],"-useseqbuff") == 0)  fgsegmented = false;
    130137
     
    165172         << " - " << range_max << endl;
    166173    cleaner.SetRange(range_min, range_max);
     174    cleaner.SetCleanForMeanThrNSig(clean_nsig);
    167175    cleaner.FillMeanSigNTuple(true);
    168176
Note: See TracChangeset for help on using the changeset viewer.