1 | //#---------------------------------------------------------------------------
|
---|
2 | //# ASTEDataset.cc: Class for ASTE dataset.
|
---|
3 | //#---------------------------------------------------------------------------
|
---|
4 | //# Copyright (C) 2000-2006
|
---|
5 | //# Associated Universities, Inc. Washington DC, USA.
|
---|
6 | //#
|
---|
7 | //# This library is free software; you can redistribute it and/or modify it
|
---|
8 | //# under the terms of the GNU Library General Public License as published by
|
---|
9 | //# the Free Software Foundation; either version 2 of the License, or (at your
|
---|
10 | //# option) any later version.
|
---|
11 | //#
|
---|
12 | //# This library is distributed in the hope that it will be useful, but WITHOUT
|
---|
13 | //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
---|
14 | //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
---|
15 | //# License for more details.
|
---|
16 | //#
|
---|
17 | //# You should have received a copy of the GNU Library General Public License
|
---|
18 | //# along with this library; if not, write to the Free Software Foundation,
|
---|
19 | //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
|
---|
20 | //#
|
---|
21 | //# Correspondence concerning AIPS++ should be addressed as follows:
|
---|
22 | //# Internet email: aips2-request@nrao.edu.
|
---|
23 | //# Postal address: AIPS++ Project Office
|
---|
24 | //# National Radio Astronomy Observatory
|
---|
25 | //# 520 Edgemont Road
|
---|
26 | //# Charlottesville, VA 22903-2475 USA
|
---|
27 | //#
|
---|
28 | //# $Id$
|
---|
29 | //#---------------------------------------------------------------------------
|
---|
30 | //# Original: 2008/10/30, Takeshi Nakazato, NAOJ
|
---|
31 | //#---------------------------------------------------------------------------
|
---|
32 |
|
---|
33 | #include <atnf/PKSIO/ASTEDataset.h>
|
---|
34 |
|
---|
35 | #include <iostream>
|
---|
36 | #include <cstring>
|
---|
37 |
|
---|
38 | using namespace std ;
|
---|
39 |
|
---|
40 | // constructor
|
---|
41 | ASTEDataset::ASTEDataset( string name )
|
---|
42 | : NRODataset( name )
|
---|
43 | {}
|
---|
44 |
|
---|
45 | // destructor
|
---|
46 | ASTEDataset::~ASTEDataset()
|
---|
47 | {}
|
---|
48 |
|
---|
49 | // data initialization
|
---|
50 | void ASTEDataset::initialize()
|
---|
51 | {
|
---|
52 | int arymax = arrayMax() ;
|
---|
53 |
|
---|
54 | // it must be called
|
---|
55 | NRODataset::initialize() ;
|
---|
56 |
|
---|
57 | // additional initialization
|
---|
58 | datasize_ += sizeof( char ) * arymax * 16 // RX
|
---|
59 | + sizeof( double ) * arymax * 6 // HPBW, EFFA, EFFB, EFFL, EFSS GAIN
|
---|
60 | + sizeof( char ) * arymax * 4 // HORN
|
---|
61 | + sizeof( char ) * arymax * 4 // POLTP
|
---|
62 | + sizeof( double ) * arymax * 3 // POLDR, POLAN, DFRQ
|
---|
63 | + sizeof( char ) * arymax * 4 // SIDBID
|
---|
64 | + sizeof( int ) * arymax * 3 // REFN, IPINT, MULTN
|
---|
65 | + sizeof( double ) * arymax // MLTSCF
|
---|
66 | + sizeof( char ) * arymax * 8 // LAGWIND
|
---|
67 | + sizeof( double ) * arymax * 3 // BEBW, BERES, CHWID
|
---|
68 | + sizeof( int ) * arymax * 2 // ARRY, NFCAL
|
---|
69 | + sizeof( double ) * arymax // F0CAL
|
---|
70 | + sizeof( double ) * arymax * 10 * 3 // FQCAL, CHCAL, CWCAL
|
---|
71 | + sizeof( char ) * 116 // CDMY1
|
---|
72 | + sizeof( double ) * arymax ; // DSBFC
|
---|
73 | }
|
---|
74 |
|
---|
75 | int ASTEDataset::fillHeader( int sameEndian )
|
---|
76 | {
|
---|
77 | LogIO os( LogOrigin( "ASTEDataset", "fillHeader()", WHERE ) ) ;
|
---|
78 |
|
---|
79 | int arymax = arrayMax();
|
---|
80 |
|
---|
81 | string str4( 4, ' ' ) ;
|
---|
82 | string str8( 8, ' ' ) ;
|
---|
83 | string str16( 16, ' ' ) ;
|
---|
84 | string str18( 18, ' ' ) ;
|
---|
85 | string str24( 24, ' ' ) ;
|
---|
86 | string str40( 40, ' ' ) ;
|
---|
87 | string str120( 120, ' ' ) ;
|
---|
88 | char c4[4] ;
|
---|
89 | char c8[8] ;
|
---|
90 | char c16[16] ;
|
---|
91 | char c18[18] ;
|
---|
92 | char c24[24] ;
|
---|
93 | char c40[40] ;
|
---|
94 | char c120[120] ;
|
---|
95 | // make sure file pointer points a beginning of the file
|
---|
96 | fseek( fp_, 0, SEEK_SET ) ;
|
---|
97 |
|
---|
98 | // read data header
|
---|
99 | strcpy( c8, str8.c_str() ) ;
|
---|
100 | if ( readHeader( c8, 8 ) == -1 ) {
|
---|
101 | os << LogIO::WARN << "Error while reading data LOFIL." << LogIO::POST ;
|
---|
102 | return -1 ;
|
---|
103 | }
|
---|
104 | LOFIL = string( c8 ) ;
|
---|
105 | // DEBUG
|
---|
106 | //cout << "LOFIL = " << LOFIL << endl ;
|
---|
107 | //
|
---|
108 | strcpy( c8, str8.c_str() ) ;
|
---|
109 | if ( readHeader( c8, 8 ) == -1 ) {
|
---|
110 | os << LogIO::WARN << "Error while reading data VER." << LogIO::POST ;
|
---|
111 | return -1 ;
|
---|
112 | }
|
---|
113 | VER = string( c8 ) ;
|
---|
114 | // DEBUG
|
---|
115 | //cout << "VER = " << VER << endl ;
|
---|
116 | //
|
---|
117 | strcpy( c16, str16.c_str() ) ;
|
---|
118 | if ( readHeader( c16, 16 ) == -1 ) {
|
---|
119 | os << LogIO::WARN << "Error while reading data GROUP." << LogIO::POST ;
|
---|
120 | return -1 ;
|
---|
121 | }
|
---|
122 | GROUP = string( c16 ) ;
|
---|
123 | // DEBUG
|
---|
124 | //cout << "GROUP = " << GROUP << endl ;
|
---|
125 | //
|
---|
126 | strcpy( c16, str16.c_str() ) ;
|
---|
127 | if ( readHeader( c16, 16 ) == -1 ) {
|
---|
128 | os << LogIO::WARN << "Error while reading data PROJ." << LogIO::POST ;
|
---|
129 | return -1 ;
|
---|
130 | }
|
---|
131 | PROJ = string( c16 ) ;
|
---|
132 | // DEBUG
|
---|
133 | //cout << "PROJ = " << PROJ << endl ;
|
---|
134 | //
|
---|
135 | strcpy( c24, str24.c_str() ) ;
|
---|
136 | if ( readHeader( c24, 24 ) == -1 ) {
|
---|
137 | os << LogIO::WARN << "Error while reading data SCHED." << LogIO::POST ;
|
---|
138 | return -1 ;
|
---|
139 | }
|
---|
140 | SCHED = string( c24 ) ;
|
---|
141 | // DEBUG
|
---|
142 | //cout << "SCHED = " << SCHED << endl ;
|
---|
143 | //
|
---|
144 | strcpy( c40, str40.c_str() ) ;
|
---|
145 | if ( readHeader( c40, 40 ) == -1 ) {
|
---|
146 | os << LogIO::WARN << "Error while reading data OBSVR." << LogIO::POST ;
|
---|
147 | return -1 ;
|
---|
148 | }
|
---|
149 | OBSVR = string( c40 ) ;
|
---|
150 | // DEBUG
|
---|
151 | //cout << "OBSVR = " << OBSVR << endl ;
|
---|
152 | //
|
---|
153 | strcpy( c16, str16.c_str() ) ;
|
---|
154 | if ( readHeader( c16, 16 ) == -1 ) {
|
---|
155 | os << LogIO::WARN << "Error while reading data LOSTM." << LogIO::POST ;
|
---|
156 | return -1 ;
|
---|
157 | }
|
---|
158 | LOSTM = string( c16 ) ;
|
---|
159 | // DEBUG
|
---|
160 | //cout << "LOSTM = " << LOSTM << endl ;
|
---|
161 | //
|
---|
162 | strcpy( c16, str16.c_str() ) ;
|
---|
163 | if ( readHeader( c16, 16 ) == -1 ) {
|
---|
164 | os << LogIO::WARN << "Error while reading data LOETM." << LogIO::POST ;
|
---|
165 | return -1 ;
|
---|
166 | }
|
---|
167 | LOETM = string( c16 ) ;
|
---|
168 | // DEBUG
|
---|
169 | //cout << "LOETM = " << LOETM << endl ;
|
---|
170 | //
|
---|
171 | if ( readHeader( ARYNM, sameEndian ) == -1 ) {
|
---|
172 | os << LogIO::WARN << "Error while reading data ARYNM." << LogIO::POST ;
|
---|
173 | return -1 ;
|
---|
174 | }
|
---|
175 | // DEBUG
|
---|
176 | //cout << "ARYNM = " << ARYNM << endl ;
|
---|
177 | //
|
---|
178 | if ( readHeader( NSCAN, sameEndian ) == -1 ) {
|
---|
179 | os << LogIO::WARN << "Error while reading data NSCAN." << LogIO::POST ;
|
---|
180 | return -1 ;
|
---|
181 | }
|
---|
182 | // DEBUG
|
---|
183 | //cout << "NSCAN = " << NSCAN << endl ;
|
---|
184 | //
|
---|
185 | strcpy( c120, str120.c_str() ) ;
|
---|
186 | if ( readHeader( c120, 120 ) == -1 ) {
|
---|
187 | os << LogIO::WARN << "Error while reading data TITLE." << LogIO::POST ;
|
---|
188 | return -1 ;
|
---|
189 | }
|
---|
190 | TITLE = string( c120 ) ;
|
---|
191 | // DEBUG
|
---|
192 | //cout << "TITLE = " << TITLE << endl ;
|
---|
193 | //
|
---|
194 | strcpy( c16, str16.c_str() ) ;
|
---|
195 | if ( readHeader( c16, 16 ) == -1 ) {
|
---|
196 | os << LogIO::WARN << "Error while reading data OBJ." << LogIO::POST ;
|
---|
197 | return -1 ;
|
---|
198 | }
|
---|
199 | OBJ = string( c16 ) ;
|
---|
200 | // DEBUG
|
---|
201 | //cout << "OBJ = " << OBJ << endl ;
|
---|
202 | //
|
---|
203 | strcpy( c8, str8.c_str() ) ;
|
---|
204 | if ( readHeader( c8, 8 ) == -1 ) {
|
---|
205 | os << LogIO::WARN << "Error while reading data EPOCH." << LogIO::POST ;
|
---|
206 | return -1 ;
|
---|
207 | }
|
---|
208 | EPOCH = string( c8 ) ;
|
---|
209 | // DEBUG
|
---|
210 | //cout << "EPOCH = " << EPOCH << endl ;
|
---|
211 | //
|
---|
212 | if ( readHeader( RA0, sameEndian ) == -1 ) {
|
---|
213 | os << LogIO::WARN << "Error while reading data RA0." << LogIO::POST ;
|
---|
214 | return -1 ;
|
---|
215 | }
|
---|
216 | // DEBUG
|
---|
217 | //cout << "RA0 = " << RA0 << endl ;
|
---|
218 | //
|
---|
219 | if ( readHeader( DEC0, sameEndian ) == -1 ) {
|
---|
220 | os << LogIO::WARN << "Error while reading data DEC0." << LogIO::POST ;
|
---|
221 | return -1 ;
|
---|
222 | }
|
---|
223 | // DEBUG
|
---|
224 | //cout << "DEC0 = " << DEC0 << endl ;
|
---|
225 | //
|
---|
226 | if ( readHeader( GLNG0, sameEndian ) == -1 ) {
|
---|
227 | os << LogIO::WARN << "Error while reading data GLNG0." << LogIO::POST ;
|
---|
228 | return -1 ;
|
---|
229 | }
|
---|
230 | // DEBUG
|
---|
231 | //cout << "GLNG0 = " << GLNG0 << endl ;
|
---|
232 | //
|
---|
233 | if ( readHeader( GLAT0, sameEndian ) == -1 ) {
|
---|
234 | os << LogIO::WARN << "Error while reading data GLAT0." << LogIO::POST ;
|
---|
235 | return -1 ;
|
---|
236 | }
|
---|
237 | // DEBUG
|
---|
238 | //cout << "GLAT0 = " << GLAT0 << endl ;
|
---|
239 | //
|
---|
240 | if ( readHeader( NCALB, sameEndian ) == -1 ) {
|
---|
241 | os << LogIO::WARN << "Error while reading data NCALB." << LogIO::POST ;
|
---|
242 | return -1 ;
|
---|
243 | }
|
---|
244 | // DEBUG
|
---|
245 | //cout << "NCALB = " << NCALB << endl ;
|
---|
246 | //
|
---|
247 | if ( readHeader( SCNCD, sameEndian ) == -1 ) {
|
---|
248 | os << LogIO::WARN << "Error while reading data SCNCD." << LogIO::POST ;
|
---|
249 | return -1 ;
|
---|
250 | }
|
---|
251 | // DEBUG
|
---|
252 | //cout << "SCNCD = " << SCNCD << endl ;
|
---|
253 | //
|
---|
254 | strcpy( c120, str120.c_str() ) ;
|
---|
255 | if ( readHeader( c120, 120 ) == -1 ) {
|
---|
256 | os << LogIO::WARN << "Error while reading data SCMOD." << LogIO::POST ;
|
---|
257 | return -1 ;
|
---|
258 | }
|
---|
259 | SCMOD = string( c120 ) ;
|
---|
260 | // DEBUG
|
---|
261 | //cout << "SCMOD = " << SCMOD << endl ;
|
---|
262 | //
|
---|
263 | if ( readHeader( URVEL, sameEndian ) == -1 ) {
|
---|
264 | os << LogIO::WARN << "Error while reading data URVEL." << LogIO::POST ;
|
---|
265 | return -1 ;
|
---|
266 | }
|
---|
267 | // DEBUG
|
---|
268 | //cout << "URVEL = " << URVEL << endl ;
|
---|
269 | //
|
---|
270 | strcpy( c4, str4.c_str() ) ;
|
---|
271 | if ( readHeader( c4, 4 ) == -1 ) {
|
---|
272 | os << LogIO::WARN << "Error while reading data VREF." << LogIO::POST ;
|
---|
273 | return -1 ;
|
---|
274 | }
|
---|
275 | VREF = string( c4 ) ;
|
---|
276 | // DEBUG
|
---|
277 | //cout << "VREF = " << VREF << endl ;
|
---|
278 | //
|
---|
279 | strcpy( c4, str4.c_str() ) ;
|
---|
280 | if ( readHeader( c4, 4 ) == -1 ) {
|
---|
281 | os << LogIO::WARN << "Error while reading data VDEF." << LogIO::POST ;
|
---|
282 | return -1 ;
|
---|
283 | }
|
---|
284 | VDEF = string( c4 ) ;
|
---|
285 | // DEBUG
|
---|
286 | //cout << "VDEF = " << VDEF << endl ;
|
---|
287 | //
|
---|
288 | strcpy( c8, str8.c_str() ) ;
|
---|
289 | if ( readHeader( c8, 8 ) == -1 ) {
|
---|
290 | os << LogIO::WARN << "Error while reading data SWMOD." << LogIO::POST ;
|
---|
291 | return -1 ;
|
---|
292 | }
|
---|
293 | SWMOD = string( c8 ) + "::OTF" ;
|
---|
294 | // DEBUG
|
---|
295 | //cout << "SWMOD = " << SWMOD << endl ;
|
---|
296 | //
|
---|
297 | if ( readHeader( FRQSW, sameEndian ) == -1 ) {
|
---|
298 | os << LogIO::WARN << "Error while reading data FRQSW." << LogIO::POST ;
|
---|
299 | return -1 ;
|
---|
300 | }
|
---|
301 | // DEBUG
|
---|
302 | //cout << "FRQSW = " << FRQSW << endl ;
|
---|
303 | //
|
---|
304 | if ( readHeader( DBEAM, sameEndian ) == -1 ) {
|
---|
305 | os << LogIO::WARN << "Error while reading data DBEAM." << LogIO::POST ;
|
---|
306 | return -1 ;
|
---|
307 | }
|
---|
308 | // DEBUG
|
---|
309 | //cout << "DBEAM = " << DBEAM << endl ;
|
---|
310 | //
|
---|
311 | if ( readHeader( MLTOF, sameEndian ) == -1 ) {
|
---|
312 | os << LogIO::WARN << "Error while reading data MLTOF." << LogIO::POST ;
|
---|
313 | return -1 ;
|
---|
314 | }
|
---|
315 | // DEBUG
|
---|
316 | //cout << "MLTOF = " << MLTOF << endl ;
|
---|
317 | //
|
---|
318 | if ( readHeader( CMTQ, sameEndian ) == -1 ) {
|
---|
319 | os << LogIO::WARN << "Error while reading data CMTQ." << LogIO::POST ;
|
---|
320 | return -1 ;
|
---|
321 | }
|
---|
322 | // DEBUG
|
---|
323 | //cout << "CMTQ = " << CMTQ << endl ;
|
---|
324 | //
|
---|
325 | if ( readHeader( CMTE, sameEndian ) == -1 ) {
|
---|
326 | os << LogIO::WARN << "Error while reading data CMTE." << LogIO::POST ;
|
---|
327 | return -1 ;
|
---|
328 | }
|
---|
329 | // DEBUG
|
---|
330 | //cout << "CMTE = " << CMTE << endl ;
|
---|
331 | //
|
---|
332 | if ( readHeader( CMTSOM, sameEndian ) == -1 ) {
|
---|
333 | os << LogIO::WARN << "Error while reading data CMTSOM." << LogIO::POST ;
|
---|
334 | return -1 ;
|
---|
335 | }
|
---|
336 | // DEBUG
|
---|
337 | //cout << "CMTSOM = " << CMTSOM << endl ;
|
---|
338 | //
|
---|
339 | if ( readHeader( CMTNODE, sameEndian ) == -1 ) {
|
---|
340 | os << LogIO::WARN << "Error while reading data CMTNODE." << LogIO::POST ;
|
---|
341 | return -1 ;
|
---|
342 | }
|
---|
343 | // DEBUG
|
---|
344 | //cout << "CMTNODE = " << CMTNODE << endl ;
|
---|
345 | //
|
---|
346 | if ( readHeader( CMTI, sameEndian ) == -1 ) {
|
---|
347 | os << LogIO::WARN << "Error while reading data CMTI." << LogIO::POST ;
|
---|
348 | return -1 ;
|
---|
349 | }
|
---|
350 | // DEBUG
|
---|
351 | //cout << "CMTI = " << CMTI << endl ;
|
---|
352 | //
|
---|
353 | strcpy( c24, str24.c_str() ) ;
|
---|
354 | if ( readHeader( c24, 24 ) == -1 ) {
|
---|
355 | os << LogIO::WARN << "Error while reading data CMTTM." << LogIO::POST ;
|
---|
356 | return -1 ;
|
---|
357 | }
|
---|
358 | CMTTM = string( c24 ) ;
|
---|
359 | // DEBUG
|
---|
360 | //cout << "CMTTM = " << CMTTM << endl ;
|
---|
361 | //
|
---|
362 | if ( readHeader( SBDX, sameEndian ) == -1 ) {
|
---|
363 | os << LogIO::WARN << "Error while reading data SBDX." << LogIO::POST ;
|
---|
364 | return -1 ;
|
---|
365 | }
|
---|
366 | // DEBUG
|
---|
367 | //cout << "SBDX = " << SBDX << endl ;
|
---|
368 | //
|
---|
369 | if ( readHeader( SBDY, sameEndian ) == -1 ) {
|
---|
370 | os << LogIO::WARN << "Error while reading data SBDY." << LogIO::POST ;
|
---|
371 | return -1 ;
|
---|
372 | }
|
---|
373 | // DEBUG
|
---|
374 | //cout << "SBDY = " << SBDY << endl ;
|
---|
375 | //
|
---|
376 | if ( readHeader( SBDZ1, sameEndian ) == -1 ) {
|
---|
377 | os << LogIO::WARN << "Error while reading data SBDZ1." << LogIO::POST ;
|
---|
378 | return -1 ;
|
---|
379 | }
|
---|
380 | // DEBUG
|
---|
381 | //cout << "SBDZ1 = " << SBDZ1 << endl ;
|
---|
382 | //
|
---|
383 | if ( readHeader( SBDZ2, sameEndian ) == -1 ) {
|
---|
384 | os << LogIO::WARN << "Error while reading data SBDZ2." << LogIO::POST ;
|
---|
385 | return -1 ;
|
---|
386 | }
|
---|
387 | // DEBUG
|
---|
388 | //cout << "SBDZ2 = " << SBDZ2 << endl ;
|
---|
389 | //
|
---|
390 | if ( readHeader( DAZP, sameEndian ) == -1 ) {
|
---|
391 | os << LogIO::WARN << "Error while reading data DAZP." << LogIO::POST ;
|
---|
392 | return -1 ;
|
---|
393 | }
|
---|
394 | // DEBUG
|
---|
395 | //cout << "DAZP = " << DAZP << endl ;
|
---|
396 | //
|
---|
397 | if ( readHeader( DELP, sameEndian ) == -1 ) {
|
---|
398 | os << LogIO::WARN << "Error while reading data DELP." << LogIO::POST ;
|
---|
399 | return -1 ;
|
---|
400 | }
|
---|
401 | // DEBUG
|
---|
402 | //cout << "DELP = " << DELP << endl ;
|
---|
403 | //
|
---|
404 | if ( readHeader( CHBIND, sameEndian ) == -1 ) {
|
---|
405 | os << LogIO::WARN << "Error while reading data CHBIND." << LogIO::POST ;
|
---|
406 | return -1 ;
|
---|
407 | }
|
---|
408 | // DEBUG
|
---|
409 | //cout << "CHBIND = " << CHBIND << endl ;
|
---|
410 | //
|
---|
411 | if ( readHeader( NUMCH, sameEndian ) == -1 ) {
|
---|
412 | os << LogIO::WARN << "Error while reading data NUMCH." << LogIO::POST ;
|
---|
413 | return -1 ;
|
---|
414 | }
|
---|
415 | // DEBUG
|
---|
416 | //cout << "NUMCH = " << NUMCH << endl ;
|
---|
417 | //
|
---|
418 | if ( readHeader( CHMIN, sameEndian ) == -1 ) {
|
---|
419 | os << LogIO::WARN << "Error while reading data CHMIN." << LogIO::POST ;
|
---|
420 | return -1 ;
|
---|
421 | }
|
---|
422 | // DEBUG
|
---|
423 | //cout << "CHMIN = " << CHMIN << endl ;
|
---|
424 | //
|
---|
425 | if ( readHeader( CHMAX, sameEndian ) == -1 ) {
|
---|
426 | os << LogIO::WARN << "Error while reading data CHMAX." << LogIO::POST ;
|
---|
427 | return -1 ;
|
---|
428 | }
|
---|
429 | // DEBUG
|
---|
430 | //cout << "CHMAX = " << CHMAX << endl ;
|
---|
431 | //
|
---|
432 | if ( readHeader( ALCTM, sameEndian ) == -1 ) {
|
---|
433 | os << LogIO::WARN << "Error while reading data ALCTM." << LogIO::POST ;
|
---|
434 | return -1 ;
|
---|
435 | }
|
---|
436 | // DEBUG
|
---|
437 | //cout << "ALCTM = " << ALCTM << endl ;
|
---|
438 | //
|
---|
439 | if ( readHeader( IPTIM, sameEndian ) == -1 ) {
|
---|
440 | os << LogIO::WARN << "Error while reading data IPTIM." << LogIO::POST ;
|
---|
441 | return -1 ;
|
---|
442 | }
|
---|
443 | // DEBUG
|
---|
444 | //cout << "IPTIM = " << IPTIM << endl ;
|
---|
445 | //
|
---|
446 | if ( readHeader( PA, sameEndian ) == -1 ) {
|
---|
447 | os << LogIO::WARN << "Error while reading data PA." << LogIO::POST ;
|
---|
448 | return -1 ;
|
---|
449 | }
|
---|
450 | // DEBUG
|
---|
451 | //cout << "PA = " << PA << endl ;
|
---|
452 | //
|
---|
453 | for ( int i = 0 ; i < arymax ; i++ ) {
|
---|
454 | strcpy( c18, str18.c_str() ) ;
|
---|
455 | if ( readHeader( c18, 16 ) == -1 ) {
|
---|
456 | os << LogIO::WARN << "Error while reading data RX[" << i << "]." << LogIO::POST ;
|
---|
457 | return -1 ;
|
---|
458 | }
|
---|
459 | c18[16] = '\0' ;
|
---|
460 | RX[i] = string( c18 ) ;
|
---|
461 | }
|
---|
462 | // DEBUG
|
---|
463 | // nro_debug_output( "RX", arymax, RX ) ;
|
---|
464 | //
|
---|
465 | for ( int i = 0 ; i < arymax ; i++ ) {
|
---|
466 | if ( readHeader( HPBW[i], sameEndian ) == -1 ) {
|
---|
467 | os << LogIO::WARN << "Error while reading data HPBW[" << i << "]." << LogIO::POST ;
|
---|
468 | return -1 ;
|
---|
469 | }
|
---|
470 | }
|
---|
471 | // DEBUG
|
---|
472 | // nro_debug_output( "HPBW", arymax, HPBW ) ;
|
---|
473 | //
|
---|
474 | for ( int i = 0 ; i < arymax ; i++ ) {
|
---|
475 | if ( readHeader( EFFA[i], sameEndian ) == -1 ) {
|
---|
476 | os << LogIO::WARN << "Error while reading data EFFA[" << i << "]." << LogIO::POST ;
|
---|
477 | return -1 ;
|
---|
478 | }
|
---|
479 | }
|
---|
480 | // DEBUG
|
---|
481 | // nro_debug_output( "EFFA", arymax, EFFA ) ;
|
---|
482 | //
|
---|
483 | for ( int i = 0 ; i < arymax ; i++ ) {
|
---|
484 | if ( readHeader( EFFB[i], sameEndian ) == -1 ) {
|
---|
485 | os << LogIO::WARN << "Error while reading data EFFB[" << i << "]." << LogIO::POST ;
|
---|
486 | return -1 ;
|
---|
487 | }
|
---|
488 | }
|
---|
489 | // DEBUG
|
---|
490 | // nro_debug_output( "EFFB", arymax, EFFB ) ;
|
---|
491 | //
|
---|
492 | for ( int i = 0 ; i < arymax ; i++ ) {
|
---|
493 | if ( readHeader( EFFL[i], sameEndian ) == -1 ) {
|
---|
494 | os << LogIO::WARN << "Error while reading data EFFL[" << i << "]." << LogIO::POST ;
|
---|
495 | return -1 ;
|
---|
496 | }
|
---|
497 | }
|
---|
498 | // DEBUG
|
---|
499 | // nro_debug_output( "EFFL", arymax, EFFL ) ;
|
---|
500 | //
|
---|
501 | for ( int i = 0 ; i < arymax ; i++ ) {
|
---|
502 | if ( readHeader( EFSS[i], sameEndian ) == -1 ) {
|
---|
503 | os << LogIO::WARN << "Error while reading data EFSS[" << i << "]." << LogIO::POST ;
|
---|
504 | return -1 ;
|
---|
505 | }
|
---|
506 | }
|
---|
507 | // DEBUG
|
---|
508 | // nro_debug_output( "EFSS", arymax, EFSS ) ;
|
---|
509 | //
|
---|
510 | for ( int i= 0 ; i < arymax ; i++) {
|
---|
511 | if ( readHeader( GAIN[i], sameEndian ) == -1 ) {
|
---|
512 | os << LogIO::WARN << "Error while reading data GAIN[" << i << "]." << LogIO::POST ;
|
---|
513 | return -1 ;
|
---|
514 | }
|
---|
515 | }
|
---|
516 | // DEBUG
|
---|
517 | // nro_debug_output( "GAIN", arymax, GAIN ) ;
|
---|
518 | //
|
---|
519 | for ( int i= 0 ; i < arymax ; i++) {
|
---|
520 | strcpy( c4, str4.c_str() ) ;
|
---|
521 | if ( readHeader( c4, 4 ) == -1 ) {
|
---|
522 | os << LogIO::WARN << "Error while reading data HORN[" << i << "]." << LogIO::POST ;
|
---|
523 | return -1 ;
|
---|
524 | }
|
---|
525 | HORN[i] = string( c4 ) ;
|
---|
526 | }
|
---|
527 | // DEBUG
|
---|
528 | // nro_debug_output( "HORN", arymax, HORN ) ;
|
---|
529 | //
|
---|
530 | for ( int i= 0 ; i < arymax ; i++) {
|
---|
531 | strcpy( c4, str4.c_str() ) ;
|
---|
532 | if ( readHeader( c4, 4 ) == -1 ) {
|
---|
533 | os << LogIO::WARN << "Error while reading data POLTP[" << i << "]." << LogIO::POST ;
|
---|
534 | return -1 ;
|
---|
535 | }
|
---|
536 | POLTP[i] = string( c4 ) ;
|
---|
537 | }
|
---|
538 | // DEBUG
|
---|
539 | // nro_debug_output( "POLTP", arymax, POLTP ) ;
|
---|
540 | //
|
---|
541 | for ( int i= 0 ; i < arymax ; i++) {
|
---|
542 | if ( readHeader( POLDR[i], sameEndian ) == -1 ) {
|
---|
543 | os << LogIO::WARN << "Error while reading data POLDR[" << i << "]." << LogIO::POST ;
|
---|
544 | return -1 ;
|
---|
545 | }
|
---|
546 | }
|
---|
547 | // DEBUG
|
---|
548 | // nro_debug_output( "POLDR", arymax, POLDR ) ;
|
---|
549 | //
|
---|
550 | for ( int i= 0 ; i < arymax ; i++) {
|
---|
551 | if ( readHeader( POLAN[i], sameEndian ) == -1 ) {
|
---|
552 | os << LogIO::WARN << "Error while reading data POLAN[" << i << "]." << LogIO::POST ;
|
---|
553 | return -1 ;
|
---|
554 | }
|
---|
555 | }
|
---|
556 | // DEBUG
|
---|
557 | // nro_debug_output( "POLAN", arymax, POLAN ) ;
|
---|
558 | //
|
---|
559 | for ( int i= 0 ; i < arymax ; i++) {
|
---|
560 | if ( readHeader( DFRQ[i], sameEndian ) == -1 ) {
|
---|
561 | os << LogIO::WARN << "Error while reading data DFRQ[" << i << "]." << LogIO::POST ;
|
---|
562 | return -1 ;
|
---|
563 | }
|
---|
564 | }
|
---|
565 | // DEBUG
|
---|
566 | // nro_debug_output( "DFRQ", arymax, DFRQ ) ;
|
---|
567 | //
|
---|
568 | for ( int i= 0 ; i < arymax ; i++) {
|
---|
569 | strcpy( c4, str4.c_str() ) ;
|
---|
570 | if ( readHeader( c4, 4 ) == -1 ) {
|
---|
571 | os << LogIO::WARN << "Error while reading data SIDBD[" << i << "]." << LogIO::POST ;
|
---|
572 | return -1 ;
|
---|
573 | }
|
---|
574 | SIDBD[i] = string( c4 ) ;
|
---|
575 | }
|
---|
576 | // DEBUG
|
---|
577 | // nro_debug_output( "SIDBD", arymax, SIDBD ) ;
|
---|
578 | //
|
---|
579 | for ( int i= 0 ; i < arymax ; i++) {
|
---|
580 | if ( readHeader( REFN[i], sameEndian ) == -1 ) {
|
---|
581 | os << LogIO::WARN << "Error while reading data REFN[" << i << "]." << LogIO::POST ;
|
---|
582 | return -1 ;
|
---|
583 | }
|
---|
584 | }
|
---|
585 | // DEBUG
|
---|
586 | // nro_debug_output( "REFN", arymax, REFN ) ;
|
---|
587 | //
|
---|
588 | for ( int i= 0 ; i < arymax ; i++) {
|
---|
589 | if ( readHeader( IPINT[i], sameEndian ) == -1 ) {
|
---|
590 | os << LogIO::WARN << "Error while reading data IPINT[" << i << "]." << LogIO::POST ;
|
---|
591 | return -1 ;
|
---|
592 | }
|
---|
593 | }
|
---|
594 | // DEBUG
|
---|
595 | // nro_debug_output( "IPINT", arymax, IPINT ) ;
|
---|
596 | //
|
---|
597 | for ( int i= 0 ; i < arymax ; i++) {
|
---|
598 | if ( readHeader( MULTN[i], sameEndian ) == -1 ) {
|
---|
599 | os << LogIO::WARN << "Error while reading data MULTN[" << i << "]." << LogIO::POST ;
|
---|
600 | return -1 ;
|
---|
601 | }
|
---|
602 | }
|
---|
603 | // DEBUG
|
---|
604 | // nro_debug_output( "MULTN", arymax, MULTN ) ;
|
---|
605 | //
|
---|
606 | for ( int i= 0 ; i < arymax ; i++) {
|
---|
607 | if ( readHeader( MLTSCF[i], sameEndian ) == -1 ) {
|
---|
608 | os << LogIO::WARN << "Error while reading data MLTSCF[" << i << "]." << LogIO::POST ;
|
---|
609 | return -1 ;
|
---|
610 | }
|
---|
611 | }
|
---|
612 | // DEBUG
|
---|
613 | // nro_debug_output( "MLTSCF", arymax, MLTSCF ) ;
|
---|
614 | //
|
---|
615 | for ( int i= 0 ; i < arymax ; i++) {
|
---|
616 | strcpy( c8, str8.c_str() ) ;
|
---|
617 | if ( readHeader( c8, 8 ) == -1 ) {
|
---|
618 | os << LogIO::WARN << "Error while reading data LAGWIND[" << i << "]." << LogIO::POST ;
|
---|
619 | return -1 ;
|
---|
620 | }
|
---|
621 | LAGWIND[i] = string( c8 ) ;
|
---|
622 | }
|
---|
623 | // DEBUG
|
---|
624 | // nro_debug_output( "LAGWIND", arymax, LAGWIND ) ;
|
---|
625 | //
|
---|
626 | for ( int i= 0 ; i < arymax ; i++) {
|
---|
627 | if ( readHeader( BEBW[i], sameEndian ) == -1 ) {
|
---|
628 | os << LogIO::WARN << "Error while reading data BEBW[" << i << "]." << LogIO::POST ;
|
---|
629 | return -1 ;
|
---|
630 | }
|
---|
631 | }
|
---|
632 | // DEBUG
|
---|
633 | // nro_debug_output( "BEBW", arymax, BEBW ) ;
|
---|
634 | //
|
---|
635 | for ( int i= 0 ; i < arymax ; i++) {
|
---|
636 | if ( readHeader( BERES[i], sameEndian ) == -1 ) {
|
---|
637 | os << LogIO::WARN << "Error while reading data BERES[" << i << "]." << LogIO::POST ;
|
---|
638 | return -1 ;
|
---|
639 | }
|
---|
640 | }
|
---|
641 | // DEBUG
|
---|
642 | // nro_debug_output( "BERES", arymax, BERES ) ;
|
---|
643 | //
|
---|
644 | for ( int i= 0 ; i < arymax ; i++) {
|
---|
645 | if ( readHeader( CHWID[i], sameEndian ) == -1 ) {
|
---|
646 | os << LogIO::WARN << "Error while reading data CHWID[" << i << "]." << LogIO::POST ;
|
---|
647 | return -1 ;
|
---|
648 | }
|
---|
649 | }
|
---|
650 | // DEBUG
|
---|
651 | // nro_debug_output( "CHWID", arymax, CHWID ) ;
|
---|
652 | //
|
---|
653 | for ( int i= 0 ; i < arymax ; i++) {
|
---|
654 | if ( readHeader( ARRY[i], sameEndian ) == -1 ) {
|
---|
655 | os << LogIO::WARN << "Error while reading data ARRY[" << i << "]." << LogIO::POST ;
|
---|
656 | return -1 ;
|
---|
657 | }
|
---|
658 | }
|
---|
659 | // DEBUG
|
---|
660 | // nro_debug_output( "ARRY", arymax, ARRY ) ;
|
---|
661 | //
|
---|
662 | for ( int i= 0 ; i < arymax ; i++) {
|
---|
663 | if ( readHeader( NFCAL[i], sameEndian ) == -1 ) {
|
---|
664 | os << LogIO::WARN << "Error while reading data NFCAL[" << i << "]." << LogIO::POST ;
|
---|
665 | return -1 ;
|
---|
666 | }
|
---|
667 | }
|
---|
668 | // DEBUG
|
---|
669 | // nro_debug_output( "NFCAL", arymax, NFCAL ) ;
|
---|
670 | //
|
---|
671 | for ( int i= 0 ; i < arymax ; i++) {
|
---|
672 | if ( readHeader( F0CAL[i], sameEndian ) == -1 ) {
|
---|
673 | os << LogIO::WARN << "Error while reading data F0CAL[" << i << "]." << LogIO::POST ;
|
---|
674 | return -1 ;
|
---|
675 | }
|
---|
676 | }
|
---|
677 | // DEBUG
|
---|
678 | // nro_debug_output( "F0CAL", arymax, F0CAL ) ;
|
---|
679 | //
|
---|
680 | for ( int i= 0 ; i < arymax ; i++) {
|
---|
681 | for ( int j = 0 ; j < 10 ; j++ ) {
|
---|
682 | if ( readHeader( FQCAL[i][j], sameEndian ) == -1 ) {
|
---|
683 | os << LogIO::WARN << "Error while reading data FQCAL[" << i << "][" << j << "]." << LogIO::POST ;
|
---|
684 | return -1 ;
|
---|
685 | }
|
---|
686 | }
|
---|
687 | }
|
---|
688 | // DEBUG
|
---|
689 | // nro_debug_output( "FQCAL", arymax, 10, FQCAL ) ;
|
---|
690 | //
|
---|
691 | for ( int i= 0 ; i < arymax ; i++) {
|
---|
692 | for ( int j = 0 ; j < 10 ; j++ ) {
|
---|
693 | if ( readHeader( CHCAL[i][j], sameEndian ) == -1 ) {
|
---|
694 | os << LogIO::WARN << "Error while reading data CHCAL[" << i << "][" << j << "]." << LogIO::POST ;
|
---|
695 | return -1 ;
|
---|
696 | }
|
---|
697 | }
|
---|
698 | }
|
---|
699 | // DEBUG
|
---|
700 | // nro_debug_output( "CHCAL", arymax, 10, CHCAL ) ;
|
---|
701 | //
|
---|
702 | for ( int i= 0 ; i < arymax ; i++) {
|
---|
703 | for ( int j = 0 ; j < 10 ; j++ ) {
|
---|
704 | if ( readHeader( CWCAL[i][j], sameEndian ) == -1 ) {
|
---|
705 | os << LogIO::WARN << "Error while reading data CWCAL[" << i << "][" << j << "]." << LogIO::POST ;
|
---|
706 | return -1 ;
|
---|
707 | }
|
---|
708 | }
|
---|
709 | }
|
---|
710 | // DEBUG
|
---|
711 | // nro_debug_output( "CWCAL", arymax, 10, CWCAL ) ;
|
---|
712 | //
|
---|
713 | if ( readHeader( SCNLEN, sameEndian ) == -1 ) {
|
---|
714 | os << LogIO::WARN << "Error while reading data SCNLEN." << LogIO::POST ;
|
---|
715 | return -1 ;
|
---|
716 | }
|
---|
717 | // DEBUG
|
---|
718 | //cout << "SCNLEN = " << SCNLEN << endl ;
|
---|
719 | //
|
---|
720 | if ( readHeader( SBIND, sameEndian ) == -1 ) {
|
---|
721 | os << LogIO::WARN << "Error while reading data SBIND." << LogIO::POST ;
|
---|
722 | return -1 ;
|
---|
723 | }
|
---|
724 | // DEBUG
|
---|
725 | //cout << "SBIND = " << SBIND << endl ;
|
---|
726 | //
|
---|
727 | if ( readHeader( IBIT, sameEndian ) == -1 ) {
|
---|
728 | os << LogIO::WARN << "Error while reading data IBIT." << LogIO::POST ;
|
---|
729 | return -1 ;
|
---|
730 | }
|
---|
731 | // DEBUG
|
---|
732 | //cout << "IBIT = " << IBIT << endl ;
|
---|
733 | //
|
---|
734 | strcpy( c8, str8.c_str() ) ;
|
---|
735 | if ( readHeader( c8, 8 ) == -1 ) {
|
---|
736 | os << LogIO::WARN << "Error while reading data SITE." << LogIO::POST ;
|
---|
737 | return -1 ;
|
---|
738 | }
|
---|
739 | SITE = string( c8 ) ;
|
---|
740 | // DEBUG
|
---|
741 | //cout << "SITE = " << SITE << endl ;
|
---|
742 | //
|
---|
743 | strcpy( c120, str120.c_str() ) ;
|
---|
744 | if ( readHeader( c120, 116 ) == -1 ) {
|
---|
745 | os << LogIO::WARN << "Error while reading data CDMY1." << LogIO::POST ;
|
---|
746 | return -1 ;
|
---|
747 | }
|
---|
748 | c120[116] = '\0' ;
|
---|
749 | CDMY1 = string( c120 ) ;
|
---|
750 | // DEBUG
|
---|
751 | //cout << "CDMY1 = " << CDMY1 << endl ;
|
---|
752 | //
|
---|
753 | for ( int i = 0 ; i < arymax ; i++ ) {
|
---|
754 | if ( readHeader( DSBFC[i], sameEndian ) == -1 ) {
|
---|
755 | os << LogIO::WARN << "Error while reading data DSBFC[" << i << "]." << LogIO::POST ;
|
---|
756 | return -1 ;
|
---|
757 | }
|
---|
758 | }
|
---|
759 | // DEBUG
|
---|
760 | // nro_debug_output( "DSBFC", arymax, DSBFC ) ;
|
---|
761 | //
|
---|
762 |
|
---|
763 | return 0 ;
|
---|
764 | }
|
---|