Changeset 1188


Ignore:
Timestamp:
08/28/06 12:20:39 (18 years ago)
Author:
mar637
Message:

changed feedtype to be string and added detection of feedtype to filler.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STAttr.cpp

    r878 r1188  
    5757}
    5858
    59 STAttr& STAttr::operator=(const STAttr& other) 
     59STAttr& STAttr::operator=(const STAttr& other)
    6060{
    6161  if (this != &other) {
     
    107107}
    108108
    109 Vector<Float> STAttr::beamEfficiency(Instrument inst, const MEpoch& dateObs, 
     109Vector<Float> STAttr::beamEfficiency(Instrument inst, const MEpoch& dateObs,
    110110                                      const Vector<Float>& freqs) const
    111111{
     
    122122            pushLog("There is no beam efficiency data from before 2003"
    123123                    " - using 2003 data");
    124             facs = interp(freqs/1.0e9f, MopEtaBeamX_, MopEtaBeam2003Y_); 
     124            facs = interp(freqs/1.0e9f, MopEtaBeamX_, MopEtaBeam2003Y_);
    125125          } else if (year==2003) {
    126126            pushLog("Using beam efficiency data from 2003");
    127             facs = interp(freqs/1.0e9f, MopEtaBeamX_, MopEtaBeam2003Y_); 
     127            facs = interp(freqs/1.0e9f, MopEtaBeamX_, MopEtaBeam2003Y_);
    128128          } else {
    129129            pushLog("Using beam efficiency data from 2004");
    130             facs = interp(freqs/1.0e9f, MopEtaBeamX_, MopEtaBeam2004Y_); 
     130            facs = interp(freqs/1.0e9f, MopEtaBeamX_, MopEtaBeam2004Y_);
    131131          }
    132132        }
     
    140140}
    141141
    142 Vector<Float> STAttr::apertureEfficiency(Instrument inst, 
    143                                          const MEpoch& dateObs, 
     142Vector<Float> STAttr::apertureEfficiency(Instrument inst,
     143                                         const MEpoch& dateObs,
    144144                                         const Vector<Float>& freqs) const
    145145{
    146  
     146
    147147  // Look at date where appropriate
    148148  MVTime t(dateObs.getValue());
    149149  uInt year = t.year();
    150  
     150
    151151  Vector<Float> facs(freqs.nelements(),1.0);
    152152  switch (inst) {
     
    180180                             const Vector<Float>& freqs) const
    181181{
    182  
     182
    183183  // Find what we need
    184184  Vector<Float> etaAp = apertureEfficiency(inst, dateObs, freqs);
     
    223223}
    224224
    225 FeedPolType STAttr::feedPolType(Instrument inst) const
    226 {
    227   FeedPolType type = UNKNOWNFEED;
     225std::string STAttr::feedPolType(Instrument inst) const
     226{
     227  std::string type;
    228228  switch (inst) {
    229229  case ATMOPRA:
     
    231231  case ATPKSHOH:
    232232    {
    233       type = LINEAR;
     233      type = "linear";
    234234    }
    235235    break;
    236236  case TIDBINBILLA:
    237237    {
    238       type = CIRCULAR;
     238      type = "circular";
    239239    }
    240240    break;
    241241  default:
    242242    {
    243       type = UNKNOWNFEED;
     243      type = "linear";
    244244    }
    245245  }
     
    250250// Private
    251251Vector<Float> STAttr::interp(const Vector<Float>& xOut,
    252                              const Vector<Float>& xIn, 
     252                             const Vector<Float>& xIn,
    253253                             const Vector<Float>& yIn) const
    254254{
     
    258258
    259259  Vector<Bool> mIn(xIn.nelements(),True);
    260  
     260
    261261  InterpolateArray1D<Float,Float>::interpolate(yOut, mOut, xOut,
    262262                                               xIn, yIn, mIn,
    263263                                               method, True, True);
    264  
     264
    265265  return yOut;
    266266}
    267267
    268 void STAttr::initData() 
     268void STAttr::initData()
    269269  //
    270270  // Mopra data from Mopra web page
     
    284284   MopEtaBeam2003Y_(1) = 0.37;
    285285   MopEtaBeam2003Y_(2) = 0.37;          // replicated from (1)
    286    
     286
    287287   MopEtaBeam2004Y_.resize(3);
    288288   MopEtaBeam2004Y_(0) = 0.49;
     
    321321  String t(instrument);
    322322  t.upcase();
    323  
     323
    324324  // The strings are what STReader returns, after cunning
    325325  // interrogation of station names... :-(
  • trunk/src/STAttr.h

    r1030 r1188  
    3131#ifndef STATTR_H
    3232#define STATTR_H
     33
     34#include <string>
    3335
    3436#include <casa/aips.h>
     
    8890  // Find feed polarization type of feeds. In future this needs to come
    8991  // from the data themselves
    90   FeedPolType feedPolType(Instrument) const;
     92  std::string feedPolType(Instrument) const;
    9193
    9294  // Helper function to check instrument (antenna) name and give enum
  • trunk/src/STFiller.cpp

    r1142 r1188  
    112112  header_->nbeam = nBeam_;
    113113
    114   // not the right thing to do?!
    115   //if ( nPol_  == 1 ) header_->poltype = "stokes";
    116   //else header_->poltype = "linear";
    117   header_->poltype = "linear";
    118114  Int status = reader_->getHeader(header_->observer, header_->project,
    119115                                  header_->antennaname, header_->antennaposition,
     
    145141     header_->fluxunit = "K";
    146142  }
    147 
     143  STAttr stattr;
     144  header_->poltype = stattr.feedPolType(inst);
    148145  header_->nif = nIF_;
    149146  header_->epoch = "UTC";
Note: See TracChangeset for help on using the changeset viewer.