OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
GeolocationGrid.cpp
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // "Copyright Centre National d'Etudes Spatiales"
4 //
5 // License: LGPL
6 //
7 // See LICENSE.txt file in the top level directory for more details.
8 //
9 //----------------------------------------------------------------------------
10 // $Id$
11 
13 
14 namespace ossimplugins
15 {
17  {
18  }
19 
21  {
22  }
23 
24 
26  {
27  os<<"first_zero_doppler_time_day:"<<data._first_zero_doppler_time_day<<std::endl;
28 
29  os<<"first_zero_doppler_time_sec:"<<data._first_zero_doppler_time_sec<<std::endl;
30 
31  os<<"first_zero_doppler_time_microsec:"<<data._first_zero_doppler_time_microsec<<std::endl;
32 
33  os<<"attach_flag:"<<data._attach_flag<<std::endl;
34 
35  os<<"line_num:"<<data._line_num<<std::endl;
36 
37  os<<"num_lines:"<<data._num_lines<<std::endl;
38 
39  os<<"sub_sat_track:"<<data._sub_sat_track<<std::endl;
40 
41  for (int i = 0; i<11; i++) {
42  os<<"samp_numbers["<<i<<"]:"<<data._samp_numbers[i]<<std::endl;
43  }
44 
45  for (int i = 0; i<11; i++) {
46  os<<"slant_range_times["<<i<<"]:"<<data._slant_range_times[i]<<std::endl;
47  }
48 
49  for (int i = 0; i<11; i++) {
50  os<<"angles["<<i<<"]:"<<data._angles[i]<<std::endl;
51  }
52 
53  for (int i = 0; i<11; i++) {
54  os<<"lats["<<i<<"]:"<<data._lats[i]<<std::endl;
55  }
56 
57  for (int i = 0; i<11; i++) {
58  os<<"longs["<<i<<"]:"<<data._longs[i]<<std::endl;
59  }
60 
61  os<<"last_zero_doppler_time:"<<data._last_zero_doppler_time.c_str()<<std::endl;
62 
63  os<<"last_line_tie_points:"<<data._last_line_tie_points.c_str()<<std::endl;
64 
65  return os;
66 
67  }
68 
70  {
71  char buf220[221];
72  buf220[220] = '\0';
73  char buf32[33];
74  buf32[32] = '\0';
75  // char buf27[28];
76  // buf27[27] = '\0';
77  // char buf20[21];
78  // buf20[20] = '\0';
79  // char buf16[17];
80  // buf16[16]='\0';
81  // char buf15[16];
82  // buf15[15] = '\0';
83  // char buf14[15];
84  // buf14[14] = '\0';
85  // char buf13[14];
86  // buf13[13] = '\0';
87  char buf12[13];
88  buf12[12] = '\0';
89  // char buf11[12];
90  // buf11[11] = '\0';
91  // char buf10[11];
92  // buf10[10] = '\0';
93  // char buf9[10];
94  // buf9[9] = '\0';
95  // char buf8[9];
96  // buf8[8] = '\0';
97  // char buf7[8];
98  // buf7[7] = '\0';
99  // char buf6[7];
100  // buf6[6] = '\0';
101  // char buf5[6];
102  // buf5[5] = '\0';
103  // char buf4[5];
104  // buf4[4] = '\0';
105  // char buf3[4];
106  // buf3[3] = '\0';
107  // char buf2[3];
108  // buf2[2] = '\0';
109 // char buf1[1]; // not used avoid warning
110 
111  is.read((char*)&(data._first_zero_doppler_time_day),4);
113 
114  is.read((char*)&(data._first_zero_doppler_time_sec),4);
116 
117  is.read((char*)&(data._first_zero_doppler_time_microsec),4);
119 
120  is.read((char*)&(data._attach_flag),1);
121 
122  is.read((char*)&(data._line_num),4);
123  data.SwitchEndian(data._line_num);
124 
125  is.read((char*)&(data._num_lines),4);
126  data.SwitchEndian(data._num_lines);
127 
128  is.read((char*)&(data._sub_sat_track),4);
129  data.SwitchEndian(data._sub_sat_track);
130 
131  for (int i = 0; i<11; i++) {
132  is.read((char*)&(data._samp_numbers[i]),4);
133  data.SwitchEndian(data._samp_numbers[i]);
134  }
135 
136  for (int i = 0; i<11; i++) {
137  is.read((char*)&(data._slant_range_times[i]),4);
138  data.SwitchEndian(data._slant_range_times[i]);
139  }
140 
141  for (int i = 0; i<11; i++) {
142  is.read((char*)&(data._angles[i]),4);
143  data.SwitchEndian(data._angles[i]);
144  }
145 
146  for (int i = 0; i<11; i++) {
147  is.read((char*)&(data._lats[i]),4);
148  data.SwitchEndian(data._lats[i]);
149  }
150 
151  for (int i = 0; i<11; i++) {
152  is.read((char*)&(data._longs[i]),4);
153  data.SwitchEndian(data._longs[i]);
154  }
155 
156  is.read(buf32,22);
157 
158  is.read(buf12,12);
159  data._last_zero_doppler_time = buf12;
160 
161  is.read(buf220,220);
162  data._last_line_tie_points = buf220;
163 
164  is.read(buf32,22);
165 
166  return is;
167 
168  }
169 
171  EnvisatAsarRecord(rhs),
172  _first_zero_doppler_time_day(rhs._first_zero_doppler_time_day),
173  _first_zero_doppler_time_sec(rhs._first_zero_doppler_time_sec),
174  _first_zero_doppler_time_microsec(rhs._first_zero_doppler_time_microsec),
175  _attach_flag(rhs._attach_flag),
176  _line_num(rhs._line_num),
177  _num_lines(rhs._num_lines),
178  _sub_sat_track(rhs._sub_sat_track),
179  _last_zero_doppler_time(rhs._last_zero_doppler_time),
180  _last_line_tie_points(rhs._last_line_tie_points)
181  {
182 
183  for (int i = 0; i<11; i++) {
184  _samp_numbers[i] = rhs._samp_numbers[i];
186  _angles[i] = rhs._angles[i];
187  _lats[i] = rhs._lats[i];
188  _longs[i] = rhs._longs[i];
189  }
190 
191 
192  }
193 
194 
196  {
201  _line_num = rhs._line_num;
202  _num_lines = rhs._num_lines;
206 
207  for (int i = 0; i<11; i++) {
208  _samp_numbers[i] = rhs._samp_numbers[i];
210  _angles[i] = rhs._angles[i];
211  _lats[i] = rhs._lats[i];
212  _longs[i] = rhs._longs[i];
213  }
214 
215  return *this;
216  }
217 }
float _slant_range_times[11]
slant_range_times[11]
unsigned int _samp_numbers[11]
samp_numbers
void SwitchEndian(T &value)
This function switches the LSB value and the MSB value of the parameter.
unsigned int _first_zero_doppler_time_sec
first_zero_doppler_time sec
float _angles[11]
angles[11]
virtual ~GeolocationGrid()
Destructor.
unsigned int _first_zero_doppler_time_microsec
first_zero_doppler_time microsec
std::string _last_line_tie_points
last_line_tie_points
std::ostream & operator<<(std::ostream &os, const AlosPalsarData &data)
int _first_zero_doppler_time_day
first_zero_doppler_time day
std::istream & operator>>(std::istream &is, AlosPalsarData &data)
GeolocationGrid & operator=(const GeolocationGrid &rhs)
Copy operator.
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
This class is the base class of all the Envisat ASAR record classes.
float _sub_sat_track
sub_sat_track
std::string _last_zero_doppler_time
last_zero_doppler_time
unsigned int _line_num
line_num
This class is able to read the ASAR GeolocationGrid record.
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
unsigned int _num_lines
num_lines