[3683] | 1 | #ifndef BRPROC_H_SEEN
|
---|
| 2 | #define BRPROC_H_SEEN
|
---|
[3635] | 3 |
|
---|
| 4 | //----------------------------------------------------------------
|
---|
[3683] | 5 | // Projet BAORadio - (C) LAL/IRFU 2008-2010
|
---|
| 6 | // Classes de threads de traitememt donnees BAORadio
|
---|
[3635] | 7 | //----------------------------------------------------------------
|
---|
| 8 |
|
---|
| 9 |
|
---|
| 10 | #include <string>
|
---|
| 11 | #include <vector>
|
---|
| 12 | #include <iostream>
|
---|
[3683] | 13 |
|
---|
| 14 | #include "racqumem.h"
|
---|
| 15 | #include "brbaseproc.h"
|
---|
[3635] | 16 | #include "sopnamsp.h"
|
---|
[3683] | 17 | #include "tvector.h"
|
---|
| 18 | #include "ntuple.h"
|
---|
| 19 | #include "datatable.h"
|
---|
[3635] | 20 |
|
---|
| 21 | using namespace std;
|
---|
| 22 |
|
---|
| 23 |
|
---|
| 24 | //---------------------------------------------------------------------
|
---|
[3683] | 25 | // Classe de traitement - calcul de visibilite pour n fibres
|
---|
[3635] | 26 | //---------------------------------------------------------------------
|
---|
[3683] | 27 | class BRVisibilityCalculator : public BRBaseProcessor {
|
---|
| 28 | public:
|
---|
| 29 | BRVisibilityCalculator(RAcqMemZoneMgr& memgr, string outpath, uint_4 nmean=1000,
|
---|
| 30 | uint_4 freq1=0, uint_4 freq2=0, uint_4 nbfreq=1);
|
---|
| 31 | virtual ~BRVisibilityCalculator(); // Fait le nettoyage final , sauvegarde des objets ...
|
---|
[3652] | 32 |
|
---|
[3683] | 33 | virtual int Process();
|
---|
[3692] | 34 | virtual int FillVisibTable(double fcm, double ttm);
|
---|
| 35 |
|
---|
[3683] | 36 | protected:
|
---|
| 37 | uint_4 nmean_; // Nombre de spectres pour le calcul des moyennes
|
---|
| 38 | string outpath_; // directory pour fichiers de sortie
|
---|
| 39 | uint_4 numfreq1_,numfreq2_,nbinfreq_;
|
---|
[3692] | 40 | uint_4 jf1_,jf2_,djf_;
|
---|
[3689] | 41 |
|
---|
[3694] | 42 | vector<TwoByteComplex*> vpdata_;
|
---|
| 43 |
|
---|
[3692] | 44 | double moyfc_, moytt_;
|
---|
| 45 | TMatrix< complex<r_4> > vismtx_;
|
---|
| 46 | TVector< uint_4 > chanum_;
|
---|
| 47 | // FitsInOutFile dtfos_;
|
---|
| 48 | DataTable visdt_;
|
---|
| 49 |
|
---|
[3694] | 50 | uint_4 numfile_;
|
---|
[3686] | 51 | uint_4 totnbpaq_;
|
---|
[3692] | 52 | double* xnt_;
|
---|
[3683] | 53 | };
|
---|
| 54 |
|
---|
| 55 |
|
---|
| 56 | //-------------------------------------------------------------------------
|
---|
| 57 | // **** OBSOLETE : BRProcA2C et BRProcB4C
|
---|
| 58 | // Anciennes classes de traitement (Avant Nov2009) utilises par mcrd.cc
|
---|
| 59 | //-------------------------------------------------------------------------
|
---|
| 60 | //---------------------------------------------------------------------
|
---|
| 61 | // Classe thread de traitement avec 2 voies par frame (donnees raw/FFT
|
---|
| 62 | //---------------------------------------------------------------------
|
---|
| 63 |
|
---|
[3652] | 64 | /*-- Arguments du constructeur :
|
---|
| 65 | o mem : gestionnaire zones memoires avec contenant les "frames" avec 2 voies/frame
|
---|
| 66 | o path : Chemin et nom des fichiers PPF produits (on ajoute _numero.ppf )
|
---|
| 67 | o nmean : Nombre de frame (paquets) moyennes
|
---|
| 68 | o nmax : Nombre maxi de frames traites
|
---|
| 69 | o fghist = true -> fait aussi l'histo des valeurs des echantillons temps
|
---|
[3656] | 70 | o nfsmap>0 : fabrication de cartes (image 2D) des spectres,
|
---|
| 71 | avec nfsmap=nombre de frequences sommes
|
---|
[3652] | 72 | o fgnotrl = true -> fichiers fits / paquets sans trailer
|
---|
| 73 | o card : numero de carte , juste pour les impressions
|
---|
| 74 | */
|
---|
[3683] | 75 | class BRProcA2C : public ZThread {
|
---|
[3635] | 76 | public:
|
---|
[3683] | 77 | BRProcA2C(RAcqMemZoneMgr& mem, string& path, bool fgraw,
|
---|
| 78 | uint_4 nmean=10, uint_4 nmax=100, bool fgtshist=false,
|
---|
| 79 | uint_4 nfsmap=0, bool fgnotrl=false, int card=1);
|
---|
[3635] | 80 | virtual void run();
|
---|
| 81 | void Stop();
|
---|
| 82 | inline void STOP() { stop_ = true; }
|
---|
| 83 | protected:
|
---|
| 84 | RAcqMemZoneMgr& memgr;
|
---|
| 85 | bool stop_;
|
---|
[3683] | 86 | bool fgraw_; // true -> raw data
|
---|
[3635] | 87 | uint_4 nmax_; // Nombre maxi de blocs MemZone traites
|
---|
[3656] | 88 | uint_4 nmean_; // Nombre de spectres pour le calcul des moyennes
|
---|
| 89 | uint_4 nfsmap_; // Binning en frequence pour les cartes 2D temps-freq
|
---|
[3635] | 90 | string path_;
|
---|
[3652] | 91 | bool fghist_; // if true, fill and save histogram with time sample values
|
---|
[3640] | 92 | bool fgnotrl_; // if true, don't check packet trailer - when using pre-june fits files
|
---|
[3645] | 93 | int card_; // Numeros de voies 2*card_-1, 2*card_
|
---|
[3635] | 94 | };
|
---|
| 95 |
|
---|
[3645] | 96 | //---------------------------------------------------------------------
|
---|
[3683] | 97 | // Classe thread de traitement 2 x 2 voies/paquet (Apres BRProcA2C)
|
---|
[3645] | 98 | //---------------------------------------------------------------------
|
---|
[3652] | 99 | /*-- Arguments du constructeur :
|
---|
| 100 | o mem1,mem2 : gestionnairea zones memoires avec contenant les donnees des 4 voies (2 voies/frame)
|
---|
| 101 | o path : Chemin et nom des fichiers PPF produits (on ajoute _numero.ppf )
|
---|
| 102 | o nmean : Nombre de frame (paquets) moyennes
|
---|
| 103 | o nmax : Nombre maxi de frames traites
|
---|
| 104 | o fgnotrl = true -> fichiers fits / paquets sans trailer
|
---|
| 105 | o card : numero de carte , juste pour les impressions
|
---|
| 106 | */
|
---|
| 107 |
|
---|
[3683] | 108 | class BRProcB4C : public ZThread {
|
---|
[3645] | 109 | public:
|
---|
[3683] | 110 | BRProcB4C(RAcqMemZoneMgr& mem1, RAcqMemZoneMgr& mem2, string& path,
|
---|
| 111 | bool fgraw, uint_4 nmean=10, uint_4 nmax=100, bool fgnotrl=false);
|
---|
[3645] | 112 | virtual void run();
|
---|
| 113 | void Stop();
|
---|
| 114 | inline void STOP() { stop_ = true; }
|
---|
| 115 | protected:
|
---|
| 116 | RAcqMemZoneMgr& memgr1;
|
---|
| 117 | RAcqMemZoneMgr& memgr2;
|
---|
| 118 | bool stop_;
|
---|
[3683] | 119 | bool fgraw_; // true -> raw data
|
---|
[3645] | 120 | uint_4 nmax_; // Nombre maxi de blocs MemZone traites
|
---|
| 121 | uint_4 nmean_; // Nombre de blocs pour le calcul des moyennes
|
---|
| 122 | string path_;
|
---|
| 123 | bool fgnotrl_; // if true, don't check packet trailer - when using pre-june fits files
|
---|
| 124 | };
|
---|
[3635] | 125 |
|
---|
[3645] | 126 |
|
---|
| 127 |
|
---|
[3635] | 128 | #endif
|
---|