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