Changeset 394 in Sophya for trunk/Poubelle


Ignore:
Timestamp:
Sep 1, 1999, 2:45:54 PM (26 years ago)
Author:
ansari
Message:

Integration detecteur d'etoiles DY

Location:
trunk/Poubelle/archTOI.old
Files:
16 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Poubelle/archTOI.old/archeopsfile.cc

    r393 r394  
    884884}
    885885
     886double ArcheopsFile::getSSTStarT(int istar, int imesure) {
     887  return blockSet->sstHandler.getStarTime(imesure, istar);
     888}
     889
     890double ArcheopsFile::getNumbStar(int imesure) {
     891  return blockSet->sstHandler.getNumbStar(imesure);
     892}
     893
    886894long ArcheopsFile::getGyro(int igyro, int imesure) {   
    887895  if (igyro<0 || igyro>2) return 0;
  • trunk/Poubelle/archTOI.old/archeopsfile.h

    r350 r394  
    138138  double getSSTStarZ(int iStar, int imesure);
    139139  double getSSTStarF(int iStar, int imesure);
     140  double getSSTStarT(int iStar, int imesure);
     141  double getNumbStar(int imesure);
    140142 
    141143  int getGyroBlockNum();
  • trunk/Poubelle/archTOI.old/archtoi.cc

    r358 r394  
    1111#include "toisvr.h"
    1212#include "archtoi.h"
     13#include "archparam.h"
    1314#include "asigps.h"
    1415
     
    7475  else tsttoi(sstStarZ)
    7576  else tsttoi(sstStarF)
     77  else tsttoi(sstStarT)
    7678  else tsttoi(gyroRaw)
    7779  else tsttoi(gpsTime)
     
    155157    double t0;
    156158    sscanf(arg.c_str(), "%lg", &t0);
    157     svr.SetMJD0(t0);
     159    archParam.acq.tBlock0 = t0;
    158160  } else if (key == "#PERECH") {
    159161    double t0;
    160162    sscanf(arg.c_str(), "%lg", &t0);
    161     svr.SetPerEch(t0);
     163    archParam.acq.perEch = t0;
    162164  } else if (key == "#ASIGPS") {
    163165    ASIGPS* gps = new ASIGPS(arg);
  • trunk/Poubelle/archTOI.old/ssthandler.cc

    r393 r394  
    1313#include <math.h>
    1414#include "ssthandler.h"
    15 #include <iostream.h>
     15#include "pisteetoile.h"
    1616
    1717// diodpermut[i] = channel de la diode i
     
    2525
    2626SSTHandler::SSTHandler()
     27:sstchass("SSTChassLogFile")
    2728{
    2829  diodeHistLength = nb_per_block*2+10;
    2930  diodeT = new int[diodeHistLength*nb_photo_diodes];
    3031  starHistLength = 300;
    31   stars = new (vector<star>[starHistLength]);
     32
    3233  lastBlkNum = -1;
    3334 
    3435  //Has2Bars(false);
    3536  prcTodo=0;
    36   seuil=100;
    37 }
    38 
    39 SSTHandler::SSTHandler(SSTHandler const& x)
     37 
     38  pPiste = NULL;
     39  LastBlockSSTNb = -2;
     40  noStarDet = 0;
     41 
     42  findStarConstruct();
     43 
     44}
     45
     46SSTHandler::SSTHandler(SSTHandler const& x)
     47:sstchass("SSTChassLogFile")
    4048{
    4149  diodeHistLength = x.diodeHistLength;
     
    4351  memcpy(diodeT, x.diodeT, diodeHistLength*nb_photo_diodes);
    4452  starHistLength = x.starHistLength;
    45   stars = new (vector<star>[starHistLength]);
    46   for (int i=0; i<starHistLength; i++)
    47     stars[i] = x.stars[i];
     53   
     54  prcTodo    = x.prcTodo;
     55 // has2bars   = x.has2bars;
     56  lastBlkNum = x.lastBlkNum;
     57 
     58  pPiste = NULL;
     59  LastBlockSSTNb = x.LastBlockSSTNb;
     60  noStarDet = x.noStarDet;
     61
     62  findStarConstruct();
     63  for(int i=0; i<NbPhotDiodBarette; i++) {
     64        *PisteBar[i]=*(x.PisteBar[i]);
     65  }
     66}
     67
     68SSTHandler& SSTHandler::operator = (SSTHandler const& x) {
     69  delete[] diodeT;
     70  diodeHistLength = x.diodeHistLength;
     71  diodeT = new int[diodeHistLength*nb_photo_diodes];
     72  memcpy(diodeT, x.diodeT, diodeHistLength*nb_photo_diodes);
    4873   
    4974  prcTodo    = x.prcTodo;
     
    5176 // elecOffset = x.elecOffset;
    5277  lastBlkNum = x.lastBlkNum;
    53   seuil      = x.seuil;
    54 }
    55 
    56 SSTHandler& SSTHandler::operator = (SSTHandler const& x) {
    57   delete[] stars;
    58   delete[] diodeT;
    59   diodeHistLength = x.diodeHistLength;
    60   diodeT = new int[diodeHistLength*nb_photo_diodes];
    61   memcpy(diodeT, x.diodeT, diodeHistLength*nb_photo_diodes);
    62   starHistLength = x.starHistLength;
    63   stars = new (vector<star>[starHistLength]);
    64   for (int i=0; i<starHistLength; i++)
    65     stars[i] = x.stars[i];
    66    
    67   prcTodo    = x.prcTodo;
    68  // has2bars   = x.has2bars;
    69  // elecOffset = x.elecOffset;
    70   lastBlkNum = x.lastBlkNum;
    71   seuil      = x.seuil;
    72  
     78  for(int i=0; i<NbPhotDiodBarette; i++) *PisteBar[i]=*(x.PisteBar[i]);
    7379  return *this;
    7480}
    7581
    76 SSTHandler::~SSTHandler()
    77 {
    78   delete[] stars;
     82SSTHandler::~SSTHandler(){
    7983  delete[] diodeT;
     84  findStarDestruct();
    8085}
    8186
     
    8590  if (prcTodo & findAxis)   prcTodo |= findPeriod;
    8691  if (prcTodo & findPeriod) prcTodo |= findStars;
    87   if (prcTodo & findStars)  prcTodo |= rmveOffset;
     92  if (prcTodo & findStars)  prcTodo |= permDiode;
    8893}
    8994
     
    96101  elecOffset = eo;
    97102}
    98 
    99 void SSTHandler::ProcessBlock(block_type_sst* blk)
    100 {
    101   lastBlkNum = numero_block(blk);
    102   for (int i = 0; i<nb_per_block*2; i++) {
    103     DecodeTMBlock(blk, i, diodeRaw[i]);
    104   }
    105   if (prcTodo & rmveOffset) {
    106     RemoveOffset();
    107   }
    108   if (prcTodo & findStars) {
    109     FindStars();
    110   }
    111 }
    112 
    113103
    114104void SSTHandler::DecodeTMBlock(block_type_sst* blk, int i, int* diod)
     
    139129
    140130
    141 void SSTHandler::RemoveOffset()
     131void SSTHandler::PermutDiode()
    142132{
    143133  int j0 = diodeHistLength-(nb_per_block*2);
     
    187177}
    188178
    189 int SSTHandler::getStarZ(int imesure, int istar) // for last block
    190 {
    191   int j0 = starHistLength-(nb_per_block*2);
    192   if (imesure+j0<0 || imesure>=nb_per_block*2) return -99999;
    193   if (istar < 0 || istar >= stars[imesure+j0].size()) return -99999;
    194   return stars[imesure+j0][istar].z;
    195 }
    196 
    197 int SSTHandler::getStarF(int imesure, int istar) // for last block
    198 {
    199   int j0 = starHistLength-(nb_per_block*2);
    200   if (imesure+j0<0 || imesure>=nb_per_block*2) return -99999;
    201   if (istar < 0 || istar >= stars[imesure+j0].size()) return -99999;
    202   return stars[imesure+j0][istar].m;
    203 }
    204 
    205 
    206 void SSTHandler::FindStars()  // sur les 72 derniers echantillons dans diode.
    207 {
    208   int js0 = starHistLength-(nb_per_block*2);
    209   int jd0 = diodeHistLength-(nb_per_block*2);
    210   // Decalage vers la gauche de la taille d'un bloc
    211   for (int i=0; i<js0; i++) {
    212     stars[i] = stars[i+(nb_per_block*2)];
    213   }
    214  
    215   // Recherche d'etoiles
    216   for (int i=0; i<(nb_per_block*2); i++) {
    217     stars[js0+i].clear();
    218     for (int idiode=0; idiode<46; idiode++) {
    219       if (diode(jd0+i,idiode) < -seuil) {
    220         if (has2bars) {
    221           for (int j=-2; j>=-5; j--) {
    222             if (diode(jd0+i+j,(idiode+elecOffset)%46) < -seuil) {
    223               star s;
    224               s.z = idiode;
    225               s.m = -diode(jd0+i,idiode);
    226               s.t = i; // $CHECK$ need absolute time...
    227               stars[js0+i].push_back(s);
    228               break;
    229             } else if (idiode<45 && diode(jd0+i+j,(idiode+1+elecOffset)%46) > seuil) {
    230               star s;
    231               s.z = idiode+.5;
    232               s.m = -diode(jd0+i,idiode);
    233               s.t = i; // $CHECK$ need absolute time...
    234               stars[js0+i].push_back(s);
    235               break;
    236             }
    237           }
    238         } else {
    239           if (diode(jd0+i,idiode) > diode(jd0+i-1,idiode)) {
    240             star s;
    241             s.z = idiode;
    242             s.m = -diode(jd0+i-1,idiode);
    243             s.t = i; // $CHECK$ need absolute time...
    244             stars[js0+i].push_back(s);
    245           }
    246         }
    247       }
    248     }
    249   }
    250 
    251 
    252 }
     179int SSTHandler::FindStars(block_type_sst* blk) {
     180        NbStarInBlock=0;
     181        LastBlockStarVec.clear();
     182       
     183        int NoFirstSpInBlock=FirstSplNb(blk);
     184        int jd0 = diodeHistLength-NbSampleBlock;
     185
     186        bool FlagLBlockPerdu=false;
     187        int ThisBlockNumb=numero_block(blk);
     188       
     189        if ((LastBlockSSTNb+1)==ThisBlockNumb) LastBlockSSTNb++;
     190        else {
     191                FlagLBlockPerdu=true;
     192                LastBlockSSTNb=ThisBlockNumb;
     193        }
     194
     195//      On cherche les etoiles 
     196        for(int NoDiode=0;NoDiode<NbPhotDiodBarette; NoDiode++) {       
     197                pPiste=PisteBar[NoDiode];
     198               
     199        // Traitons une diode pendant un block
     200                offseDataDiod=0;
     201                for (int i=0; i<NbSampleBlock; i++) Diodedata[i]=diode(jd0+i,NoDiode);
     202
     203                if (FlagLBlockPerdu)  {
     204                        pPiste->fill(Diodedata+offseDataDiod,FirstSplNb(blk));
     205                        offseDataDiod+=PhDiodTabLong;
     206                }
     207                else {
     208                        pPiste->push(Diodedata);
     209                        offseDataDiod+=Pousslong;
     210                }
     211               
     212        // Recherchons les etoiles
     213                while (true) {
     214                        if (pPiste->traque()) {                         // On a trouve!
     215                                LastStar=pPiste->DonneEtoile();
     216/*                              double dum= LastStar.TEchan;
     217                                pair<const double, SSTEtoile> unepaire=make_pair(dum,LastStar);
     218                                StarHistoryMap.insert(unepaire);       
     219*/
     220                                StarHistoryMap[LastStar.TEchan]=LastStar;
     221                                        //On empile sur la map.
     222                                NbStarInBlock++;
     223#ifdef SST_DEBUG                       
     224                        // On écrit les pistes ayant déclénchées
     225                                int NoDiodeEvt=LastStar.NoDiode;
     226                                if(pPisteDump[NoDiodeEvt]->is_open())   
     227                                        for(int noSamp=0; noSamp<NbSampleBlock;noSamp++)
     228                                                (*pPisteDump[NoDiodeEvt])<<noStarDet<<'\t'<<NoDiode<<'\t'<<NoFirstSpInBlock+noSamp<<'\t'<<Diodedata[noSamp]<<endl;
     229#endif
     230                                noStarDet++;
     231                        }
     232                // Est-on en bout de Piste?
     233                        if(offseDataDiod+Pousslong>=NbSampleBlock) break;
     234                        else {
     235                                pPiste->push(Diodedata+offseDataDiod);
     236                                offseDataDiod+=Pousslong;
     237                        }
     238                }
     239        }
     240       
     241//      On ne garde que les NbEtInSetMax dernières étoiles
     242        int nbEtoileInMap=StarHistoryMap.size();
     243        if(nbEtoileInMap>NbEtInMapMax) {
     244                int nbErase=nbEtoileInMap-NbEtInMapMax;
     245                StarHistIter StarIter=StarHistoryMap.begin();
     246                for(int i=0;i<nbErase;i++){
     247                        StarHistoryMap.erase(StarIter);
     248                        StarIter++;
     249                }
     250                nbEtoileInMap-=nbErase;
     251        }                       
     252       
     253//      On stocke les etoiles du block dans LastBlockStarVec
     254        map<double,SSTEtoile>::reverse_iterator StarHistReIter= StarHistoryMap.rbegin() ;
     255        for(int i=0; i<NbStarInBlock; i++, StarHistReIter++)
     256                LastBlockStarVec.push_back((*StarHistReIter).second);
     257       
     258//#ifdef SST_DEBUG
     259        if(NbStarInBlock>0) {
     260                       
     261        // On écrit les étoiles detectées
     262                vector<SSTEtoile>::reverse_iterator StarVecRevIter;
     263                StarVecRevIter=LastBlockStarVec.rbegin();
     264                for(int i=0; i<NbStarInBlock;i++,StarVecRevIter++)
     265                        (*StarVecRevIter).print(sstchass);
     266        }
     267               
     268//#endif
     269
     270        return NbStarInBlock;
     271}
     272
     273void SSTHandler::findStarConstruct() {
     274        PisteBar=new PisteEtoile*[NbPhotDiodBarette];
     275        for(int i=0; i<NbPhotDiodBarette; i++) PisteBar[i]=new PisteEtoile(i);
     276        StarHistoryMap.clear();
     277        sstchass<<LastStar.printHeader()<<endl;
     278       
     279#ifdef SST_DEBUG       
     280        char s[32];
     281        string fileName;
     282//      if(pPisteDump==NULL)
     283                pPisteDump= new ofstream* [NbChanDump];
     284       
     285        for (int pistNumb=0; pistNumb<NbChanDump; pistNumb++) {
     286                sprintf(s,"%i", pistNumb);     
     287                string piste=s;
     288                fileName="pisteno"+piste+"dump";
     289/*             
     290                if ((*pPisteDump[pistNumb]).is_open()) {
     291                        cerr<<"Erreur: le fichier "<<fileName<<" devrait être libre"<<endl;
     292                                //On libère
     293                        (*pPisteDump[pistNumb]).close();
     294                        delete pPisteDump[pistNumb];
     295                }
     296*/                     
     297                pPisteDump[pistNumb]=new ofstream(fileName.c_str(),ios::out|ios::trunc);
     298               
     299                if(!(*pPisteDump[pistNumb]).is_open()) {
     300                        cerr<<"Warning Echec à l'ouverture du fichier: "<<fileName<<endl;
     301                }
     302        }
     303#endif
     304        return;
     305}
     306
     307void SSTHandler::findStarDestruct() {
     308        for(int i=0; i<NbPhotDiodBarette; i++) {
     309                delete PisteBar[i];
     310        }
     311        delete[] PisteBar;
     312               
     313#ifdef SST_DEBUG       
     314        for (int pistNumb=0; pistNumb<NbChanDump; pistNumb++) {
     315                pPisteDump[pistNumb]->close();
     316                delete pPisteDump[pistNumb];
     317        }
     318        delete  pPisteDump;
     319#endif
     320
     321        return;
     322}
     323
     324int SSTHandler::getNumbStar(int iSampl) {
     325        StarHistIter IterLow=StarHistoryMap.lower_bound((double)iSampl);
     326        StarHistIter IterHigh=StarHistoryMap.upper_bound((double)(iSampl+1.));
     327        int Compteur=0;
     328        while (!(IterLow==IterHigh)) {IterLow++; Compteur++;}
     329        return Compteur;
     330}
     331
     332double SSTHandler::getStarF(int iSampl, int istar){
     333        if( (getNumbStar(iSampl)==0)||(getNumbStar(iSampl)<istar)) return -1;
     334        else {
     335                StarHistIter IterLow=StarHistoryMap.lower_bound((double)iSampl);
     336                while(!(istar==0)) {
     337                        IterLow++;
     338                        istar--;
     339                }
     340        return (double) ((*IterLow).second).InpCurrent;
     341        }
     342}
     343
     344
     345int SSTHandler::getStarZ(int iSampl, int istar) {
     346        if( (getNumbStar(iSampl)==0)||(getNumbStar(iSampl)<istar)) return -1;
     347        StarHistIter IterLow=StarHistoryMap.lower_bound((double)iSampl);
     348        while(!(istar==0)) {
     349                IterLow++;
     350                istar--;
     351        }
     352        return ((*IterLow).second).NoDiode;
     353}
     354
     355double SSTHandler::getStarTime(int iSampl, int istar) {
     356        if( (getNumbStar(iSampl)==0)||(getNumbStar(iSampl)<istar)) return -1;
     357        StarHistIter IterLow=StarHistoryMap.lower_bound((double)iSampl);
     358        while(!(istar==0)) {
     359                IterLow++;
     360                istar--;
     361        }
     362        return ((*IterLow).second).TEchan;
     363}
     364
     365int SSTHandler::FirstSplNb(block_type_sst* blk){
     366        return NbSampleBlock*numero_block(blk); // BUGG A verifier
     367}
     368
     369
     370void SSTHandler::ProcessBlock(block_type_sst* blk)
     371{
     372  lastBlkNum = numero_block(blk);
     373  for (int i = 0; i<nb_per_block*2; i++) {
     374    DecodeTMBlock(blk, i, diodeRaw[i]);
     375  }
     376  if (prcTodo & permDiode) {
     377    PermutDiode();
     378  }
     379  if (prcTodo & findStars) {
     380    FindStars(blk);
     381  }
     382}
     383
  • trunk/Poubelle/archTOI.old/ssthandler.h

    r350 r394  
    55#define SSTHANDLER_H
    66
     7#include <math.h>
    78#include <vector>
     9#include <map>
    810
    911#ifndef nb_max_bolo
     
    1517#endif
    1618
     19class ArcheopsFile;
     20
     21// Zone findStar
     22#include "sstetoile.h"
     23#include "pisteetoile.h"
     24
     25//#define SST_DEBUG
     26#define NbChanDump (10)
     27#define NbPhotDiodBarette (46)
     28#define NbEtInMapMax    (100)
     29#define SSTChassLog (true)
     30#define NbSampleBlock (2*nb_per_block)
     31// Fin Zone findStar
    1732
    1833class SSTHandler {
     
    2338  virtual ~SSTHandler();
    2439 
    25   enum process { rmveOffset = 1,
     40  enum process { permDiode = 1,
    2641         findStars  = 2,
    2742         findPeriod = 4,
     
    3348  static void Has2Bars(bool, int elecOffset=0); // elecOffset : which wired together
    3449 
     50  long getLastBlkNum() {return lastBlkNum;}
    3551  int  getRawSignal(int imesure, int idiode); // for last block
    3652  int  getSignal(int imesure, int idiode);    // for last block, imesure<0 -> history
    37   int  getStarZ(int imesure, int istar);      // for last block, imesure<0 -> history
    38   int  getStarF(int imesure, int istar);      // for last block, imesure<0 -> history
    39   long getLastBlkNum() {return lastBlkNum;}
     53       
     54        //      Zone findStar
     55  int  getNumbStar(int iSampl);
     56                        // return number of star found in sample number iSampl 
     57  int  getStarZ(int iSampl, int istar);
     58                        // return diode number of the star     
     59  double getStarF(int iSampl, int istar); 
     60                        // return star flux in Ampère
     61  double getStarTime(int iSampl, int istar);
     62                        // return star time in this sample
    4063
    4164protected:
     
    4669  int   starHistLength;
    4770  long  lastBlkNum;
    48   int   seuil;
    4971 
     72        // Is there two photoDiod Arrays and how are they connected?
    5073  static bool  has2bars;
    5174  static int   elecOffset;
     
    5376  inline int& diode(int iSamp, int iDiod) {return diodeT[iSamp*nb_photo_diodes+iDiod];}
    5477 
    55   struct star {
    56     float z;
    57     float m;
    58     double t;
    59   };
    60 
    61   vector<star>* stars;
    62  
     78  static int  diodpermut[46]; // diodpermut[i] = channel de la diode i
    6379 
    6480  void DecodeTMBlock(block_type_sst*, int i, int* diodes); // mesure i -> diodes
    65   void RemoveOffset(); // diodeRaw -> diode, avec decalage, 1 echantillon.
    66   void FindStars(); // sur les 72 derniers echantillons dans diode.
     81  void PermutDiode(); // diodeRaw -> diode, avec decalage, 1 echantillon.
     82  int FindStars(block_type_sst* blk);           // sur les 72 derniers echantillons dans diode.
     83                                                // return nmber of star found in last block
    6784 
    68   static int  diodpermut[46]; // diodpermut[i] = channel de la diode i
     85        //      Zone findStar
     86  int NbStarInBlock;
     87
     88  PisteEtoile** PisteBar;
     89       
     90#ifdef SST_DEBUG
     91        ofstream** pPisteDump;
     92#endif
     93
     94  map<double,SSTEtoile> StarHistoryMap;
     95                // On stocke les etoiles de manière ordonnée en temps
     96  typedef  map<double,SSTEtoile>::iterator StarHistIter;
     97  typedef  map<double,SSTEtoile>::const_iterator StarConstHistIter;
     98 
     99  vector<SSTEtoile> LastBlockStarVec;   
     100                // Vecteur des SSTEtoile du block classees en ordre de temps decroissant.
     101  //vector<SSTEtoile> reverse_iterator StarVecRevIter LastBlockStarVec.rbegin();
     102  SSTEtoile LastStar;
     103  PisteEtoile* pPiste;          // Piste courante d'analyse
     104  int Diodedata[NbSampleBlock];
     105  int offseDataDiod;
     106  int LastBlockSSTNb; // Gère la disparition des blocs défectueux
     107  int noStarDet;
     108  int FirstSplNb(block_type_sst* blk); // Calcule l'index du premier echantillon du block analysé
     109  ofstream sstchass;
     110 
     111  void findStarConstruct();
     112  void findStarDestruct();
    69113};
    70114
  • trunk/Poubelle/archTOI.old/toiiter.cc

    r393 r394  
    55#include "toiiter.h"
    66#include "toiinterpolator.h"
     7#include "archparam.h"
    78#include <dirent.h>
    89#include <iostream.h>
     
    2728 tEnd   = 9.e99;
    2829 
    29  tBlock0 = -1;
    30  perEch = -1;
     30 //tBlock0 = -1;
     31 // perEch = -1;
    3132 // Values for Trapani 99 = default values
    32  tBlock0 = 1376.8358818;
    33  perEch = 0.005836818076;
     33 //tBlock0 = 1376.8358818;
     34 //perEch = 0.005836818076;
    3435 
    3536 trigMask = 0;
     
    5354  tStart = x.tStart;
    5455  tEnd = x.tEnd;
    55   tBlock0 = x.tBlock0;
    56   perEch = x.perEch;
     56  //tBlock0 = x.tBlock0;
     57  //perEch = x.perEch;
    5758  trigMask = x.trigMask;
    5859  infos = x.infos;   
     
    180181  // peu plus de details sur la facon dont le GPS est lu.
    181182 
    182   if (tBlock0 < 0) {
    183     tBlock0 = file->getStartMJD();
     183  if (archParam.acq.tBlock0 < 0) {
     184    archParam.acq.tBlock0 = file->getStartMJD();
    184185
    185186    file->pushMark();
     
    187188      // le temps du bloc courant, en secondes
    188189      double dt = file->blockNum() * file->perBlock();
    189       tBlock0 = file->getGPSMJD() - dt/86400.;
     190      archParam.acq.tBlock0 = file->getGPSMJD() - dt/86400.;
    190191    } else { // pas de bloc GPS...
    191       tBlock0 = file->getStartMJD();
     192      archParam.acq.tBlock0 = file->getStartMJD();
    192193    }
    193194    file->popMark();
     
    195196  tStart = oldTStart;  // on restaure
    196197 
    197   if (perEch < 0)
    198     perEch = file->perEchant();
     198  if (archParam.acq.perEch < 0)
     199    archParam.acq.perEch = file->perEchant();
    199200
    200201  bool hasInterp = false;
     
    221222        case sstStarZ:
    222223        case sstStarF:
     224        case sstStarT:
    223225          file->needSSTProcessMask(SSTHandler::findStars);
    224226          trigMask |= block_sst_mask;
    225227          break;
    226228        case sstDiode:
    227           file->needSSTProcessMask(SSTHandler::rmveOffset);
     229          file->needSSTProcessMask(SSTHandler::permDiode);
    228230          trigMask |= block_sst_mask;
    229231          break;
     
    284286  for (set<string>::iterator i = copy.begin(); i != copy.end(); i++) {
    285287    double smp = file1stSamp[*i];
    286     double t   = tBlock0 + smp * perEch/86400.;
     288    double t   = archParam.acq.tBlock0 + smp * archParam.acq.perEch/86400.;
    287289    if (t>tEnd) {  // premier echantillon apres tEnd
    288290     files.erase(*i);
     
    416418     case sstStarZ:
    417419     case sstStarF:
    418        return (file->lastSST() != NULL) && (file->getSSTStarZ(index, imes) >= 0);
     420     case sstStarT:{
     421       if (file->lastSST() == NULL) return false;
     422       int n = file->getNumbStar(imes);
     423       return (n > 0 && imes < n);
     424       }
    419425     case gyroRaw:
    420426       return (file->lastGyro() != NULL);
     
    472478       return getSampleIndex();
    473479     case internalTime:
    474        return getSampleIndex() * perEch;
     480       return getSampleIndex() * archParam.acq.perEch;
    475481     case mjd:
    476482       return getMJD();
     
    487493     case sstStarF:
    488494       return file->getSSTStarF(index, imes);
     495     case sstStarT:
     496       return file->getSSTStarT(index, imes);
    489497     case gyroRaw:
    490498       return file->getGyro(index, imes);
     
    535543     case sstStarZ:
    536544     case sstStarF:
     545     case sstStarT:
    537546       return file->blockNum() == file->getSSTBlockNum();
    538547     case gyroRaw:
     
    616625  if (!initDone) Init();
    617626  int sample = getSampleIndex();
    618   return tBlock0 + sample*perEch/86400.;
     627  return archParam.acq.tBlock0 + sample*archParam.acq.perEch/86400.;
    619628}
    620629 
  • trunk/Poubelle/archTOI.old/toiiter.h

    r393 r394  
    2525  sstStarZ,   // numero de diode d''une eventuelle etoile,   i=etoile 0..n
    2626  sstStarF,   // flux d''une eventuelle etoile,             <0 si moins de i+1 etoiles
     27  sstStarT,   // temps d''une eventuelle etoile,            <0 si moins de i+1 etoiles
    2728  gyroRaw,    // valeur brute du gyro, index = 0,1,2
    2829  gpsTime,    // temps fourni par GPS
     
    101102   double tStart, tEnd;
    102103   
    103    double tBlock0;  // MJD du bloc numero zero...
    104    double perEch;   // periode d''echantillonage en secondes
     104   //double tBlock0;  // MJD du bloc numero zero...
     105   //double perEch;   // periode d''echantillonage en secondes
    105106   
    106107   struct info {
  • trunk/Poubelle/archTOI.old/toisvr.cc

    r393 r394  
    2121}
    2222
    23 
    24 void TOISvr::SetMJD0(double t0) {
    25   iter.tBlock0 = t0;
    26 }
    27 
    28 void TOISvr::SetPerEch(double t0) { // en secondes, periode d'echantillonnage
    29   iter.perEch = t0;
    30 }
    3123
    3224void TOISvr::OnBoardRecorderFiles(bool x) {
  • trunk/Poubelle/archTOI.old/toisvr.h

    r358 r394  
    1717  void AddFile(string);
    1818  void OnBoardRecorderFiles(bool);
    19   void SetMJD0(double);
    20   void SetPerEch(double);
    2119  void UseAuxGPS(AuxGPS* gps);
    2220 
Note: See TracChangeset for help on using the changeset viewer.