source: trunk/external-alma/atnf/PKSIO/ASTEDataset.cc@ 2657

Last change on this file since 2657 was 2436, checked in by Takeshi Nakazato, 13 years ago

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No

Module(s): Module Names change impacts.

Description: Describe your changes here...

Defined template function for debug output.


File size: 24.8 KB
Line 
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
38using namespace std ;
39
40// constructor
41ASTEDataset::ASTEDataset( string name )
42 : NRODataset( name )
43{
44 LogIO os( LogOrigin( "ASTEDataset", "ASTEDataset()", WHERE ) ) ;
45
46 // check endian
47 open() ;
48 fseek( fp_, 144, SEEK_SET ) ;
49 int tmp ;
50 if( fread( &tmp, 1, sizeof(int), fp_ ) != sizeof(int) ) {
51 os << LogIO::SEVERE << "Error while checking endian of the file. " << LogIO::POST ;
52 return ;
53 }
54 if ( ( 0 < tmp ) && ( tmp <= ASTE_ARYMAX ) ) {
55 same_ = true ;
56 os << LogIO::NORMAL << "same endian " << LogIO::POST ;
57 }
58 else {
59 same_ = false ;
60 os << LogIO::NORMAL << "different endian " << LogIO::POST ;
61 }
62 fseek( fp_, 0, SEEK_SET ) ;
63
64 // memory allocation
65 initialize() ;
66}
67
68// destructor
69ASTEDataset::~ASTEDataset()
70{
71}
72
73// data initialization
74void ASTEDataset::initialize()
75{
76 RX.resize( ASTE_ARYMAX ) ;
77 HPBW.resize( ASTE_ARYMAX ) ;
78 EFFA.resize( ASTE_ARYMAX ) ;
79 EFFB.resize( ASTE_ARYMAX ) ;
80 EFFL.resize( ASTE_ARYMAX ) ;
81 EFSS.resize( ASTE_ARYMAX ) ;
82 GAIN.resize( ASTE_ARYMAX ) ;
83 HORN.resize( ASTE_ARYMAX ) ;
84 POLTP.resize( ASTE_ARYMAX ) ;
85 POLDR.resize( ASTE_ARYMAX ) ;
86 POLAN.resize( ASTE_ARYMAX ) ;
87 DFRQ.resize( ASTE_ARYMAX ) ;
88 SIDBD.resize( ASTE_ARYMAX ) ;
89 REFN.resize( ASTE_ARYMAX ) ;
90 IPINT.resize( ASTE_ARYMAX ) ;
91 MULTN.resize( ASTE_ARYMAX ) ;
92 MLTSCF.resize( ASTE_ARYMAX ) ;
93 LAGWIND.resize( ASTE_ARYMAX ) ;
94 BEBW.resize( ASTE_ARYMAX ) ;
95 BERES.resize( ASTE_ARYMAX ) ;
96 CHWID.resize( ASTE_ARYMAX ) ;
97 ARRY.resize( ASTE_ARYMAX ) ;
98 NFCAL.resize( ASTE_ARYMAX ) ;
99 F0CAL.resize( ASTE_ARYMAX ) ;
100 FQCAL.resize( ASTE_ARYMAX ) ;
101 CHCAL.resize( ASTE_ARYMAX ) ;
102 CWCAL.resize( ASTE_ARYMAX ) ;
103 DSBFC.resize( ASTE_ARYMAX ) ;
104
105 for ( int i = 0 ; i < ASTE_ARYMAX ; i++ ) {
106 FQCAL[i].resize( 10 ) ;
107 CHCAL[i].resize( 10 ) ;
108 CWCAL[i].resize( 10 ) ;
109 }
110
111 datasize_ += sizeof( char ) * ASTE_ARYMAX * 16 // RX
112 + sizeof( double ) * ASTE_ARYMAX * 6 // HPBW, EFFA, EFFB, EFFL, EFSS GAIN
113 + sizeof( char ) * ASTE_ARYMAX * 4 // HORN
114 + sizeof( char ) * ASTE_ARYMAX * 4 // POLTP
115 + sizeof( double ) * ASTE_ARYMAX * 3 // POLDR, POLAN, DFRQ
116 + sizeof( char ) * ASTE_ARYMAX * 4 // SIDBID
117 + sizeof( int ) * ASTE_ARYMAX * 3 // REFN, IPINT, MULTN
118 + sizeof( double ) * ASTE_ARYMAX // MLTSCF
119 + sizeof( char ) * ASTE_ARYMAX * 8 // LAGWIND
120 + sizeof( double ) * ASTE_ARYMAX * 3 // BEBW, BERES, CHWID
121 + sizeof( int ) * ASTE_ARYMAX * 2 // ARRY, NFCAL
122 + sizeof( double ) * ASTE_ARYMAX // F0CAL
123 + sizeof( double ) * ASTE_ARYMAX * 10 * 3 // FQCAL, CHCAL, CWCAL
124 + sizeof( char ) * 116 // CDMY1
125 + sizeof( double ) * ASTE_ARYMAX ; // DSBFC
126
127 refFreq_.resize( ASTE_ARYMAX, 0.0 ) ;
128}
129
130// fill data header
131int ASTEDataset::fillHeader()
132{
133 LogIO os( LogOrigin( "ASTEDataset", "fillHeader()", WHERE ) ) ;
134
135 // open file
136 if ( open() ) {
137 os << LogIO::SEVERE << "Error opening file " << filename_ << "." << LogIO::EXCEPTION ;
138 return -1 ;
139 }
140
141 // fill
142 int status = fillHeader( same_ ) ;
143
144 return status ;
145}
146
147int ASTEDataset::fillHeader( int sameEndian )
148{
149 LogIO os( LogOrigin( "ASTEDataset", "fillHeader()", WHERE ) ) ;
150
151 string str4( 4, ' ' ) ;
152 string str8( 8, ' ' ) ;
153 string str16( 16, ' ' ) ;
154 string str18( 18, ' ' ) ;
155 string str24( 24, ' ' ) ;
156 string str40( 40, ' ' ) ;
157 string str120( 120, ' ' ) ;
158 char c4[4] ;
159 char c8[8] ;
160 char c16[16] ;
161 char c18[18] ;
162 char c24[24] ;
163 char c40[40] ;
164 char c120[120] ;
165 // make sure file pointer points a beginning of the file
166 fseek( fp_, 0, SEEK_SET ) ;
167
168 // read data header
169 strcpy( c8, str8.c_str() ) ;
170 if ( readHeader( c8, 8 ) == -1 ) {
171 os << LogIO::WARN << "Error while reading data LOFIL." << LogIO::POST ;
172 return -1 ;
173 }
174 LOFIL = string( c8 ) ;
175 // DEBUG
176 //cout << "LOFIL = " << LOFIL << endl ;
177 //
178 strcpy( c8, str8.c_str() ) ;
179 if ( readHeader( c8, 8 ) == -1 ) {
180 os << LogIO::WARN << "Error while reading data VER." << LogIO::POST ;
181 return -1 ;
182 }
183 VER = string( c8 ) ;
184 // DEBUG
185 //cout << "VER = " << VER << endl ;
186 //
187 strcpy( c16, str16.c_str() ) ;
188 if ( readHeader( c16, 16 ) == -1 ) {
189 os << LogIO::WARN << "Error while reading data GROUP." << LogIO::POST ;
190 return -1 ;
191 }
192 GROUP = string( c16 ) ;
193 // DEBUG
194 //cout << "GROUP = " << GROUP << endl ;
195 //
196 strcpy( c16, str16.c_str() ) ;
197 if ( readHeader( c16, 16 ) == -1 ) {
198 os << LogIO::WARN << "Error while reading data PROJ." << LogIO::POST ;
199 return -1 ;
200 }
201 PROJ = string( c16 ) ;
202 // DEBUG
203 //cout << "PROJ = " << PROJ << endl ;
204 //
205 strcpy( c24, str24.c_str() ) ;
206 if ( readHeader( c24, 24 ) == -1 ) {
207 os << LogIO::WARN << "Error while reading data SCHED." << LogIO::POST ;
208 return -1 ;
209 }
210 SCHED = string( c24 ) ;
211 // DEBUG
212 //cout << "SCHED = " << SCHED << endl ;
213 //
214 strcpy( c40, str40.c_str() ) ;
215 if ( readHeader( c40, 40 ) == -1 ) {
216 os << LogIO::WARN << "Error while reading data OBSVR." << LogIO::POST ;
217 return -1 ;
218 }
219 OBSVR = string( c40 ) ;
220 // DEBUG
221 //cout << "OBSVR = " << OBSVR << endl ;
222 //
223 strcpy( c16, str16.c_str() ) ;
224 if ( readHeader( c16, 16 ) == -1 ) {
225 os << LogIO::WARN << "Error while reading data LOSTM." << LogIO::POST ;
226 return -1 ;
227 }
228 LOSTM = string( c16 ) ;
229 // DEBUG
230 //cout << "LOSTM = " << LOSTM << endl ;
231 //
232 strcpy( c16, str16.c_str() ) ;
233 if ( readHeader( c16, 16 ) == -1 ) {
234 os << LogIO::WARN << "Error while reading data LOETM." << LogIO::POST ;
235 return -1 ;
236 }
237 LOETM = string( c16 ) ;
238 // DEBUG
239 //cout << "LOETM = " << LOETM << endl ;
240 //
241 if ( readHeader( ARYNM, sameEndian ) == -1 ) {
242 os << LogIO::WARN << "Error while reading data ARYNM." << LogIO::POST ;
243 return -1 ;
244 }
245 // DEBUG
246 //cout << "ARYNM = " << ARYNM << endl ;
247 //
248 if ( readHeader( NSCAN, sameEndian ) == -1 ) {
249 os << LogIO::WARN << "Error while reading data NSCAN." << LogIO::POST ;
250 return -1 ;
251 }
252 // DEBUG
253 //cout << "NSCAN = " << NSCAN << endl ;
254 //
255 strcpy( c120, str120.c_str() ) ;
256 if ( readHeader( c120, 120 ) == -1 ) {
257 os << LogIO::WARN << "Error while reading data TITLE." << LogIO::POST ;
258 return -1 ;
259 }
260 TITLE = string( c120 ) ;
261 // DEBUG
262 //cout << "TITLE = " << TITLE << endl ;
263 //
264 strcpy( c16, str16.c_str() ) ;
265 if ( readHeader( c16, 16 ) == -1 ) {
266 os << LogIO::WARN << "Error while reading data OBJ." << LogIO::POST ;
267 return -1 ;
268 }
269 OBJ = string( c16 ) ;
270 // DEBUG
271 //cout << "OBJ = " << OBJ << endl ;
272 //
273 strcpy( c8, str8.c_str() ) ;
274 if ( readHeader( c8, 8 ) == -1 ) {
275 os << LogIO::WARN << "Error while reading data EPOCH." << LogIO::POST ;
276 return -1 ;
277 }
278 EPOCH = string( c8 ) ;
279 // DEBUG
280 //cout << "EPOCH = " << EPOCH << endl ;
281 //
282 if ( readHeader( RA0, sameEndian ) == -1 ) {
283 os << LogIO::WARN << "Error while reading data RA0." << LogIO::POST ;
284 return -1 ;
285 }
286 // DEBUG
287 //cout << "RA0 = " << RA0 << endl ;
288 //
289 if ( readHeader( DEC0, sameEndian ) == -1 ) {
290 os << LogIO::WARN << "Error while reading data DEC0." << LogIO::POST ;
291 return -1 ;
292 }
293 // DEBUG
294 //cout << "DEC0 = " << DEC0 << endl ;
295 //
296 if ( readHeader( GLNG0, sameEndian ) == -1 ) {
297 os << LogIO::WARN << "Error while reading data GLNG0." << LogIO::POST ;
298 return -1 ;
299 }
300 // DEBUG
301 //cout << "GLNG0 = " << GLNG0 << endl ;
302 //
303 if ( readHeader( GLAT0, sameEndian ) == -1 ) {
304 os << LogIO::WARN << "Error while reading data GLAT0." << LogIO::POST ;
305 return -1 ;
306 }
307 // DEBUG
308 //cout << "GLAT0 = " << GLAT0 << endl ;
309 //
310 if ( readHeader( NCALB, sameEndian ) == -1 ) {
311 os << LogIO::WARN << "Error while reading data NCALB." << LogIO::POST ;
312 return -1 ;
313 }
314 // DEBUG
315 //cout << "NCALB = " << NCALB << endl ;
316 //
317 if ( readHeader( SCNCD, sameEndian ) == -1 ) {
318 os << LogIO::WARN << "Error while reading data SCNCD." << LogIO::POST ;
319 return -1 ;
320 }
321 // DEBUG
322 //cout << "SCNCD = " << SCNCD << endl ;
323 //
324 strcpy( c120, str120.c_str() ) ;
325 if ( readHeader( c120, 120 ) == -1 ) {
326 os << LogIO::WARN << "Error while reading data SCMOD." << LogIO::POST ;
327 return -1 ;
328 }
329 SCMOD = string( c120 ) ;
330 // DEBUG
331 //cout << "SCMOD = " << SCMOD << endl ;
332 //
333 if ( readHeader( URVEL, sameEndian ) == -1 ) {
334 os << LogIO::WARN << "Error while reading data URVEL." << LogIO::POST ;
335 return -1 ;
336 }
337 // DEBUG
338 //cout << "URVEL = " << URVEL << endl ;
339 //
340 strcpy( c4, str4.c_str() ) ;
341 if ( readHeader( c4, 4 ) == -1 ) {
342 os << LogIO::WARN << "Error while reading data VREF." << LogIO::POST ;
343 return -1 ;
344 }
345 VREF = string( c4 ) ;
346 // DEBUG
347 //cout << "VREF = " << VREF << endl ;
348 //
349 strcpy( c4, str4.c_str() ) ;
350 if ( readHeader( c4, 4 ) == -1 ) {
351 os << LogIO::WARN << "Error while reading data VDEF." << LogIO::POST ;
352 return -1 ;
353 }
354 VDEF = string( c4 ) ;
355 // DEBUG
356 //cout << "VDEF = " << VDEF << endl ;
357 //
358 strcpy( c8, str8.c_str() ) ;
359 if ( readHeader( c8, 8 ) == -1 ) {
360 os << LogIO::WARN << "Error while reading data SWMOD." << LogIO::POST ;
361 return -1 ;
362 }
363 SWMOD = string( c8 ) + "::OTF" ;
364 // DEBUG
365 //cout << "SWMOD = " << SWMOD << endl ;
366 //
367 if ( readHeader( FRQSW, sameEndian ) == -1 ) {
368 os << LogIO::WARN << "Error while reading data FRQSW." << LogIO::POST ;
369 return -1 ;
370 }
371 // DEBUG
372 //cout << "FRQSW = " << FRQSW << endl ;
373 //
374 if ( readHeader( DBEAM, sameEndian ) == -1 ) {
375 os << LogIO::WARN << "Error while reading data DBEAM." << LogIO::POST ;
376 return -1 ;
377 }
378 // DEBUG
379 //cout << "DBEAM = " << DBEAM << endl ;
380 //
381 if ( readHeader( MLTOF, sameEndian ) == -1 ) {
382 os << LogIO::WARN << "Error while reading data MLTOF." << LogIO::POST ;
383 return -1 ;
384 }
385 // DEBUG
386 //cout << "MLTOF = " << MLTOF << endl ;
387 //
388 if ( readHeader( CMTQ, sameEndian ) == -1 ) {
389 os << LogIO::WARN << "Error while reading data CMTQ." << LogIO::POST ;
390 return -1 ;
391 }
392 // DEBUG
393 //cout << "CMTQ = " << CMTQ << endl ;
394 //
395 if ( readHeader( CMTE, sameEndian ) == -1 ) {
396 os << LogIO::WARN << "Error while reading data CMTE." << LogIO::POST ;
397 return -1 ;
398 }
399 // DEBUG
400 //cout << "CMTE = " << CMTE << endl ;
401 //
402 if ( readHeader( CMTSOM, sameEndian ) == -1 ) {
403 os << LogIO::WARN << "Error while reading data CMTSOM." << LogIO::POST ;
404 return -1 ;
405 }
406 // DEBUG
407 //cout << "CMTSOM = " << CMTSOM << endl ;
408 //
409 if ( readHeader( CMTNODE, sameEndian ) == -1 ) {
410 os << LogIO::WARN << "Error while reading data CMTNODE." << LogIO::POST ;
411 return -1 ;
412 }
413 // DEBUG
414 //cout << "CMTNODE = " << CMTNODE << endl ;
415 //
416 if ( readHeader( CMTI, sameEndian ) == -1 ) {
417 os << LogIO::WARN << "Error while reading data CMTI." << LogIO::POST ;
418 return -1 ;
419 }
420 // DEBUG
421 //cout << "CMTI = " << CMTI << endl ;
422 //
423 strcpy( c24, str24.c_str() ) ;
424 if ( readHeader( c24, 24 ) == -1 ) {
425 os << LogIO::WARN << "Error while reading data CMTTM." << LogIO::POST ;
426 return -1 ;
427 }
428 CMTTM = string( c24 ) ;
429 // DEBUG
430 //cout << "CMTTM = " << CMTTM << endl ;
431 //
432 if ( readHeader( SBDX, sameEndian ) == -1 ) {
433 os << LogIO::WARN << "Error while reading data SBDX." << LogIO::POST ;
434 return -1 ;
435 }
436 // DEBUG
437 //cout << "SBDX = " << SBDX << endl ;
438 //
439 if ( readHeader( SBDY, sameEndian ) == -1 ) {
440 os << LogIO::WARN << "Error while reading data SBDY." << LogIO::POST ;
441 return -1 ;
442 }
443 // DEBUG
444 //cout << "SBDY = " << SBDY << endl ;
445 //
446 if ( readHeader( SBDZ1, sameEndian ) == -1 ) {
447 os << LogIO::WARN << "Error while reading data SBDZ1." << LogIO::POST ;
448 return -1 ;
449 }
450 // DEBUG
451 //cout << "SBDZ1 = " << SBDZ1 << endl ;
452 //
453 if ( readHeader( SBDZ2, sameEndian ) == -1 ) {
454 os << LogIO::WARN << "Error while reading data SBDZ2." << LogIO::POST ;
455 return -1 ;
456 }
457 // DEBUG
458 //cout << "SBDZ2 = " << SBDZ2 << endl ;
459 //
460 if ( readHeader( DAZP, sameEndian ) == -1 ) {
461 os << LogIO::WARN << "Error while reading data DAZP." << LogIO::POST ;
462 return -1 ;
463 }
464 // DEBUG
465 //cout << "DAZP = " << DAZP << endl ;
466 //
467 if ( readHeader( DELP, sameEndian ) == -1 ) {
468 os << LogIO::WARN << "Error while reading data DELP." << LogIO::POST ;
469 return -1 ;
470 }
471 // DEBUG
472 //cout << "DELP = " << DELP << endl ;
473 //
474 if ( readHeader( CHBIND, sameEndian ) == -1 ) {
475 os << LogIO::WARN << "Error while reading data CHBIND." << LogIO::POST ;
476 return -1 ;
477 }
478 // DEBUG
479 //cout << "CHBIND = " << CHBIND << endl ;
480 //
481 if ( readHeader( NUMCH, sameEndian ) == -1 ) {
482 os << LogIO::WARN << "Error while reading data NUMCH." << LogIO::POST ;
483 return -1 ;
484 }
485 // DEBUG
486 //cout << "NUMCH = " << NUMCH << endl ;
487 //
488 if ( readHeader( CHMIN, sameEndian ) == -1 ) {
489 os << LogIO::WARN << "Error while reading data CHMIN." << LogIO::POST ;
490 return -1 ;
491 }
492 // DEBUG
493 //cout << "CHMIN = " << CHMIN << endl ;
494 //
495 if ( readHeader( CHMAX, sameEndian ) == -1 ) {
496 os << LogIO::WARN << "Error while reading data CHMAX." << LogIO::POST ;
497 return -1 ;
498 }
499 // DEBUG
500 //cout << "CHMAX = " << CHMAX << endl ;
501 //
502 if ( readHeader( ALCTM, sameEndian ) == -1 ) {
503 os << LogIO::WARN << "Error while reading data ALCTM." << LogIO::POST ;
504 return -1 ;
505 }
506 // DEBUG
507 //cout << "ALCTM = " << ALCTM << endl ;
508 //
509 if ( readHeader( IPTIM, sameEndian ) == -1 ) {
510 os << LogIO::WARN << "Error while reading data IPTIM." << LogIO::POST ;
511 return -1 ;
512 }
513 // DEBUG
514 //cout << "IPTIM = " << IPTIM << endl ;
515 //
516 if ( readHeader( PA, sameEndian ) == -1 ) {
517 os << LogIO::WARN << "Error while reading data PA." << LogIO::POST ;
518 return -1 ;
519 }
520 // DEBUG
521 //cout << "PA = " << PA << endl ;
522 //
523 for ( int i = 0 ; i < ASTE_ARYMAX ; i++ ) {
524 strcpy( c18, str18.c_str() ) ;
525 if ( readHeader( c18, 16 ) == -1 ) {
526 os << LogIO::WARN << "Error while reading data RX[" << i << "]." << LogIO::POST ;
527 return -1 ;
528 }
529 c18[16] = '\0' ;
530 RX[i] = string( c18 ) ;
531 }
532 // DEBUG
533// nro_debug_output( "RX", ASTE_ARYMAX, RX ) ;
534 //
535 for ( int i = 0 ; i < ASTE_ARYMAX ; i++ ) {
536 if ( readHeader( HPBW[i], sameEndian ) == -1 ) {
537 os << LogIO::WARN << "Error while reading data HPBW[" << i << "]." << LogIO::POST ;
538 return -1 ;
539 }
540 }
541 // DEBUG
542// nro_debug_output( "HPBW", ASTE_ARYMAX, HPBW ) ;
543 //
544 for ( int i = 0 ; i < ASTE_ARYMAX ; i++ ) {
545 if ( readHeader( EFFA[i], sameEndian ) == -1 ) {
546 os << LogIO::WARN << "Error while reading data EFFA[" << i << "]." << LogIO::POST ;
547 return -1 ;
548 }
549 }
550 // DEBUG
551// nro_debug_output( "EFFA", ASTE_ARYMAX, EFFA ) ;
552 //
553 for ( int i = 0 ; i < ASTE_ARYMAX ; i++ ) {
554 if ( readHeader( EFFB[i], sameEndian ) == -1 ) {
555 os << LogIO::WARN << "Error while reading data EFFB[" << i << "]." << LogIO::POST ;
556 return -1 ;
557 }
558 }
559 // DEBUG
560// nro_debug_output( "EFFB", ASTE_ARYMAX, EFFB ) ;
561 //
562 for ( int i = 0 ; i < ASTE_ARYMAX ; i++ ) {
563 if ( readHeader( EFFL[i], sameEndian ) == -1 ) {
564 os << LogIO::WARN << "Error while reading data EFFL[" << i << "]." << LogIO::POST ;
565 return -1 ;
566 }
567 }
568 // DEBUG
569// nro_debug_output( "EFFL", ASTE_ARYMAX, EFFL ) ;
570 //
571 for ( int i = 0 ; i < ASTE_ARYMAX ; i++ ) {
572 if ( readHeader( EFSS[i], sameEndian ) == -1 ) {
573 os << LogIO::WARN << "Error while reading data EFSS[" << i << "]." << LogIO::POST ;
574 return -1 ;
575 }
576 }
577 // DEBUG
578// nro_debug_output( "EFSS", ASTE_ARYMAX, EFSS ) ;
579 //
580 for ( int i= 0 ; i < ASTE_ARYMAX ; i++) {
581 if ( readHeader( GAIN[i], sameEndian ) == -1 ) {
582 os << LogIO::WARN << "Error while reading data GAIN[" << i << "]." << LogIO::POST ;
583 return -1 ;
584 }
585 }
586 // DEBUG
587// nro_debug_output( "GAIN", ASTE_ARYMAX, GAIN ) ;
588 //
589 for ( int i= 0 ; i < ASTE_ARYMAX ; i++) {
590 strcpy( c4, str4.c_str() ) ;
591 if ( readHeader( c4, 4 ) == -1 ) {
592 os << LogIO::WARN << "Error while reading data HORN[" << i << "]." << LogIO::POST ;
593 return -1 ;
594 }
595 HORN[i] = string( c4 ) ;
596 }
597 // DEBUG
598// nro_debug_output( "HORN", ASTE_ARYMAX, HORN ) ;
599 //
600 for ( int i= 0 ; i < ASTE_ARYMAX ; i++) {
601 strcpy( c4, str4.c_str() ) ;
602 if ( readHeader( c4, 4 ) == -1 ) {
603 os << LogIO::WARN << "Error while reading data POLTP[" << i << "]." << LogIO::POST ;
604 return -1 ;
605 }
606 POLTP[i] = string( c4 ) ;
607 }
608 // DEBUG
609// nro_debug_output( "POLTP", ASTE_ARYMAX, POLTP ) ;
610 //
611 for ( int i= 0 ; i < ASTE_ARYMAX ; i++) {
612 if ( readHeader( POLDR[i], sameEndian ) == -1 ) {
613 os << LogIO::WARN << "Error while reading data POLDR[" << i << "]." << LogIO::POST ;
614 return -1 ;
615 }
616 }
617 // DEBUG
618// nro_debug_output( "POLDR", ASTE_ARYMAX, POLDR ) ;
619 //
620 for ( int i= 0 ; i < ASTE_ARYMAX ; i++) {
621 if ( readHeader( POLAN[i], sameEndian ) == -1 ) {
622 os << LogIO::WARN << "Error while reading data POLAN[" << i << "]." << LogIO::POST ;
623 return -1 ;
624 }
625 }
626 // DEBUG
627// nro_debug_output( "POLAN", ASTE_ARYMAX, POLAN ) ;
628 //
629 for ( int i= 0 ; i < ASTE_ARYMAX ; i++) {
630 if ( readHeader( DFRQ[i], sameEndian ) == -1 ) {
631 os << LogIO::WARN << "Error while reading data DFRQ[" << i << "]." << LogIO::POST ;
632 return -1 ;
633 }
634 }
635 // DEBUG
636// nro_debug_output( "DFRQ", ASTE_ARYMAX, DFRQ ) ;
637 //
638 for ( int i= 0 ; i < ASTE_ARYMAX ; i++) {
639 strcpy( c4, str4.c_str() ) ;
640 if ( readHeader( c4, 4 ) == -1 ) {
641 os << LogIO::WARN << "Error while reading data SIDBD[" << i << "]." << LogIO::POST ;
642 return -1 ;
643 }
644 SIDBD[i] = string( c4 ) ;
645 }
646 // DEBUG
647// nro_debug_output( "SIDBD", ASTE_ARYMAX, SIDBD ) ;
648 //
649 for ( int i= 0 ; i < ASTE_ARYMAX ; i++) {
650 if ( readHeader( REFN[i], sameEndian ) == -1 ) {
651 os << LogIO::WARN << "Error while reading data REFN[" << i << "]." << LogIO::POST ;
652 return -1 ;
653 }
654 }
655 // DEBUG
656// nro_debug_output( "REFN", ASTE_ARYMAX, REFN ) ;
657 //
658 for ( int i= 0 ; i < ASTE_ARYMAX ; i++) {
659 if ( readHeader( IPINT[i], sameEndian ) == -1 ) {
660 os << LogIO::WARN << "Error while reading data IPINT[" << i << "]." << LogIO::POST ;
661 return -1 ;
662 }
663 }
664 // DEBUG
665// nro_debug_output( "IPINT", ASTE_ARYMAX, IPINT ) ;
666 //
667 for ( int i= 0 ; i < ASTE_ARYMAX ; i++) {
668 if ( readHeader( MULTN[i], sameEndian ) == -1 ) {
669 os << LogIO::WARN << "Error while reading data MULTN[" << i << "]." << LogIO::POST ;
670 return -1 ;
671 }
672 }
673 // DEBUG
674// nro_debug_output( "MULTN", ASTE_ARYMAX, MULTN ) ;
675 //
676 for ( int i= 0 ; i < ASTE_ARYMAX ; i++) {
677 if ( readHeader( MLTSCF[i], sameEndian ) == -1 ) {
678 os << LogIO::WARN << "Error while reading data MLTSCF[" << i << "]." << LogIO::POST ;
679 return -1 ;
680 }
681 }
682 // DEBUG
683// nro_debug_output( "MLTSCF", ASTE_ARYMAX, MLTSCF ) ;
684 //
685 for ( int i= 0 ; i < ASTE_ARYMAX ; i++) {
686 strcpy( c8, str8.c_str() ) ;
687 if ( readHeader( c8, 8 ) == -1 ) {
688 os << LogIO::WARN << "Error while reading data LAGWIND[" << i << "]." << LogIO::POST ;
689 return -1 ;
690 }
691 LAGWIND[i] = string( c8 ) ;
692 }
693 // DEBUG
694// nro_debug_output( "LAGWIND", ASTE_ARYMAX, LAGWIND ) ;
695 //
696 for ( int i= 0 ; i < ASTE_ARYMAX ; i++) {
697 if ( readHeader( BEBW[i], sameEndian ) == -1 ) {
698 os << LogIO::WARN << "Error while reading data BEBW[" << i << "]." << LogIO::POST ;
699 return -1 ;
700 }
701 }
702 // DEBUG
703// nro_debug_output( "BEBW", ASTE_ARYMAX, BEBW ) ;
704 //
705 for ( int i= 0 ; i < ASTE_ARYMAX ; i++) {
706 if ( readHeader( BERES[i], sameEndian ) == -1 ) {
707 os << LogIO::WARN << "Error while reading data BERES[" << i << "]." << LogIO::POST ;
708 return -1 ;
709 }
710 }
711 // DEBUG
712// nro_debug_output( "BERES", ASTE_ARYMAX, BERES ) ;
713 //
714 for ( int i= 0 ; i < ASTE_ARYMAX ; i++) {
715 if ( readHeader( CHWID[i], sameEndian ) == -1 ) {
716 os << LogIO::WARN << "Error while reading data CHWID[" << i << "]." << LogIO::POST ;
717 return -1 ;
718 }
719 }
720 // DEBUG
721// nro_debug_output( "CHWID", ASTE_ARYMAX, CHWID ) ;
722 //
723 for ( int i= 0 ; i < ASTE_ARYMAX ; i++) {
724 if ( readHeader( ARRY[i], sameEndian ) == -1 ) {
725 os << LogIO::WARN << "Error while reading data ARRY[" << i << "]." << LogIO::POST ;
726 return -1 ;
727 }
728 }
729 // DEBUG
730// nro_debug_output( "ARRY", ASTE_ARYMAX, ARRY ) ;
731 //
732 for ( int i= 0 ; i < ASTE_ARYMAX ; i++) {
733 if ( readHeader( NFCAL[i], sameEndian ) == -1 ) {
734 os << LogIO::WARN << "Error while reading data NFCAL[" << i << "]." << LogIO::POST ;
735 return -1 ;
736 }
737 }
738 // DEBUG
739// nro_debug_output( "NFCAL", ASTE_ARYMAX, NFCAL ) ;
740 //
741 for ( int i= 0 ; i < ASTE_ARYMAX ; i++) {
742 if ( readHeader( F0CAL[i], sameEndian ) == -1 ) {
743 os << LogIO::WARN << "Error while reading data F0CAL[" << i << "]." << LogIO::POST ;
744 return -1 ;
745 }
746 }
747 // DEBUG
748// nro_debug_output( "F0CAL", ASTE_ARYMAX, F0CAL ) ;
749 //
750 for ( int i= 0 ; i < ASTE_ARYMAX ; i++) {
751 for ( int j = 0 ; j < 10 ; j++ ) {
752 if ( readHeader( FQCAL[i][j], sameEndian ) == -1 ) {
753 os << LogIO::WARN << "Error while reading data FQCAL[" << i << "][" << j << "]." << LogIO::POST ;
754 return -1 ;
755 }
756 }
757 }
758 // DEBUG
759// nro_debug_output( "FQCAL", ASTE_ARYMAX, 10, FQCAL ) ;
760 //
761 for ( int i= 0 ; i < ASTE_ARYMAX ; i++) {
762 for ( int j = 0 ; j < 10 ; j++ ) {
763 if ( readHeader( CHCAL[i][j], sameEndian ) == -1 ) {
764 os << LogIO::WARN << "Error while reading data CHCAL[" << i << "][" << j << "]." << LogIO::POST ;
765 return -1 ;
766 }
767 }
768 }
769 // DEBUG
770// nro_debug_output( "CHCAL", ASTE_ARYMAX, 10, CHCAL ) ;
771 //
772 for ( int i= 0 ; i < ASTE_ARYMAX ; i++) {
773 for ( int j = 0 ; j < 10 ; j++ ) {
774 if ( readHeader( CWCAL[i][j], sameEndian ) == -1 ) {
775 os << LogIO::WARN << "Error while reading data CWCAL[" << i << "][" << j << "]." << LogIO::POST ;
776 return -1 ;
777 }
778 }
779 }
780 // DEBUG
781// nro_debug_output( "CWCAL", ASTE_ARYMAX, 10, CWCAL ) ;
782 //
783 if ( readHeader( SCNLEN, sameEndian ) == -1 ) {
784 os << LogIO::WARN << "Error while reading data SCNLEN." << LogIO::POST ;
785 return -1 ;
786 }
787 // DEBUG
788 //cout << "SCNLEN = " << SCNLEN << endl ;
789 //
790 if ( readHeader( SBIND, sameEndian ) == -1 ) {
791 os << LogIO::WARN << "Error while reading data SBIND." << LogIO::POST ;
792 return -1 ;
793 }
794 // DEBUG
795 //cout << "SBIND = " << SBIND << endl ;
796 //
797 if ( readHeader( IBIT, sameEndian ) == -1 ) {
798 os << LogIO::WARN << "Error while reading data IBIT." << LogIO::POST ;
799 return -1 ;
800 }
801 // DEBUG
802 //cout << "IBIT = " << IBIT << endl ;
803 //
804 strcpy( c8, str8.c_str() ) ;
805 if ( readHeader( c8, 8 ) == -1 ) {
806 os << LogIO::WARN << "Error while reading data SITE." << LogIO::POST ;
807 return -1 ;
808 }
809 SITE = string( c8 ) ;
810 // DEBUG
811 //cout << "SITE = " << SITE << endl ;
812 //
813 strcpy( c120, str120.c_str() ) ;
814 if ( readHeader( c120, 116 ) == -1 ) {
815 os << LogIO::WARN << "Error while reading data CDMY1." << LogIO::POST ;
816 return -1 ;
817 }
818 c120[116] = '\0' ;
819 CDMY1 = string( c120 ) ;
820 // DEBUG
821 //cout << "CDMY1 = " << CDMY1 << endl ;
822 //
823 for ( int i = 0 ; i < ASTE_ARYMAX ; i++ ) {
824 if ( readHeader( DSBFC[i], sameEndian ) == -1 ) {
825 os << LogIO::WARN << "Error while reading data DSBFC[" << i << "]." << LogIO::POST ;
826 return -1 ;
827 }
828 }
829 // DEBUG
830// nro_debug_output( "DSBFC", ASTE_ARYMAX, DSBFC ) ;
831 //
832
833
834 scanNum_ = NSCAN + 1 ; // includes ZERO scan
835 rowNum_ = scanNum_ * ARYNM ;
836 scanLen_ = SCNLEN ;
837 dataLen_ = scanLen_ - SCAN_HEADER_SIZE ;
838 chmax_ = (int) ( dataLen_ * 8 / IBIT ) ;
839 record_->LDATA = new char[dataLen_] ;
840
841 show() ;
842
843 return 0 ;
844}
Note: See TracBrowser for help on using the repository browser.