source: Sophya/trunk/SophyaLib/Samba/scan.h@ 3809

Last change on this file since 3809 was 2322, checked in by cmv, 23 years ago
  • passage xxstream.h en xxstream
  • compile avec gcc_3.2, gcc_2.96 et cxx En 3.2 le seek from ::end semble marcher (voir Eval/COS/pbseekios.cc)

rz+cmv 11/2/2003

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