OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
RadiometricData.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 "RadiometricData.h"
13 
14 namespace ossimplugins
15 {
16 
18 {
19 }
20 
22 {
23 }
24 
26 {
27  os<<"seq_num:"<<data._seq_num<<std::endl;
28 
29  os<<"n_data:"<<data._n_data<<std::endl;
30 
31  os<<"field_size:"<<data._field_size<<std::endl;
32 
33  os<<"chan_ind:"<<data._chan_ind.c_str()<<std::endl;
34 
35  os<<"table_desig:"<<data._table_desig.c_str()<<std::endl;
36 
37  os<<"n_samp:"<<data._n_samp<<std::endl;
38 
39  os<<"samp_type:"<<data._samp_type.c_str()<<std::endl;
40 
41  os<<"samp_inc:"<<data._samp_inc<<std::endl;
42 
43  for (int i=0;i<512;i++)
44  {
45  os<<"lookup_tab["<<i<<"]:"<<data._lookup_tab[i]<<std::endl;
46  }
47 
48  os<<"noise_scale:"<<data._noise_scale<<std::endl;
49 
50  os<<"offset:"<<data._offset<<std::endl;
51 
52  os<<"calib_const:"<<data._calib_const<<std::endl;
53 
54  return os;
55 }
56 
58 {
59  char buf[1513];
60  buf[1512] = '\0';
61 
62 
63  is.read(buf,4);
64  buf[4] = '\0';
65  data._seq_num = atoi(buf);
66 
67  is.read(buf,4);
68  buf[4] = '\0';
69  data._n_data = atoi(buf);
70 
71  is.read(buf,8);
72  buf[8] = '\0';
73  data._field_size = atoi(buf);
74 
75  is.read(buf,4);
76  buf[4] = '\0';
77  data._chan_ind = buf;
78 
79  is.read(buf,4);
80 
81  is.read(buf,24);
82  buf[24] = '\0';
83  data._table_desig = buf;
84 
85  is.read(buf,8);
86  buf[8] = '\0';
87  data._n_samp = atoi(buf);
88 
89  is.read(buf,16);
90  buf[16] = '\0';
91  data._samp_type = buf;
92 
93  is.read(buf,4);
94  buf[4] = '\0';
95  data._samp_inc = atoi(buf);
96 
97  for (int i=0;i<512;i++)
98  {
99  is.read(buf,16);
100  buf[16] = '\0';
101  data._lookup_tab[i] = atof(buf);
102  }
103 
104  is.read(buf,4);
105 
106  is.read(buf,16);
107  buf[16] = '\0';
108  data._noise_scale = atof(buf);
109 
110  is.read(buf,16);
111 
112  is.read(buf,16);
113  buf[16] = '\0';
114  data._offset = atof(buf);
115 
116  is.read(buf,16);
117  buf[16] = '\0';
118  data._calib_const = atof(buf);
119 
120  is.read(buf,1512);
121 
122  return is;
123 }
124 
126  RadarSatRecord(rhs)
127 {
128 
129  _seq_num = rhs._seq_num;
130 
131  _n_data = rhs._n_data;
132 
133  _field_size = rhs._field_size;
134 
135  _chan_ind = rhs._chan_ind;
136 
138 
139  _n_samp = rhs._n_samp;
140 
141  _samp_type = rhs._samp_type;
142 
143  _samp_inc = rhs._samp_inc;
144 
145  for (int i=0;i<512;i++)
146  {
147  _lookup_tab[i] = rhs._lookup_tab[i];
148  }
149 
151 
152  _offset = rhs._offset;
153 
155 }
156 
158 {
159  _seq_num = rhs._seq_num;
160 
161  _n_data = rhs._n_data;
162 
163  _field_size = rhs._field_size;
164 
165  _chan_ind = rhs._chan_ind;
166 
168 
169  _n_samp = rhs._n_samp;
170 
171  _samp_type = rhs._samp_type;
172 
173  _samp_inc = rhs._samp_inc;
174 
175  for (int i=0;i<512;i++)
176  {
177  _lookup_tab[i] = rhs._lookup_tab[i];
178  }
179 
181 
182  _offset = rhs._offset;
183 
185 
186  return *this;
187 }
188 }
double _calib_const
Calibration constant
std::string _samp_type
Sample type designator
double _offset
Scaling offset
RadiometricData & operator=(const RadiometricData &rhs)
Copy operator.
double _noise_scale
Thermal noise reference level
int _field_size
Field size in bytes
int _samp_inc
Increment between table entries, range samples
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 radiometric data record.
int _n_data
Number of data fields
std::istream & operator>>(std::istream &is, AlosPalsarData &data)
std::string _chan_ind
SAR channel indicator.
int _n_samp
Number of lookup table samples
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
std::string _table_desig
Table designator
int _seq_num
Record sequence number.
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
double _lookup_tab[512]
Output scaling gain table