OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
AlosPalsarSignalData.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 
15 #include <ossim/base/ossimEndian.h>
16 
17 
18 namespace ossimplugins
19 {
20 
22 {
23 }
24 
26 {
27 }
28 
30 {
31  os << "_pulse_repetition_frequency:"
32  << data._pulse_repetition_frequency << std::endl;
33  os << "_slant_range_to_1st_data_sample:"
34  << data._slant_range_to_1st_data_sample << std::endl;
35 
36  return os;
37 }
38 
40 {
41  ossim_uint16 tmpuint16;
42  ossim_uint32 tmpuint32;
43  ossimEndian oe;
44 
45  is.read(reinterpret_cast<char*>(&tmpuint32), 4);
47  {
48  oe.swap(tmpuint32);
49  }
50 // std::cout << "Data line number = " << tmpuint32 << std::endl;
51 
52  is.read(reinterpret_cast<char*>(&tmpuint32), 4);
54  {
55  oe.swap(tmpuint32);
56  }
57 // std::cout << "Data record index = " << tmpuint32 << std::endl;
58 
59  is.read(reinterpret_cast<char*>(&tmpuint32), 4);
61  {
62  oe.swap(tmpuint32);
63  }
64 // std::cout << "Actual count of left-fill pixels = " << tmpuint32 << std::endl;
65 
66  is.read(reinterpret_cast<char*>(&tmpuint32), 4);
68  {
69  oe.swap(tmpuint32);
70  }
71 // std::cout << "Actual count of data pixels = " << tmpuint32 << std::endl;
72 
73  is.read(reinterpret_cast<char*>(&tmpuint32), 4);
75  {
76  oe.swap(tmpuint32);
77  }
78 // std::cout << "Actual count of right-fill pixels = " << tmpuint32 << std::endl;
79 
80  is.read(reinterpret_cast<char*>(&tmpuint32), 4);
82  {
83  oe.swap(tmpuint32);
84  }
85 // std::cout << "Sensor parameters update flag = " << tmpuint32 << std::endl;
86 
87  is.read(reinterpret_cast<char*>(&tmpuint32), 4);
89  {
90  oe.swap(tmpuint32);
91  }
92 // std::cout << "Scene start year = " << tmpuint32 << std::endl;
93 
94  is.read(reinterpret_cast<char*>(&tmpuint32), 4);
96  {
97  oe.swap(tmpuint32);
98  }
99 // std::cout << "Scene start day of year = " << tmpuint32 << std::endl;
100 
101  is.read(reinterpret_cast<char*>(&tmpuint32), 4);
103  {
104  oe.swap(tmpuint32);
105  }
106 // std::cout << "Sensor acquisition milliseconds of day = " << tmpuint32 << std::endl;
107 
108  is.read(reinterpret_cast<char*>(&tmpuint16), 2);
110  {
111  oe.swap(tmpuint16);
112  }
113 // std::cout << "SAR channel indicator = " << tmpuint16 << std::endl;
114 
115  is.read(reinterpret_cast<char*>(&tmpuint16), 2);
117  {
118  oe.swap(tmpuint16);
119  }
120 // std::cout << "SAR channel code = " << tmpuint16 << std::endl;
121 
122  is.read(reinterpret_cast<char*>(&tmpuint16), 2);
124  {
125  oe.swap(tmpuint16);
126  }
127 // std::cout << "Transmitted polarization = " << tmpuint16 << std::endl;
128 
129  is.read(reinterpret_cast<char*>(&tmpuint16), 2);
131  {
132  oe.swap(tmpuint16);
133  }
134 // std::cout << "Received polarization = " << tmpuint16 << std::endl;
135 
136  is.read(reinterpret_cast<char*>(&tmpuint32), 4);
138  {
139  oe.swap(tmpuint32);
140  }
141 // std::cout << "PRF (mHz) = " << tmpuint32 << std::endl;
142  data._pulse_repetition_frequency = static_cast<int>(tmpuint32);
143 
144  is.read(reinterpret_cast<char*>(&tmpuint32), 4);
146  {
147  oe.swap(tmpuint32);
148  }
149 // std::cout << "Scan ID for SCAN SAR mode = " << tmpuint32 << std::endl;
150 
151  is.read(reinterpret_cast<char*>(&tmpuint16), 2);
153  {
154  oe.swap(tmpuint16);
155  }
156 // std::cout << "Onboard range compressed flag = " << tmpuint16 << std::endl;
157 
158  is.seekg(50, std::ios_base::cur);
159 
160  is.read(reinterpret_cast<char*>(&tmpuint32), 4);
162  {
163  oe.swap(tmpuint32);
164  }
165 // std::cout << "Slant range to 1st data sample (m) = " << tmpuint32 << std::endl;
166  data._slant_range_to_1st_data_sample = static_cast<int>(tmpuint32);
167 
168  is.read(reinterpret_cast<char*>(&tmpuint32), 4);
170  {
171  oe.swap(tmpuint32);
172  }
173 // std::cout << "Data record window position = " << tmpuint32 << std::endl;
174 
175 // std::cout << std::endl << "File pointer location = " << is.tellg() << std::endl;
176 // std::cout << std::endl;
177 
178  return is;
179 }
180 
182  AlosPalsarRecord(rhs),
183  _pulse_repetition_frequency(rhs._pulse_repetition_frequency),
184  _slant_range_to_1st_data_sample(rhs._slant_range_to_1st_data_sample)
185 {
186 }
187 
189 {
192  return *this;
193 }
194 }
This class is able to read the header of the Signal Data Records of the image file.
int _pulse_repetition_frequency
pulse_repetition_frequency
unsigned short ossim_uint16
AlosPalsarSignalData & operator=(const AlosPalsarSignalData &rhs)
Copy operator.
This class is the base class of all the record classes.
std::ostream & operator<<(std::ostream &os, const AlosPalsarData &data)
unsigned int ossim_uint32
int _slant_range_to_1st_data_sample
slant_range_to_1st_data_sample
ossimByteOrder getSystemEndianType() const
Definition: ossimEndian.h:78
std::istream & operator>>(std::istream &is, AlosPalsarData &data)
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
void swap(ossim_sint8 &)
Definition: ossimEndian.h:26
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23