Index: /trunk/Poubelle/archTOI.old/Makefile
===================================================================
--- /trunk/Poubelle/archTOI.old/Makefile	(revision 399)
+++ /trunk/Poubelle/archTOI.old/Makefile	(revision 400)
@@ -1,6 +1,6 @@
 CXX=cxx
 CFITSIODIR=../cfitsio
-#CPPFLAGS=-O -I$(CFITSIODIR)
-CPPFLAGS=-g -I$(CFITSIODIR)
+CPPFLAGS=-O -I$(CFITSIODIR)
+#CPPFLAGS=-g -I$(CFITSIODIR)
 LDLIBS=-L$(CFITSIODIR) -lcfitsio
 archtoi: archtoimain.o archtoi.o archeopsfile.o decompress.o toiiter.o toisvr.o archeops.o \
Index: /trunk/Poubelle/archTOI.old/archtoi.cc
===================================================================
--- /trunk/Poubelle/archTOI.old/archtoi.cc	(revision 399)
+++ /trunk/Poubelle/archTOI.old/archtoi.cc	(revision 400)
@@ -73,4 +73,5 @@
   else tsttoi(sstDiode)
   else tsttoi(sstChannel)
+  else tsttoi(sstStarCnt)
   else tsttoi(sstStarZ)
   else tsttoi(sstStarF)
Index: /trunk/Poubelle/archTOI.old/pisteetoile.cc
===================================================================
--- /trunk/Poubelle/archTOI.old/pisteetoile.cc	(revision 399)
+++ /trunk/Poubelle/archTOI.old/pisteetoile.cc	(revision 400)
@@ -116,5 +116,4 @@
 //	if(!isAlive()) return;
 	indexDebutPiste=InDebutPiste;
-	//	cout << "fill " << indexDebutPiste << "\n";
 	int* PhDiod=PhDiodArray;
 	int* pDataC=pData;
@@ -131,5 +130,4 @@
 	for(int i=0; i<nbdata; i++, PPhDiod++,pDataC++) *PPhDiod=(*pDataC);
 	indexDebutPiste+=nbdata; 
-	//	cout << "push " << nbdata << " " << indexDebutPiste << "\n";
 	return;
 }
@@ -155,5 +153,4 @@
 		if(testEtoile) {
 		// On emballe une etoile.
-		  //		  cout << "star " << setprecision(10) << TIndex << "\n";
 			LastEtoile.FitForme=SuccesAFine;
 			LastEtoile.X2Calc=X2Min;
@@ -275,5 +272,4 @@
 //	On stocke les resultats
 		TIndex=indexDebutPiste+MaxIndex+tmaxfit;
-		//		cout << "tindex " << TIndex << " " <<indexDebutPiste<<" " <<Prepulselong << " " <<MaxIndex << " " << tmaxfit << "\n";
 		X2Min=0.;
 		SuccesAFine=false;
Index: /trunk/Poubelle/archTOI.old/ssthandler.cc
===================================================================
--- /trunk/Poubelle/archTOI.old/ssthandler.cc	(revision 399)
+++ /trunk/Poubelle/archTOI.old/ssthandler.cc	(revision 400)
@@ -184,5 +184,4 @@
   	int jd0 = diodeHistLength-NbSampleBlock;
 
-	//	cout << "find " << NoFirstSpInBlock << "\n";
 	bool FlagLBlockPerdu=false;
 	int ThisBlockNumb=numero_block(blk);
@@ -203,5 +202,5 @@
 
 		if (FlagLBlockPerdu)  {
-			pPiste->fill(Diodedata+offseDataDiod,FirstSplNb(blk));
+			pPiste->fill(Diodedata+offseDataDiod,FirstSplNb(blk),PhDiodTabLong);
 			offseDataDiod+=PhDiodTabLong;
 		}
@@ -232,9 +231,7 @@
 			}
 		// Est-on en bout de Piste?
-		    int npouss = Pousslong;
-		    if (offseDataDiod+npouss > NbSampleBlock) npouss = NbSampleBlock-offseDataDiod;
-		    if (npouss<=0) break;
-			pPiste->push(Diodedata+offseDataDiod,npouss);
-			offseDataDiod+=npouss;
+		    if (offseDataDiod+Pousslong > NbSampleBlock) break;
+		    pPiste->push(Diodedata+offseDataDiod,Pousslong);
+		    offseDataDiod+=Pousslong;
 		}
 	}
