OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
AlosPalsarPlatformPositionData.cpp
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // "Copyright Centre National d'Etudes Spatiales"
4 // "Copyright Centre for Remote Imaging, Sensing and Processing"
5 //
6 // License: LGPL
7 //
8 // See LICENSE.txt file in the top level directory for more details.
9 //
10 //----------------------------------------------------------------------------
11 // $Id$
12 
14 
15 namespace ossimplugins
16 {
17 
18 
20 {
21 }
22 
24 {
25 }
26 
28 {
29  os << "orbit_ele_desg:" << data._orbit_ele_desg.c_str() << std::endl;
30 
31  for (int i = 0; i < 6; i++)
32  {
33  os << "orbit_ele[" << i << "]:" << data._orbit_ele[i] << std::endl;
34  }
35 
36  os << "ndata:" << data._ndata << std::endl;
37 
38  os << "year:" << data._year << std::endl;
39 
40  os << "month:" << data._month << std::endl;
41 
42  os << "day:" << data._day << std::endl;
43 
44  os << "gmt_day:" << data._gmt_day << std::endl;
45 
46  os << "gmt_sec:" << data._gmt_sec << std::endl;
47 
48  os << "data_int:" << data._data_int << std::endl;
49 
50  os << "ref_coord:" << data._ref_coord.c_str() << std::endl;
51 
52  os << "hr_angle:" << data._hr_angle << std::endl;
53 
54  os << "alt_poserr:" << data._alt_poserr << std::endl;
55 
56  os << "crt_poserr:" << data._crt_poserr << std::endl;
57 
58  os << "rad_poserr:" << data._rad_poserr << std::endl;
59 
60  os << "alt_velerr:" << data._alt_velerr << std::endl;
61 
62  os << "crt_velerr:" << data._crt_velerr << std::endl;
63 
64  os << "rad_velerr:" << data._rad_velerr << std::endl;
65 
66  for (int i = 0; i < 64; i++)
67  {
68  os << "pos_vect[" << i << "]:" << data._pos_vect[i] << std::endl;
69  }
70 
71  return os;
72 }
73 
75 {
76  char buf[1207];
77  buf[1206] = '\0';
78 
79  is.read(buf, 32);
80  buf[32] = '\0';
81  data._orbit_ele_desg = buf;
82 
83  for (int i = 0; i < 6; i++)
84  {
85  is.read(buf, 16);
86  buf[16] = '\0';
87  data._orbit_ele[i] = atof(buf);
88  }
89 
90  is.read(buf, 4);
91  buf[4] = '\0';
92  data._ndata = atoi(buf);
93 
94  is.read(buf, 4);
95  buf[4] = '\0';
96  data._year = atoi(buf);
97 
98  is.read(buf, 4);
99  buf[4] = '\0';
100  data._month = atoi(buf);
101 
102  is.read(buf, 4);
103  buf[4] = '\0';
104  data._day = atoi(buf);
105 
106  is.read(buf, 4);
107  buf[4] = '\0';
108  data._gmt_day = atoi(buf);
109 
110  is.read(buf, 22);
111  buf[22] = '\0';
112  data._gmt_sec = atof(buf);
113 
114  is.read(buf, 22);
115  buf[22] = '\0';
116  data._data_int = atof(buf);
117 
118  is.read(buf, 64);
119  buf[64] = '\0';
120  data._ref_coord = buf;
121 
122  is.read(buf, 22);
123  buf[22] = '\0';
124  data._hr_angle = atof(buf);
125 
126  is.read(buf, 16);
127  buf[16] = '\0';
128  data._alt_poserr = atof(buf);
129 
130  is.read(buf, 16);
131  buf[16] = '\0';
132  data._crt_poserr = atof(buf);
133 
134  is.read(buf, 16);
135  buf[16] = '\0';
136  data._rad_poserr = atof(buf);
137 
138  is.read(buf, 16);
139  buf[16] = '\0';
140  data._alt_velerr = atof(buf);
141 
142  is.read(buf, 16);
143  buf[16] = '\0';
144  data._crt_velerr = atof(buf);
145 
146  is.read(buf, 16);
147  buf[16] = '\0';
148  data._rad_velerr = atof(buf);
149 
150  for (int i = 0; i < data._ndata; i++)
151  {
152  is >> data._pos_vect[i];
153  }
154 
155  is.seekg(598, std::ios::cur); //skip the rest of the platform position data record
156  is.seekg(8192, std::ios::cur); //skip to the radiometric data record
157  //is.seekg(12495744, std::ios::cur); //skip to the 11th facility-related data record
158 
159  return is;
160 }
161 
163  AlosPalsarRecord(rhs)
164 {
166 
167  for (int i = 0; i < 6; i++)
168  {
169  _orbit_ele[i] = rhs._orbit_ele[i];
170  }
171 
172  _ndata = rhs._ndata;
173 
174  _year = rhs._year;
175 
176  _month = rhs._month;
177 
178  _day = rhs._day;
179 
180  _gmt_day = rhs._gmt_day;
181 
182  _gmt_sec = rhs._gmt_sec;
183 
184  _data_int = rhs._data_int;
185 
186  _ref_coord = rhs._ref_coord;
187 
188  _hr_angle = rhs._hr_angle;
189 
190  _alt_poserr = rhs._alt_poserr;
191 
192  _crt_poserr = rhs._crt_poserr;
193 
194  _rad_poserr = rhs._rad_poserr;
195 
196  _alt_velerr = rhs._alt_velerr;
197 
198  _crt_velerr = rhs._crt_velerr;
199 
200  _rad_velerr = rhs._rad_velerr;
201 
202  for (int i = 0; i < 64; i++)
203  {
204  _pos_vect[i] = rhs._pos_vect[i];
205  }
206 
207 }
208 
210 {
212 
213  for (int i = 0; i < 6; i++)
214  {
215  _orbit_ele[i] = rhs._orbit_ele[i];
216  }
217 
218  _ndata = rhs._ndata;
219 
220  _year = rhs._year;
221 
222  _month = rhs._month;
223 
224  _day = rhs._day;
225 
226  _gmt_day = rhs._gmt_day;
227 
228  _gmt_sec = rhs._gmt_sec;
229 
230  _data_int = rhs._data_int;
231 
232  _ref_coord = rhs._ref_coord;
233 
234  _hr_angle = rhs._hr_angle;
235 
236  _alt_poserr = rhs._alt_poserr;
237 
238  _crt_poserr = rhs._crt_poserr;
239 
240  _rad_poserr = rhs._rad_poserr;
241 
242  _alt_velerr = rhs._alt_velerr;
243 
244  _crt_velerr = rhs._crt_velerr;
245 
246  _rad_velerr = rhs._rad_velerr;
247 
248  for (int i = 0; i < 64; i++)
249  {
250  _pos_vect[i] = rhs._pos_vect[i];
251  }
252 
253  return *this;
254 }
255 }
AlosPalsarPositionVectorRecord _pos_vect[64]
Data point position/velocity.
std::string _orbit_ele_desg
Orbital elements designator.
This class is the base class of all the record classes.
std::ostream & operator<<(std::ostream &os, const AlosPalsarData &data)
This class is able to read a Platform position data record.
AlosPalsarPlatformPositionData & operator=(const AlosPalsarPlatformPositionData &rhs)
Copy operator.
std::istream & operator>>(std::istream &is, AlosPalsarData &data)
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
std::string _ref_coord
Reference coordinate system.
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23