| 1 | #ifndef SCAN_H_SEEN | 
|---|
| 2 | #define SCAN_H_SEEN | 
|---|
| 3 |  | 
|---|
| 4 |  | 
|---|
| 5 | // includes PEIDA | 
|---|
| 6 | #include "ppersist.h" | 
|---|
| 7 | #include <iostream.h> | 
|---|
| 8 | #include "dvlist.h" | 
|---|
| 9 | #include "ndatablock.h" | 
|---|
| 10 |  | 
|---|
| 11 | class FIO_Scan; | 
|---|
| 12 |  | 
|---|
| 13 | //!   Storage and treatment of data for a scanning of a part of the sky with a set of given values for parameters (see constructor) | 
|---|
| 14 |  | 
|---|
| 15 | class Scan :  public AnyDataObj  { | 
|---|
| 16 | friend class FIO_Scan; | 
|---|
| 17 | public  : | 
|---|
| 18 | /* | 
|---|
| 19 | arguments du constructeur : | 
|---|
| 20 | . ouverture (radians), | 
|---|
| 21 | . un tableau de 3 reels (deux angles-en radians- definissant la direction de | 
|---|
| 22 | l'axe de rotation du satellite + vitesse de rotation | 
|---|
| 23 | en radians/s), | 
|---|
| 24 | . frequence d'echantillonnage (Hz), | 
|---|
| 25 | . instant final de prise de donnees (s), | 
|---|
| 26 | deux arguments optionnels : | 
|---|
| 27 | . instant initial pour la prise de donnees | 
|---|
| 28 | . offset d'antenne en angle phi | 
|---|
| 29 | */ | 
|---|
| 30 |  | 
|---|
| 31 | /*! | 
|---|
| 32 | \verbatim | 
|---|
| 33 | * Ouv      = aperture angle (rad) | 
|---|
| 34 | * Omega[3] = direction of rotation axis of the satellite (teta,phi) | 
|---|
| 35 | and rotation velocity (rad/s) | 
|---|
| 36 | * Fech     = sampling frequency  (Hz) | 
|---|
| 37 | * T        = total time of data acquistion (s) | 
|---|
| 38 | * t0       = starting time (s) | 
|---|
| 39 | * phi0     = offset of antenna (rad) | 
|---|
| 40 | \endverbatim | 
|---|
| 41 | */ | 
|---|
| 42 | Scan(float,float*,float,float,float,float); | 
|---|
| 43 | Scan(const Scan&,  bool share=false ); | 
|---|
| 44 | Scan() { | 
|---|
| 45 | InitNull(); | 
|---|
| 46 | } | 
|---|
| 47 | ~Scan(); | 
|---|
| 48 |  | 
|---|
| 49 | // ------------ Persistence handling | 
|---|
| 50 |  | 
|---|
| 51 | //     enum {classId = 0xF003 }; | 
|---|
| 52 | //int_4                  ClassId() const        { return classId; } | 
|---|
| 53 |  | 
|---|
| 54 | //virtual void           WriteSelf(POutPersist&) const; | 
|---|
| 55 | //virtual void           ReadSelf(PInPersist&); | 
|---|
| 56 |  | 
|---|
| 57 | /*!   Return the number of points in the scan */ | 
|---|
| 58 | int_4     NbPoints() const; | 
|---|
| 59 | /*!    Return total nomber of turns */ | 
|---|
| 60 | int_4     NbTours() const; | 
|---|
| 61 | /*!    Return  nomber of points for 1 turn */ | 
|---|
| 62 | int_4     NbPts1Tr() const; | 
|---|
| 63 | /*!    Return index of pixel associated to time t */ | 
|---|
| 64 | int_4     ValueIndex(float) const; | 
|---|
| 65 | /*!    Return  (teta,phi) coordinate of pixel related to time t */ | 
|---|
| 66 | void    Direction(float, float& ,float& ); | 
|---|
| 67 | /*!    Return  (teta,phi) coordinates of  pixel with index k */ | 
|---|
| 68 | void    DirectionIndex(int_4,float& ,float& ); | 
|---|
| 69 | /*!    Return value of pixel with index k */ | 
|---|
| 70 | r_8  & PixelValue(int_4 k) ; | 
|---|
| 71 | /*!    const version of previous method */ | 
|---|
| 72 | r_8 const & PixelValue(int_4 k) const; | 
|---|
| 73 |  | 
|---|
| 74 | /* Surcharge de la parenthese a un indice entier : remplit ou/et renvoie */ | 
|---|
| 75 | /* la valeur du contenu du pixel d'indice k                              */ | 
|---|
| 76 |  | 
|---|
| 77 | inline  r_8&    operator()(int_4 k) | 
|---|
| 78 | { return(PixelValue(k)) ; } ; | 
|---|
| 79 | inline  r_8 const &    operator()(int_4 k) const | 
|---|
| 80 | { return(PixelValue(k)) ; } ; | 
|---|
| 81 | Scan& operator = (const Scan& s); | 
|---|
| 82 | //++ | 
|---|
| 83 | DVList&  Info() | 
|---|
| 84 | // | 
|---|
| 85 | //      Renvoie une reference sur l'objet DVList Associe | 
|---|
| 86 | //-- | 
|---|
| 87 | { | 
|---|
| 88 | if (mInfo_ == NULL)  mInfo_ = new DVList; | 
|---|
| 89 | return(*mInfo_); | 
|---|
| 90 | } | 
|---|
| 91 |  | 
|---|
| 92 | const DVList*  ptrInfo() const | 
|---|
| 93 | { | 
|---|
| 94 | return mInfo_; | 
|---|
| 95 | } | 
|---|
| 96 |  | 
|---|
| 97 |  | 
|---|
| 98 |  | 
|---|
| 99 |  | 
|---|
| 100 |  | 
|---|
| 101 | private : | 
|---|
| 102 |  | 
|---|
| 103 | //void          Clear(); | 
|---|
| 104 | void          InitNull(); | 
|---|
| 105 |  | 
|---|
| 106 | /*  Acces to the DataBlock  */ | 
|---|
| 107 | inline       NDataBlock<r_8>& DataBlock()       {return sPix_;} | 
|---|
| 108 | inline const NDataBlock<r_8>& DataBlock() const {return sPix_;} | 
|---|
| 109 |  | 
|---|
| 110 | inline  void  SetIntParams(int_4 NmaxPts, int_4 NmaxTrs, int_4 NPts1Tr) | 
|---|
| 111 | { | 
|---|
| 112 | NmaxPts_=NmaxPts; | 
|---|
| 113 | NmaxTrs_=NmaxTrs; | 
|---|
| 114 | NPts1Tr_=NPts1Tr; | 
|---|
| 115 | } | 
|---|
| 116 | inline void SetFloatParams(r_4 Ouverture, r_4 OmegaTeta, r_4 OmegaPhi, | 
|---|
| 117 | r_4 OmegaRad, r_4 FrequenceEch, r_4 TempsFinal, | 
|---|
| 118 | r_4 TempsInitial, r_4 PhiZero, r_8* Rota) | 
|---|
| 119 | { | 
|---|
| 120 | Ouverture_    = Ouverture; | 
|---|
| 121 | OmegaTeta_    = OmegaTeta; | 
|---|
| 122 | OmegaPhi_     = OmegaPhi; | 
|---|
| 123 | OmegaRad_     = OmegaRad; | 
|---|
| 124 | FrequenceEch_ = FrequenceEch; | 
|---|
| 125 | TempsFinal_   = TempsFinal; | 
|---|
| 126 | TempsInitial_ = TempsInitial; | 
|---|
| 127 | PhiZero_      = PhiZero; | 
|---|
| 128 | for (int k=0; k<9;k++) Rota_[k]=Rota[k]; | 
|---|
| 129 | } | 
|---|
| 130 |  | 
|---|
| 131 | inline void GetFloatParams(r_4& Ouverture, r_4& OmegaTeta, r_4& OmegaPhi, | 
|---|
| 132 | r_4& OmegaRad, r_4& FrequenceEch, r_4& TempsFinal, | 
|---|
| 133 | r_4& TempsInitial, r_4& PhiZero, r_8* Rota) const | 
|---|
| 134 | { | 
|---|
| 135 | Ouverture    = Ouverture_; | 
|---|
| 136 | OmegaTeta    = OmegaTeta_; | 
|---|
| 137 | OmegaPhi     = OmegaPhi_; | 
|---|
| 138 | OmegaRad     = OmegaRad_; | 
|---|
| 139 | FrequenceEch = FrequenceEch_; | 
|---|
| 140 | TempsFinal   = TempsFinal_; | 
|---|
| 141 | TempsInitial = TempsInitial_; | 
|---|
| 142 | PhiZero      = PhiZero_; | 
|---|
| 143 | for (int k=0; k<9;k++) Rota[k]=Rota_[k]; | 
|---|
| 144 | } | 
|---|
| 145 |  | 
|---|
| 146 |  | 
|---|
| 147 | int_4 NmaxPts_; | 
|---|
| 148 | int_4 NmaxTrs_; | 
|---|
| 149 | int_4 NPts1Tr_; | 
|---|
| 150 | r_4   Ouverture_; | 
|---|
| 151 | r_4   OmegaTeta_;     /* direction de l'axe de rotation du satellite */ | 
|---|
| 152 | r_4   OmegaPhi_;      /* (radians)                                   */ | 
|---|
| 153 | r_4   OmegaRad_;      /* vitesse de rotation du satellite (radians/s) */ | 
|---|
| 154 | r_4   FrequenceEch_;  /* frequence d'echantillonnage (Hz)*/ | 
|---|
| 155 | r_4   TempsFinal_; | 
|---|
| 156 | r_4   TempsInitial_; | 
|---|
| 157 | r_4   PhiZero_;           /* Offset antenne (radians)  */ | 
|---|
| 158 | NDataBlock<r_8>  sPix_;   /* valeurs contenues dans chaque pixel */ | 
|---|
| 159 | //r_8*  sPix_;            /* valeurs contenues dans chaque pixel */ | 
|---|
| 160 | r_8   Rota_[9];       /* matrice de passage : [Xf]=[Rota][Xs] */ | 
|---|
| 161 | /* Xs : coordonnees dans un systeme lie au satellite*/ | 
|---|
| 162 | /* Xf : coordonnees dans un repere "fixe"           */ | 
|---|
| 163 | DVList* mInfo_;        // Infos (variables) attachees | 
|---|
| 164 | }; | 
|---|
| 165 |  | 
|---|
| 166 | // ------------- Classe pour la gestion de persistance -- | 
|---|
| 167 | //!    Delegated objects for persitance management | 
|---|
| 168 |  | 
|---|
| 169 | class FIO_Scan : public PPersist | 
|---|
| 170 | { | 
|---|
| 171 |  | 
|---|
| 172 | public: | 
|---|
| 173 |  | 
|---|
| 174 | FIO_Scan(); | 
|---|
| 175 | FIO_Scan(string const & filename); | 
|---|
| 176 | FIO_Scan(const Scan& obj); | 
|---|
| 177 | FIO_Scan(Scan* obj); | 
|---|
| 178 | virtual ~FIO_Scan(); | 
|---|
| 179 | virtual AnyDataObj* DataObj(); | 
|---|
| 180 | inline operator Scan() {return(*dobj); } | 
|---|
| 181 |  | 
|---|
| 182 | protected : | 
|---|
| 183 |  | 
|---|
| 184 | virtual void ReadSelf(PInPersist&); | 
|---|
| 185 | virtual void WriteSelf(POutPersist&) const; | 
|---|
| 186 | Scan* dobj; | 
|---|
| 187 | bool ownobj; | 
|---|
| 188 | }; | 
|---|
| 189 |  | 
|---|
| 190 |  | 
|---|
| 191 | #endif /* SCAN_H_SEEN */ | 
|---|