Index: /trunk/Poubelle/archTOI.old/toiiter.cc
===================================================================
--- /trunk/Poubelle/archTOI.old/toiiter.cc	(revision 399)
+++ /trunk/Poubelle/archTOI.old/toiiter.cc	(revision 400)
@@ -206,41 +206,42 @@
     if ((*i).triggering) {
       switch ((*i).kind) {
-        case boloTens:
-        case boloRaw:
-          trigMask |= block_bolo_mask;
-          break;
-        case gpsTime:
-        case longitude:
-        case latitude:
-        case altitude:
-          trigMask |= block_gps_mask;
-          break;
-        case azimut:
-          file->needSSTProcessMask(SSTHandler::findPeriod);
-          trigMask |= block_sst_mask;
-          break;
-        case sstStarZ:
-        case sstStarF:
-        case sstStarT:
-          file->needSSTProcessMask(SSTHandler::findStars);
-          trigMask |= block_sst_mask;
-          break;
-        case sstDiode:
-          file->needSSTProcessMask(SSTHandler::permDiode);
-          trigMask |= block_sst_mask;
-          break;
-        case sstChannel:
-          trigMask |= block_sst_mask;
-          break;
-        case gyroRaw:
-          trigMask |= block_gyro_mask;
-          break;
-        case alphaAxis:
-        case deltaAxis:
-        case alphaBolo:
-        case deltaBolo:
-          file->needSSTProcessMask(SSTHandler::findAxis);
-          trigMask |= block_sst_mask;
-          break;
+      case boloTens:
+      case boloRaw:
+	trigMask |= block_bolo_mask;
+	break;
+      case gpsTime:
+      case longitude:
+      case latitude:
+      case altitude:
+	trigMask |= block_gps_mask;
+	break;
+      case azimut:
+	file->needSSTProcessMask(SSTHandler::findPeriod);
+	trigMask |= block_sst_mask;
+	break;
+      case sstStarCnt:
+      case sstStarZ:
+      case sstStarF:
+      case sstStarT:
+	file->needSSTProcessMask(SSTHandler::findStars);
+	trigMask |= block_sst_mask;
+	break;
+      case sstDiode:
+	file->needSSTProcessMask(SSTHandler::permDiode);
+	trigMask |= block_sst_mask;
+	break;
+      case sstChannel:
+	trigMask |= block_sst_mask;
+	break;
+      case gyroRaw:
+	trigMask |= block_gyro_mask;
+	break;
+      case alphaAxis:
+      case deltaAxis:
+      case alphaBolo:
+      case deltaBolo:
+	file->needSSTProcessMask(SSTHandler::findAxis);
+	trigMask |= block_sst_mask;
+	break;
       }
     }
@@ -404,51 +405,52 @@
    int index = infos[column].index;
    switch (kind) {
-     case sampleNum:
-     case internalTime:
-     case mjd:
-       return true;
-     case boloTens:
-       if (imes==0 && file->llastBolo()==NULL) return false;
-       return file->lastBolo() != NULL;
-     case boloRaw:
-       return file->lastBolo() != NULL;
-     case sstDiode:
-     case sstChannel:
-       return file->lastSST() != NULL;
-     case sstStarZ:
-     case sstStarF:
-     case sstStarT:{
-       if (file->lastSST() == NULL) return false;
-       int n = file->getNumbStar(imes);
-       return (n > 0 && imes < n);
-       }
-     case gyroRaw:
-       return (file->lastGyro() != NULL);
-     case gpsTime:
-       return file->hasGPSTime();
-     case longitude:
-     case latitude:
-       return file->hasGPSPos();
-     case altitude:
-       return file->hasGPSAlt();
-     case tsid:
-       return file->hasGPSPos();
-     case azimut:
-     case alphaAxis:
-     case deltaAxis:
-       return false;
-       //return (file->lastGPS() != NULL && file->lastSST() != NULL);
-     case alphaSst:
-     case deltaSst:
-     case alphaBolo:
-     case deltaBolo:
-       return false;
-       
-     case boloTemp:
-       return false;
+   case sampleNum:
+   case internalTime:
+   case mjd:
+     return true;
+   case boloTens:
+     if (imes==0 && file->llastBolo()==NULL) return false;
+     return file->lastBolo() != NULL;
+   case boloRaw:
+     return file->lastBolo() != NULL;
+   case sstDiode:
+   case sstChannel:
+     return file->lastSST() != NULL;
+   case sstStarCnt:
+   case sstStarZ:
+   case sstStarF:
+   case sstStarT:{
+     if (file->lastSST() == NULL) return false;
+     int n = file->getNumbStar(imes);
+     return (n > 0 && index < n);
+   }
+   case gyroRaw:
+     return (file->lastGyro() != NULL);
+   case gpsTime:
+     return file->hasGPSTime();
+   case longitude:
+   case latitude:
+     return file->hasGPSPos();
+   case altitude:
+     return file->hasGPSAlt();
+   case tsid:
+     return file->hasGPSPos();
+   case azimut:
+   case alphaAxis:
+   case deltaAxis:
+     return false;
+     //return (file->lastGPS() != NULL && file->lastSST() != NULL);
+   case alphaSst:
+   case deltaSst:
+   case alphaBolo:
+   case deltaBolo:
+     return false;
+     
+   case boloTemp:
+     return false;
    }
    return false;
 }
