source: tags/asap-4.1.0/src/STAttr.h @ 2662

Last change on this file since 2662 was 2662, checked in by Malte Marquarding, 12 years ago

merge from trunk into release candidate

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.4 KB
Line 
1//#---------------------------------------------------------------------------
2//# STAttr.h: Return known attributes about telescopes
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: STAttr.h 2662 2012-10-10 03:53:53Z MalteMarquarding $
30//#---------------------------------------------------------------------------
31#ifndef STATTR_H
32#define STATTR_H
33
34#include <string>
35
36#include <casa/aips.h>
37#include <measures/Measures/MEpoch.h>
38#include <casa/Utilities/CountedPtr.h>
39
40#include "STDefs.h"
41
42namespace casa {
43  template<class T> class Vector;
44}
45
46namespace asap {
47
48class STAttr {
49
50 public:
51
52  // Constructor
53  STAttr();
54
55  // Destructor
56  virtual ~STAttr();
57
58  // Copy Constructor (copy semantics)
59  STAttr(const STAttr& other);
60
61  // Assignment  (copy semantics)
62  STAttr &operator=(const STAttr& other);
63
64  // Telescope diameter(m). Throws exception if unknown.
65  casa::Float diameter(Instrument inst) const;
66
67  // Beam efficiency.  Frequency in Hz.  Returns 1 if unknown.
68  casa::Vector<casa::Float>
69  beamEfficiency(Instrument instr, const casa::MEpoch& dateObs,
70                 const casa::Vector<casa::Float>& freqs) const;
71
72  // Aperture efficiency. Frequency in Hz.  Returns 1 if unknown.
73  casa::Vector<casa::Float>
74  apertureEfficiency(Instrument instr,
75                     const casa::MEpoch& dateObs,
76                     const casa::Vector<casa::Float>& freqs) const;
77
78  // Find factor to convert Jy -> K for this telescope, date of
79  // observation and frequency (Hz)
80  casa::Vector<casa::Float> JyPerK(Instrument instr,
81                                   const casa::MEpoch& dateObs,
82                                   const casa::Vector<casa::Float>& freqs)
83    const;
84
85  // Gain Elevation polynomial correction coefficients (elevation in
86  // degrees) Returns length 0 if not known.
87   casa::Vector<casa::Float> gainElevationPoly(Instrument instr) const;
88
89  // Find feed polarization type of feeds. In future this needs to come
90  // from the data themselves
91  std::string feedPolType(Instrument) const;
92
93  // Helper function to check instrument (antenna) name and give enum
94  static Instrument convertInstrument(const casa::String& instrument,
95                                      casa::Bool throwIt);
96
97  // Helper function.  Finds factor to convert K -> Jy. Provide
98  // aperture efficiency and dish geometric diameter (m)
99  static casa::Float findJyPerK(casa::Float etaAp, casa::Float D);
100
101private:
102
103  // Static data
104  casa::Vector<casa::Float> MopEtaBeamX_;     // Beam efficiency
105  casa::Vector<casa::Float> MopEtaBeam2003Y_;
106  casa::Vector<casa::Float> MopEtaBeam2004Y_;
107
108  casa::Vector<casa::Float> MopEtaApX_;       // Aperture efficiency
109  casa::Vector<casa::Float> MopEtaAp2004Y_;
110
111  casa::Vector<casa::Float> TidEtaApX_;       // Aperture efficiency
112  casa::Vector<casa::Float> TidEtaApY_;
113
114  casa::Vector<casa::Float> TidGainElPoly_;   // Gain-el correction poly coeffs
115  casa::Vector<casa::Float> ParkesGainElPoly_;// K-band Gain-el correction
116                                              //poly coeffs
117
118  // Init private data
119  void initData();
120
121  // Linear interpolation
122  casa::Vector<casa::Float> interp(const casa::Vector<casa::Float>& xOut,
123                                   const casa::Vector<casa::Float>& xIn,
124                                   const casa::Vector<casa::Float>& yIn) const;
125
126
127};
128
129} // namespace
130
131#endif
Note: See TracBrowser for help on using the repository browser.