casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
GBTSampler.h
Go to the documentation of this file.
00001 //# GBTSampler: defines GBTSampler, holds SAMPLER table information
00002 //# Copyright (C) 2003
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //#
00027 //# $Id$
00028 
00029 #ifndef NRAO_GBTSAMPLER_H
00030 #define NRAO_GBTSAMPLER_H
00031 
00032 #include <casa/aips.h>
00033 #include <casa/Arrays/Vector.h>
00034 #include <casa/BasicSL/String.h>
00035 
00036 #include <casa/namespace.h>
00037 //# Forward Declarations
00038 class GBTBackendTable;
00039 
00040 // <summary>
00041 //# This defines GBTSampler, a class to hold backend SAMPLER table information.
00042 // </summary>
00043 
00044 // <use visibility=local>
00045 
00046 // <reviewed reviewer="" date="yyyy/mm/dd" tests="tGBTSampler.cc" demos="">
00047 // </reviewed>
00048 
00049 // <prerequisite>
00050 //   <li> GBT FITS files.
00051 //   <li> GBT ACS FITS file.
00052 //   <li> GBTBackendTable
00053 // </prerequisite>
00054 //
00055 // <etymology>
00056 // This holds information typically found in the SAMPLER table of the GBT
00057 // backend FITS files.
00058 // </etymology>
00059 //
00060 // <motivation>
00061 // It is useful to provide a common interface to access the information
00062 // in the sampler table.  In addition, since only the GBT ACS
00063 // follows the full convention and provides a complete sampler table, it
00064 // is useful to make the other backends appear as if they had this
00065 // table so that downstream code need not know about the differences.
00066 // </motivation>
00067 //
00068 // </todo>
00069 
00070 class GBTSampler
00071 {
00072 public:
00073     // construct from an existing GBTBackendTable and
00074     // possibly using the number of IF rows (SP backend only)
00075     GBTSampler(const GBTBackendTable &backendTab, Int nIFrows);
00076 
00077     // Copy-constructor, uses copy semantics.
00078     GBTSampler(const GBTSampler &other);
00079 
00080     ~GBTSampler() {;}
00081 
00082     // Assignment operator, uses copy semantics.
00083     GBTSampler &operator=(const GBTSampler &other);
00084 
00085     // The number of rows (samplers) present.
00086     uInt nrows() const {return itsBankA.nelements();}
00087 
00088     // BANK_A for a given row.
00089     // For ACS, returns value in BANK_A column
00090     // SP receiver row is now correctly translated to BANK_A
00091     // values for Sqr/Cross mode and Square modes.
00092     // For the DCR, returns value of INPBANK keyword.
00093     const String &bankA(uInt whichRow) const {return itsBankA[whichRow];}
00094 
00095     // BANK_B for a given row.
00096     // For ACS, returns value in BANK_B column.
00097     // SP receiver row is now correctly translated to BANK_B
00098     // values for Sqr/Cross mode and Square modes.
00099     // For DCR bankB==bankA.
00100     const String &bankB(uInt whichRow) const {return itsBankB[whichRow];}
00101 
00102     // PORT_A for a given row.
00103     // For ACS, returns value in PORT_A column.
00104     // SP receiver row is now correctly translated to PORT_A
00105     // values for Sqr/Cross mode and Square modes.
00106     // For DCR, this is the value of CHANNELID + 1.
00107     Int portA(uInt whichRow) const {return itsPortA[whichRow];}
00108 
00109     // PORT_B for a given row.
00110     // For ACS, returns value in PORT_B column.
00111     // SP receiver row is now correctly translated to PORT_B
00112     // values for Sqr/Cross mode and Square modes.
00113     // For DCR portB==portA.
00114     Int portB(uInt whichRow) const {return itsPortB[whichRow];}
00115 
00116     // Does this SAMPLER have any cross-polarization data.
00117     // For ACS, this returns True if POLARIZE=="CROSS"
00118     // For SpectralProcessor this returns true in SquareCross mode.
00119     // For DCR data this always returns False.
00120     Bool hasCross() const {return itsHasCross;}
00121 
00122     // Return the number of channels for this row of the sampler table.
00123     uInt nchan(uInt whichRow) const {return itsNchan[whichRow];}
00124 
00125 private:
00126     Vector<String> itsBankA, itsBankB;
00127     Vector<Int> itsPortA, itsPortB, itsNchan;
00128     Bool itsHasCross;
00129 
00130     //# unimplemented an unavailable
00131     GBTSampler();
00132 };
00133 #endif
00134 
00135