- 
+
 double TOIIter::getValue(int column) {
   if (!initDone) Init();
@@ -475,43 +477,45 @@
    int index = infos[column].index;
    switch (kind) {
-     case sampleNum:
-       return getSampleIndex();
-     case internalTime:
-       return getSampleIndex() * archParam.acq.perEch;
-     case mjd:
-       return getMJD();
-     case boloTens:
-       return file->getMuVBolo(index, imes);
-     case boloRaw:
-       return file->getRawBolo(index, imes);
-     case sstDiode:
-       return file->getSSTSignal(index, imes);
-     case sstChannel:
-       return file->getSSTRawSignal(index, imes);
-     case sstStarZ:
-       return file->getSSTStarZ(index, imes);
-     case sstStarF:
-       return file->getSSTStarF(index, imes);
-     case sstStarT:
-       return file->getSSTStarT(index, imes);
-     case gyroRaw:
-       return file->getGyro(index, imes);
-     case gpsTime:
-       return file->getGPSUTC();
-     case longitude:
-       return file->getGPSLong();
-     case latitude:
-       return file->getGPSLat();
-     case altitude:
-       return file->getGPSAlt();
-     case tsid:
-       tSid.setLongitude(file->getGPSLong());
-       return tSid.getLST(getMJD());
-     case azimut:
-       return file->getAzimut(imes);
-     case alphaAxis:
-       return file->getAlpha(imes);
-     case deltaAxis:
-       return file->getDelta(imes);
+   case sampleNum:
+     return getSampleIndex();
+   case internalTime:
+     return getSampleIndex() * archParam.acq.perEch;
+   case mjd:
+     return getMJD();
+   case boloTens:
+     return file->getMuVBolo(index, imes);
+   case boloRaw:
+     return file->getRawBolo(index, imes);
+   case sstDiode:
+     return file->getSSTSignal(index, imes);
+   case sstChannel:
+     return file->getSSTRawSignal(index, imes);
+   case sstStarCnt:
+     return file->getNumbStar(imes);
+   case sstStarZ:
+     return file->getSSTStarZ(index, imes);
+   case sstStarF:
+     return file->getSSTStarF(index, imes);
+   case sstStarT:
+     return file->getSSTStarT(index, imes);
+   case gyroRaw:
+     return file->getGyro(index, imes);
+   case gpsTime:
+     return file->getGPSUTC();
+   case longitude:
+     return file->getGPSLong();
+   case latitude:
+     return file->getGPSLat();
+   case altitude:
+     return file->getGPSAlt();
+   case tsid:
+     tSid.setLongitude(file->getGPSLong());
+     return tSid.getLST(getMJD());
+   case azimut:
+     return file->getAzimut(imes);
+   case alphaAxis:
+     return file->getAlpha(imes);
+   case deltaAxis:
+     return file->getDelta(imes);
    }
    return -1;
@@ -541,4 +545,5 @@
      case sstChannel:
      case sstDiode:
+     case sstStarCnt:
      case sstStarZ:
      case sstStarF:
Index: /trunk/Poubelle/archTOI.old/toiiter.h
===================================================================
--- /trunk/Poubelle/archTOI.old/toiiter.h	(revision 399)
+++ /trunk/Poubelle/archTOI.old/toiiter.h	(revision 400)
@@ -23,4 +23,5 @@
   sstDiode,   // signal brut SST, indice = diode, 0-45
   sstChannel, // signal brut SST, indice = canal, 0-47
+  sstStarCnt, // nombre d'etoiles detectees durant ce sample
   sstStarZ,   // numero de diode d''une eventuelle etoile,   i=etoile 0..n
   sstStarF,   // flux d''une eventuelle etoile,             <0 si moins de i+1 etoiles
