source: trunk/external-alma/atnf/PKSIO/NROOTFDataset.cc@ 2784

Last change on this file since 2784 was 2783, checked in by Takeshi Nakazato, 12 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...

more refactoring on NRO filler.


File size: 3.5 KB
RevLine 
[1757]1//#---------------------------------------------------------------------------
2//# NROOTFDataset.cc: Class for NRO 45m OTF 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: 2009/02/27, Takeshi Nakazato, NAOJ
31//#---------------------------------------------------------------------------
32
33#include <atnf/PKSIO/NROOTFDataset.h>
34
35#include <iostream>
36#include <cstring>
37
38using namespace std ;
39
40// constructor
41NROOTFDataset::NROOTFDataset( string name )
42 : NRODataset( name )
[2782]43{}
[1757]44
45// destructor
46NROOTFDataset::~NROOTFDataset()
[2782]47{}
[1757]48
49// data initialization
50void NROOTFDataset::initialize()
51{
[2782]52 int arymax = arrayMax() ;
[1757]53
[2782]54 // it must be called
[2783]55 initializeCommon() ;
[2782]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
[1757]71 + sizeof( char ) * 180 ; // CDMY1
[1868]72
[2782]73 for ( int i = 0 ; i < NRO_ARYMAX ; i++ ) {
74 DSBFC[i] = 1.0 ;
[1757]75 }
76}
77
78int NROOTFDataset::fillHeader( int sameEndian )
79{
80 LogIO os( LogOrigin( "NROOTFDataset", "fillHeader()", WHERE ) ) ;
81
[2782]82 int arymax = arrayMax() ;
83
[1757]84 string str256( 256, ' ' ) ;
85 char c256[256] ;
86 // make sure file pointer points a beginning of the file
87 fseek( fp_, 0, SEEK_SET ) ;
88
[2783]89 fillHeaderCommon( sameEndian ) ;
90
91 // specific part
[1757]92 strcpy( c256, str256.c_str() ) ;
93 if ( readHeader( c256, 180 ) == -1 ) {
94 os << LogIO::WARN << "Error while reading data CDMY1." << LogIO::POST ;
95 return -1 ;
96 }
97 c256[180] = '\0' ;
98 CDMY1 = string( c256 ) ;
99 // DEBUG
100 //cout << "CDMY1 = " << CDMY1 << endl ;
101 //
102
103 return 0 ;
104}
105
Note: See TracBrowser for help on using the repository browser.