1 | //#---------------------------------------------------------------------------
|
---|
2 | //# SDContainer.cc: A container class for single dish integrations
|
---|
3 | //#---------------------------------------------------------------------------
|
---|
4 | //# Copyright (C) 2004
|
---|
5 | //# ATNF
|
---|
6 | //#
|
---|
7 | //# This program is free software; you can redistribute it and/or modify it
|
---|
8 | //# under the terms of the GNU General Public License as published by the Free
|
---|
9 | //# Software Foundation; either version 2 of the License, or (at your option)
|
---|
10 | //# any later version.
|
---|
11 | //#
|
---|
12 | //# This program is distributed in the hope that it will be useful, but
|
---|
13 | //# WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
14 | //# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
---|
15 | //# Public License for more details.
|
---|
16 | //#
|
---|
17 | //# You should have received a copy of the GNU General Public License along
|
---|
18 | //# with this program; if not, write to the Free Software Foundation, Inc.,
|
---|
19 | //# 675 Massachusetts Ave, Cambridge, MA 02139, USA.
|
---|
20 | //#
|
---|
21 | //# Correspondence concerning this software should be addressed as follows:
|
---|
22 | //# Internet email: Malte.Marquarding@csiro.au
|
---|
23 | //# Postal address: Malte Marquarding,
|
---|
24 | //# Australia Telescope National Facility,
|
---|
25 | //# P.O. Box 76,
|
---|
26 | //# Epping, NSW, 2121,
|
---|
27 | //# AUSTRALIA
|
---|
28 | //#
|
---|
29 | //# $Id:
|
---|
30 | //#---------------------------------------------------------------------------
|
---|
31 |
|
---|
32 | #include <casa/aips.h>
|
---|
33 | #include <casa/iostream.h>
|
---|
34 | #include <casa/iomanip.h>
|
---|
35 | #include <casa/Exceptions.h>
|
---|
36 | #include <casa/Utilities/Assert.h>
|
---|
37 | #include <casa/Arrays/IPosition.h>
|
---|
38 | #include <casa/Quanta/MVTime.h>
|
---|
39 |
|
---|
40 |
|
---|
41 |
|
---|
42 | #include "STDefs.h"
|
---|
43 | #include "SDContainer.h"
|
---|
44 |
|
---|
45 | using namespace casa;
|
---|
46 | using namespace asap;
|
---|
47 |
|
---|
48 | void SDHeader::print() const {
|
---|
49 | MVTime mvt(this->utc);
|
---|
50 | mvt.setFormat(MVTime::YMD);
|
---|
51 | cout << "Observer: " << this->observer << endl
|
---|
52 | << "Project: " << this->project << endl
|
---|
53 | << "Obstype: " << this->obstype << endl
|
---|
54 | << "Antenna: " << this->antennaname << endl
|
---|
55 | << "Ant. Position: " << this->antennaposition << endl
|
---|
56 | << "Equinox: " << this->equinox << endl
|
---|
57 | << "Freq. ref.: " << this->freqref << endl
|
---|
58 | << "Ref. frequency: " << this->reffreq << endl
|
---|
59 | << "Bandwidth: " << this->bandwidth << endl
|
---|
60 | << "Time (utc): "
|
---|
61 | << mvt
|
---|
62 | << endl;
|
---|
63 | //setprecision(10) << this->utc << endl;
|
---|
64 | }
|
---|
65 |
|
---|
66 | // SDDataDesc
|
---|
67 |
|
---|
68 | uInt SDDataDesc::addEntry(const String& source, uInt ID,
|
---|
69 | const MDirection& dir, uInt secID)
|
---|
70 | {
|
---|
71 |
|
---|
72 | // See if already exists
|
---|
73 |
|
---|
74 | if (n_ > 0) {
|
---|
75 | for (uInt i=0; i<n_; i++) {
|
---|
76 | if (source==source_[i] && ID==ID_[i]) {
|
---|
77 | return i;
|
---|
78 | }
|
---|
79 | }
|
---|
80 | }
|
---|
81 |
|
---|
82 | // Not found - add it
|
---|
83 |
|
---|
84 | n_ += 1;
|
---|
85 | source_.resize(n_,True);
|
---|
86 | ID_.resize(n_,True);
|
---|
87 | secID_.resize(n_,True);
|
---|
88 | secDir_.resize(n_,True,True);
|
---|
89 | //
|
---|
90 | source_[n_-1] = source;
|
---|
91 | ID_[n_-1] = ID;
|
---|
92 | secID_[n_-1] = secID;
|
---|
93 | secDir_[n_-1] = dir;
|
---|
94 | //
|
---|
95 | return n_-1;
|
---|
96 | }
|
---|
97 |
|
---|
98 | void SDDataDesc::summary() const
|
---|
99 | {
|
---|
100 | if (n_>0) {
|
---|
101 | cerr << "Source ID" << endl;
|
---|
102 | for (uInt i=0; i<n_; i++) {
|
---|
103 | cout << setw(11) << source_(i) << ID_(i) << endl;
|
---|
104 | }
|
---|
105 | }
|
---|
106 | }
|
---|
107 |
|
---|