Changeset 905 for trunk/src


Ignore:
Timestamp:
03/17/06 17:00:16 (19 years ago)
Author:
mar637
Message:

change default polytype passed as argument to "", to then apply Scantable::poltype if empty.
added poltype to STHeader

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STFiller.cpp

    r901 r905  
    102102    nPol_ += 2;                          // Convert Complex -> 2 Floats
    103103  }
    104 
    105104  if (header_) delete header_;
    106105  header_ = new STHeader();
     
    108107  header_->npol = nPol_;
    109108  header_->nbeam = nBeam_;
     109
     110  if ( nPol_  == 1 ) header_->poltype = "stokes";
     111  else header_->poltype = "linear";
    110112
    111113  Int status = reader_->getHeader(header_->observer, header_->project,
  • trunk/src/STHeader.h

    r901 r905  
    6565  casa::String fluxunit;
    6666  casa::String epoch;
     67  casa::String poltype;
    6768  void print() const ;
    6869};
  • trunk/src/Scantable.cpp

    r902 r905  
    298298  table_.rwKeywordSet().define("FluxUnit", sdh.fluxunit);
    299299  table_.rwKeywordSet().define("Epoch", sdh.epoch);
     300  table_.rwKeywordSet().define("POLTYPE", sdh.poltype);
    300301}
    301302
     
    319320  table_.keywordSet().get("FluxUnit", sdh.fluxunit);
    320321  table_.keywordSet().get("Epoch", sdh.epoch);
     322  table_.keywordSet().get("POLTYPE", sdh.poltype);
    321323  return sdh;
    322324}
     
    596598                                           const std::string& poltype ) const
    597599{
     600  String ptype = poltype;
     601  if (poltype == "" ) ptype = getPolType();
    598602  if ( whichrow  < 0 || whichrow >= nrow() )
    599603    throw(AipsError("Illegal row number."));
     
    602606  uInt requestedpol = polCol_(whichrow);
    603607  String basetype = getPolType();
    604   if ( String(poltype) == basetype) {
     608  if ( ptype == basetype ) {
    605609    specCol_.get(whichrow, arr);
    606610  } else {
     
    613617      focusTable_.getEntry(frot, fang, ftan, mfocusidCol_(row));
    614618      stpol->setPhaseCorrections(frot, fang, ftan);
    615       arr = stpol->getSpectrum(requestedpol, poltype);
     619      arr = stpol->getSpectrum(requestedpol, ptype);
    616620      delete stpol;
    617621    } catch (AipsError& e) {
  • trunk/src/Scantable.h

    r902 r905  
    251251  std::vector<bool> getMask(int whichrow) const;
    252252  std::vector<float> getSpectrum(int whichrow,
    253                                  const std::string& poltype ="linear") const;
     253                                 const std::string& poltype = "" ) const;
    254254
    255255  void setSpectrum(const std::vector<float>& spec, int whichrow);
  • trunk/src/ScantableWrapper.h

    r902 r905  
    6464
    6565  std::vector<float> getSpectrum( int whichrow=0,
    66                                   const std::string& poltype="linear" ) const {
     66                                  const std::string& poltype="" ) const {
    6767    return table_->getSpectrum(whichrow, poltype);
    6868  }
  • trunk/src/python_Scantable.cpp

    r902 r905  
    6969    .def("_setInstrument", &ScantableWrapper::setInstrument)
    7070    .def("_getspectrum", &ScantableWrapper::getSpectrum,
    71          (arg("whichrow")=0, arg("poltype")=std::string("linear")) )
     71         (arg("whichrow")=0, arg("poltype")=std::string("")) )
    7272    .def("poltype", &ScantableWrapper::getPolType )
    7373    .def("_getpollabel", &ScantableWrapper::getPolarizationLabel)
Note: See TracChangeset for help on using the changeset viewer.