Changeset 1442 in Sophya for trunk/ArchTOIPipe/Kernel


Ignore:
Timestamp:
Mar 15, 2001, 1:09:31 PM (25 years ago)
Author:
ansari
Message:

Ajout de processeurs simples - Deglitcher + Filtre, + programme test - Reza 15/3/2001

Location:
trunk/ArchTOIPipe/Kernel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ArchTOIPipe/Kernel/fitstoiwtr.cc

    r1439 r1442  
    101101  int sne = getMaxIn();
    102102
     103  double* tabdata = new double[ndata];
     104  double* tabflag = new double[ndata]; // ? pas integer ?? $CHECK$ - Reza
     105  bool* tabck = new bool[ndata];
     106  int i;
     107  for(i=0; i<ndata; i++) {
     108    tabdata[i] = -9.e19;  // $CHECK$ - Reza valeur par defaut !
     109    tabflag[i] = -9.e19;  // $CHECK$ - Reza valeur par defaut !
     110    tabck[i] = checkInputTOIIndex(i);
     111  }
     112
    103113  for (int sn = snb; sn <= sne; sn++) {
     114    //    if ((sn%2000 == 0) || (sn<snb+5))
     115    //  cout << " DBG-A-FitsWriter::run()" << sn << endl;
    104116    try {
     117      for (i=0; i<ndata; i++) {
     118        if (tabck[i]) {
     119          tabdata[i] = getData(i, sn);
     120          if (outFlags) tabflag[i] = getFlag(i, sn);
     121        }
     122      }
    105123      fits_lock();
     124      //      if ((sn%2000 == 0) || (sn<snb+5))
     125      //cout << " DBG-B-FitsWriter::run()" << sn << endl;
    106126      double xx = sn;
    107127      fits_write_col_dbl(fptr, 1, fitsLine, 1, 1, &xx, &fstatus);
    108       fits_unlock();
    109       for (int i=0; i<ndata; i++) {
    110         double x = -9.e19;  // $CHECK$ - Reza valeur par defaut !
    111         if (checkInputTOIIndex(i)) x = getData(i, sn);
    112         fits_lock();
     128     
     129      for (i=0; i<ndata; i++) {
    113130        if (outFlags) {
    114           fits_write_col_dbl(fptr, 2*i+2, fitsLine, 1, 1, &x, &fstatus);
    115           if (checkInputTOIIndex(i))   x = getFlag(i, sn);
    116           else x = -9.e19;  // $CHECK$ - Reza valeur par defaut !
    117           fits_write_col_dbl(fptr, 2*i+3, fitsLine, 1, 1, &x, &fstatus);
     131          fits_write_col_dbl(fptr, 2*i+2, fitsLine, 1, 1, tabdata+i, &fstatus);
     132          fits_write_col_dbl(fptr, 2*i+3, fitsLine, 1, 1, tabflag+i, &fstatus);
    118133        } else {
    119           fits_write_col_dbl(fptr, i+2, fitsLine, 1, 1, &x, &fstatus);
     134          fits_write_col_dbl(fptr, i+2, fitsLine, 1, 1, tabdata+i, &fstatus);
    120135        }
    121136        if (fstatus != 0) {
     
    124139          abort();
    125140        }
    126         fits_unlock();
    127141      }
     142      fits_unlock();
     143      //           if ((sn%2000 == 0) || (sn<snb+5))
     144      //        cout << " DBG-C-FitsWriter::run()" << sn << " line=" << fitsLine << endl;
     145      fitsLine++;
    128146    } catch (PException e) {
    129       cout << "fitstoiwtr exception " << e.Msg() << endl;
    130       continue;
     147    cout << "fitstoiwtr exception " << e.Msg() << endl;
     148    continue;
    131149    }
    132     fitsLine++;
    133150  }
     151
     152  delete[] tabdata;
     153  delete[] tabflag;
     154  delete[] tabck;
    134155
    135156  fits_lock();
     
    137158  fits_report_error(stderr, fstatus);
    138159  fits_unlock();
    139   cout << "fitstoiwriter done" << endl;
     160  cout << "fitstoiwriter done fitsLine= " << fitsLine << endl;
    140161}
    141162
  • trunk/ArchTOIPipe/Kernel/toiseqbuff.cc

    r1437 r1442  
    6363  if (!started) return DATA_NOT_YET;
    6464  if (iEnd >= next_in) return DATA_NOT_YET;
    65   if (iStart < (next_in-buffsize)) return DATA_DELETED;
     65  if (isDataDeleted(iStart)) return DATA_DELETED;
    6666  return DATA_OK;
    6767}
     
    102102  }
    103103  cleanWaitGet();
    104   if (isDataDeleted(i))
     104  if (isDataDeleted(i)) {
     105    if (dbglev > 0)
     106      cout << " TOISeqBuffered::doGetData() - DataDeleted() name=" << getName() 
     107           << " i=" << i << " next_in= " << next_in
     108           << " next_out=" << next_out << endl;
    105109    throw RangeCheckError("TOISeqBuffered::doGetData(i) : data deleted");
     110  }
    106111  while (i >= next_in) {
    107112    if (i>next_out) next_out = i;
     
    163168  else {
    164169    if (i != next_in) {
     170      if (dbglev > 0)
     171        cout << " TOISeqBuffered::doPutData() - i!=next_in() name=" << getName() 
     172             << " i=" << i << " next_in= " << next_in
     173             << " next_out=" << next_out << endl;
    165174      string msg = "TOISeqBuffered::doPutData() : i!=next_in TOIname="  + getName();
    166175      throw RangeCheckError(msg);
  • trunk/ArchTOIPipe/Kernel/toiseqbuff.h

    r1437 r1442  
    5959  inline int_4 &        flagRef(int i) { return flags[i%buffsize]; }
    6060  inline bool           isDataDeleted(int i)
    61     { return((i < next_in-wsize-1) ? true : false); }
     61    { return((i < next_in-buffsize-1) ? true : false); }
    6262};
    6363
Note: See TracChangeset for help on using the changeset viewer.