Changeset 1189 for trunk


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

Fix for ticket #61 - changing of default polarisation. Done ticket #62 as far as possible. Tid data gets automatically set as 'circular'\nAlso add circular pol class which was missing so far.

Location:
trunk/src
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STPolLinear.cpp

    r1007 r1189  
    4949        break;
    5050    }
     51  } else if (nspec() == 2) {
     52    if ( index == 0 )
     53      out = Vector<Float>(getSpectrum(0) + getSpectrum(1));
    5154  }
    5255  return out;
     
    5558Vector<Float> asap::STPolLinear::getLinPol( uInt index )
    5659{
     60  if (nspec() != 4) {
     61    throw(AipsError("You must have 4 linear polarizations to run this function"));
     62  }
    5763  if ( index < 0 || index >4 ) throw(AipsError("LinPol index out of range"));
    5864  Vector<Float> out,q,u;
     
    8793  //   We use the convention
    8894  //    I = (RR+LL)  // definition changed
    89 
     95  if (nspec() != 4) {
     96    throw(AipsError("You must have 4 linear polarizations to run this function"));
     97  }
    9098  if ( index == 2 || index ==3  ) throw(AipsError("Re/Imag RL not implemented"));
    9199  Vector<Float> I,V,out;
     
    121129{
    122130  // phase isnt used, just ro keep interface the same for all pol operations
     131  if (nspec() != 4) {
     132    throw(AipsError("You must have 4 linear polarizations to run this function"));
     133  }
    123134  Matrix<Float>& specs = getSpectra();
    124135  Vector<Float> I = specs.column(3);
     
    135146// C1 = XX; C2 = YY, C3 = Real(XY)
    136147//
     148  if (nspec() != 4) {
     149    throw(AipsError("You must have 4 linear polarizations to run this function"));
     150  }
    137151  Vector<Float> I,Q,U;
    138152  I = getStokes(0);
  • trunk/src/Scantable.cpp

    r1170 r1189  
    5656#include "Scantable.h"
    5757#include "STPolLinear.h"
     58#include "STPolCircular.h"
    5859#include "STPolStokes.h"
    5960#include "STAttr.h"
     
    6970  if ( factories_.empty() ) {
    7071    Scantable::factories_["linear"] = &STPolLinear::myFactory;
     72    Scantable::factories_["circular"] = &STPolStokes::myFactory;
    7173    Scantable::factories_["stokes"] = &STPolStokes::myFactory;
    7274  }
     
    398400  nameU.upcase();
    399401  table_.rwKeywordSet().define(String("AntennaName"), nameU);
     402}
     403
     404void Scantable::setFeedType(const std::string& feedtype)
     405{
     406  if ( Scantable::factories_.find(feedtype) ==  Scantable::factories_.end() ) {
     407    std::string msg = "Illegal feed type "+ feedtype;
     408    throw(casa::AipsError(msg));
     409  }
     410  table_.rwKeywordSet().define(String("POLTYPE"), feedtype);
    400411}
    401412
  • trunk/src/Scantable.h

    r1170 r1189  
    202202
    203203  /**
     204   * Set the Stokes type of the data
     205   * @param a string representing the type, e.g "circular" or "linear"
     206   */
     207  void setFeedType( const std::string& feedtype );
     208
     209  /**
    204210   *
    205211   * @param instrument a string representing an insturment. see xxx
  • trunk/src/ScantableWrapper.h

    r1170 r1189  
    9393
    9494  void setInstrument(const std::string& name) {table_->setInstrument(name);}
     95  void setFeedType(const std::string& ftype) {table_->setFeedType(ftype);}
    9596
    9697  std::vector<bool> getMask(int whichrow=0) const
  • trunk/src/python_Scantable.cpp

    r1111 r1189  
    7373    .def("set_fluxunit", &ScantableWrapper::setFluxUnit)
    7474    .def("_setInstrument", &ScantableWrapper::setInstrument)
     75    .def("_setfeedtype", &ScantableWrapper::setFeedType)
    7576    .def("_getspectrum", &ScantableWrapper::getSpectrum,
    7677         (arg("whichrow")=0, arg("poltype")=std::string("")) )
Note: See TracChangeset for help on using the changeset viewer.