OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
CompensationDataRecord.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 
12 #include "CompensationDataRecord.h"
13 
14 namespace ossimplugins
15 {
17 {
18 }
19 
21 {
22 }
23 
25 {
26  os<<"comp_desig:"<<data._comp_desig.c_str()<<std::endl;
27 
28  os<<"comp_descr:"<<data._comp_descr.c_str()<<std::endl;
29 
30  os<<"n_comp_rec:"<<data._n_comp_rec<<std::endl;
31 
32  os<<"comp_seq_no:"<<data._comp_seq_no<<std::endl;
33 
34  os<<"beam_tab_size:"<<data._beam_tab_size<<std::endl;
35 
36  for (int i=0;i<256;i++)
37  {
38  os<<"beam_tab["<<i<<"]:"<<data._beam_tab[i]<<std::endl;
39  }
40 
41  os<<"beam_type:"<<data._beam_type.c_str()<<std::endl;
42 
43  os<<"look_angle:"<<data._look_angle<<std::endl;
44 
45  os<<"beam_tab_inc:"<<data._beam_tab_inc<<std::endl;
46  return os;
47 }
48 
50 {
51  char buf[33];
52  buf[32] = '\0';
53 
54 
55  is.read(buf,8);
56  buf[8] = '\0';
57  data._comp_desig = buf;
58 
59  is.read(buf,32);
60  buf[32] = '\0';
61  data._comp_descr = buf;
62 
63  is.read(buf,4);
64  buf[4] = '\0';
65  data._n_comp_rec = atoi(buf);
66 
67  is.read(buf,4);
68  buf[4] = '\0';
69  data._comp_seq_no = atoi(buf);
70 
71  is.read(buf,8);
72  buf[8] = '\0';
73  data._beam_tab_size = atoi(buf);
74 
75  for (int i=0;i<256;i++)
76  {
77  is.read(buf,16);
78  buf[16] = '\0';
79  data._beam_tab[i] = atof(buf);
80  }
81 
82  is.read(buf,16);
83  buf[16] = '\0';
84  data._beam_type = buf;
85 
86  is.read(buf,16);
87  buf[16] = '\0';
88  data._look_angle = atof(buf);
89 
90  is.read(buf,16);
91  buf[16] = '\0';
92  data._beam_tab_inc = atof(buf);
93 
94  return is;
95 }
96 
98 {
100 
101  _comp_descr = rhs._comp_descr;
102 
103  _n_comp_rec = rhs._n_comp_rec;
104 
106 
108 
109  for (int i=0;i<256;i++)
110  {
111  _beam_tab[i] = rhs._beam_tab[i];
112  }
113 
114  _beam_type = rhs._beam_type;
115 
116  _look_angle = rhs._look_angle;
117 
119 }
120 
122 {
123  _comp_desig = rhs._comp_desig;
124 
125  _comp_descr = rhs._comp_descr;
126 
127  _n_comp_rec = rhs._n_comp_rec;
128 
130 
132 
133  for (int i=0;i<256;i++)
134  {
135  _beam_tab[i] = rhs._beam_tab[i];
136  }
137 
138  _beam_type = rhs._beam_type;
139 
140  _look_angle = rhs._look_angle;
141 
143 
144  return *this;
145 }
146 }
std::string _comp_descr
Compensation data descriptor
double _look_angle
Look angle of beam table centre
std::ostream & operator<<(std::ostream &os, const AlosPalsarData &data)
int _n_comp_rec
Number of compensation records
double _beam_tab_inc
Increment between beam table entries
int _comp_seq_no
Compensation record sequence number
std::istream & operator>>(std::istream &is, AlosPalsarData &data)
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
double _beam_tab[256]
Elevation gain beam profile
CompensationDataRecord & operator=(const CompensationDataRecord &rhs)
Copy operator.
int _beam_tab_size
Number of beam table entries
std::string _comp_desig
Compensation data designator.
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
This class is able to read a Compensation data record.