| 1 | #ifndef  BRANAPARAM 
 | 
|---|
| 2 | #define  BRANAPARAM
 | 
|---|
| 3 | 
 | 
|---|
| 4 | //--------------------------------------------------------------
 | 
|---|
| 5 | // Projet BAORadio - (C) LAL/IRFU  2008-2010
 | 
|---|
| 6 | // Classe de gestion des parametres programmes d'analyse 
 | 
|---|
| 7 | //--------------------------------------------------------------
 | 
|---|
| 8 | 
 | 
|---|
| 9 | #include "machdefs.h"
 | 
|---|
| 10 | 
 | 
|---|
| 11 | #include <string>
 | 
|---|
| 12 | #include <vector>
 | 
|---|
| 13 | #include <iostream>
 | 
|---|
| 14 | 
 | 
|---|
| 15 | #include "timestamp.h"
 | 
|---|
| 16 | 
 | 
|---|
| 17 | class BRAnaParam {  
 | 
|---|
| 18 | public:
 | 
|---|
| 19 |   BRAnaParam(uint_4 nmean=1000, uint_4 nzon=4, uint_4 npaqz=128);
 | 
|---|
| 20 |   int DecodeArgs(int narg, char* arg[]);
 | 
|---|
| 21 |   int Usage(bool fgshort);
 | 
|---|
| 22 | 
 | 
|---|
| 23 |   int PaqSizeFromFits();
 | 
|---|
| 24 | 
 | 
|---|
| 25 |   uint_8 TotalNPaquets() { return ((imax_-imin_+1)*npaqinfile_/istep_); }
 | 
|---|
| 26 | 
 | 
|---|
| 27 |   ostream& Print(ostream& os);
 | 
|---|
| 28 | 
 | 
|---|
| 29 |   static int DecodeMiniFitsHeader(const char* filename, uint_4& paqsz, uint_4& npaq, 
 | 
|---|
| 30 |                                   bool& fgdatafft, bool& fgsinglechannel, SOPHYA::TimeStamp& tmstart);
 | 
|---|
| 31 | 
 | 
|---|
| 32 |   vector<string> dirlist_;
 | 
|---|
| 33 |   string action_;
 | 
|---|
| 34 |   string outpath_;
 | 
|---|
| 35 |   bool fgfitsout_;   // true -> force fichier sortie format FITS (defaut PPF)
 | 
|---|
| 36 |   uint_4 nmean_;
 | 
|---|
| 37 |   uint_4 nbloc_;
 | 
|---|
| 38 |   uint_4 imin_, imax_, istep_;
 | 
|---|
| 39 |   bool rdsamefc_;    // read paquets with same frame counter 
 | 
|---|
| 40 |   uint_4 freqmin_, freqmax_, nbinfreq_;
 | 
|---|
| 41 |   uint_4 paqsize_; 
 | 
|---|
| 42 |   uint_4 nzones_, npaqinzone_;
 | 
|---|
| 43 |   uint_4 npaqinfile_;    // nombre de paquets dans un fichier p
 | 
|---|
| 44 |   bool fgdatafft_;  // true -> donnee FFT (provenant du firmware FFT)
 | 
|---|
| 45 |   bool fgforceraworfft_; // true force par la ligne de commande fgdatafft_ true or false 
 | 
|---|
| 46 |   bool fgsinglechannel_; // true -> un seul canal par fibre (par defaut=2 canaux/fibres)
 | 
|---|
| 47 |   bool fgforcesingleortwochan_; // true force par la ligne de commande
 | 
|---|
| 48 |   int prtlevel_;
 | 
|---|
| 49 |   long int prtmodulo_; 
 | 
|---|
| 50 | 
 | 
|---|
| 51 |   uint_4 nbcalgrp_;    // Nb d'objets/threads dans BRVisCalcGroup 
 | 
|---|
| 52 |   uint_4 nthreads_;  // Nb de threads pour l'execution parallele ds BRVisibilityCalculator
 | 
|---|
| 53 | 
 | 
|---|
| 54 |   uint_4 spec_win_sz_;   // taille de fenetre (temps/no de paquet) pour les spectres
 | 
|---|
| 55 |   uint_4 spw_ext_sz_;     // zone de garde en temps / no de paquet pour la fenetre des spectres
 | 
|---|
| 56 |   uint_4 nbmax_specwfiles_;  // nb maxi de fichiers de fenetres de spectres sauvees 
 | 
|---|
| 57 | 
 | 
|---|
| 58 |   double vmin_,vmax_;   // coupure min-max sur la variance 
 | 
|---|
| 59 |   int nbands_,bandfirst_,bandlast_; //bandes en frequences pour mean, variance et cut
 | 
|---|
| 60 |   bool fgdtpaq_; //if true fill per per paquet datatable
 | 
|---|
| 61 |   bool fgdtms_; //if true fill time avergared/filtered spectral power  datatable
 | 
|---|
| 62 | 
 | 
|---|
| 63 |   bool fgfreqfilter_; // if true force median filtering on the frequencies
 | 
|---|
| 64 |   uint_4 medhalfwidth_; //half freq window for filtering
 | 
|---|
| 65 | 
 | 
|---|
| 66 |   string gainfile_;     // nom du fichier de gain (reponse spectrale)
 | 
|---|
| 67 | 
 | 
|---|
| 68 |   // Remplissage DataTable power = f(time) 
 | 
|---|
| 69 |   
 | 
|---|
| 70 |   // definition fenetre en temps pour le traitement des paquets 
 | 
|---|
| 71 |   SOPHYA::TimeStamp proctimestart_; //  temps de debut de la fenetre
 | 
|---|
| 72 |   SOPHYA::TimeStamp proctimeend_; //  temps de debut de la fenetre
 | 
|---|
| 73 |   double proctimeduration_;  // duree en secondes de la fenetre 
 | 
|---|
| 74 |   bool fgtimeselect_;  // vrai -> selection des paquets dans la fenetre en temps  
 | 
|---|
| 75 | };
 | 
|---|
| 76 | 
 | 
|---|
| 77 | #endif
 | 
|---|