Changeset 2818 for trunk/src


Ignore:
Timestamp:
07/02/13 10:38:18 (11 years ago)
Author:
Malte Marquarding
Message:

Issue #291: added scantable.set_sourcename to overwrite sourcename to allow freq_align to work. Exposed 'SOURCE' averaging to python api. Added some logging to freq_align refering to the sources it aligns to

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STMath.cpp

    r2695 r2818  
    27812781  MVTime mvt(refEpoch.getValue());
    27822782  String epochout = mvt.string(MVTime::YMD) + String(" (") + refEpoch.getRefString() + String(")");
    2783   os << "Aligned at reference Epoch " << epochout
     2783  os << "Aligning at reference Epoch " << epochout
    27842784     << " in frame " << MFrequency::showType(system) << LogIO::POST;
    27852785  // set up the iterator
     
    27952795  while ( !iter.pastEnd() ) {
    27962796    Table t = iter.table();
     2797    ROScalarColumn<String> snCol(t, "SRCNAME");
     2798    os << "Aligning to position of source '" << snCol(0) << "'" << LogIO::POST;
    27972799    MDirection::ROScalarColumn dirCol(t, "DIRECTION");
    27982800    TableIterator fiter(t, "FREQ_ID");
    27992801    // determine nchan from the first row. This should work as
    2800     // we are iterating over BEAMNO and IFNO    // we should have constant direction
     2802    // we are iterating over BEAMNO and IFNO   
     2803    // we should have constant direction
    28012804
    28022805    ROArrayColumn<Float> sCol(t, "SPECTRA");
     
    28132816    ScalarColumn<uInt> freqidCol(ftab, "FREQ_ID");
    28142817    // get the SpectralCoordinate for the freqid, which we are iterating over
    2815     SpectralCoordinate sC = in->frequencies().getSpectralCoordinate(freqidCol(0));
     2818    SpectralCoordinate sC = \
     2819      in->frequencies().getSpectralCoordinate(freqidCol(0));
    28162820    FrequencyAligner<Float> fa( sC, nchan, refEpoch,
    28172821                                direction, refPos, system );
     
    28262830                                                sc2.increment()[0]);
    28272831    while ( !fiter.pastEnd() ) {
     2832     
    28282833      ftab = fiter.table();
    28292834      // spectral coordinate for the current FREQ_ID
  • trunk/src/Scantable.cpp

    r2813 r2818  
    180180        table_ = TableCopy::makeEmptyMemoryTable(newname,
    181181                                                 other.table_, True);
    182       } else
     182      } else {
    183183        table_ = other.table_.copyToMemoryTable(newname);
     184      }
    184185  } else {
    185186      other.table_.deepCopy(newname, Table::New, False,
     
    450451  TableVector<Int> tabvec(table_, "SRCTYPE");
    451452  tabvec = Int(stype);
     453}
     454
     455void Scantable::setSourceName( const std::string& name )
     456{
     457  TableVector<String> tabvec(table_, "SRCNAME");
     458  tabvec = name;
    452459}
    453460
  • trunk/src/Scantable.h

    r2811 r2818  
    155155  void setSourceType(int stype);
    156156
     157  /**
     158   *
     159   * @param stype The name of the source
     160   */
     161  void setSourceName(const std::string& name);
     162
    157163
    158164  /**
     
    387393
    388394  //std::string getTime(int whichrow=-1, bool showdate=true) const;
    389   std::string getTime(int whichrow=-1, bool showdate=true, casa::uInt prec=0) const;
     395  std::string getTime(int whichrow=-1, bool showdate=true,
     396                      casa::uInt prec=0) const;
    390397  double getIntTime(int whichrow) const { return integrCol_(whichrow); }
    391398
     
    668675
    669676  std::string formatTime(const casa::MEpoch& me, bool showdate)const;
    670   std::string formatTime(const casa::MEpoch& me, bool showdate, casa::uInt prec)const;
     677  std::string formatTime(const casa::MEpoch& me, bool showdate,
     678                         casa::uInt prec)const;
    671679
    672680  /**
  • trunk/src/ScantableWrapper.h

    r2811 r2818  
    188188    { table_->setSourceType(stype); }
    189189
     190  void setSourceName(const std::string& name)
     191    { table_->setSourceName(name); }
     192
    190193  void shift(int npix)
    191194  { table_->shift(npix); }
  • trunk/src/python_Scantable.cpp

    r2791 r2818  
    137137    .def("_recalcazel", &ScantableWrapper::calculateAZEL)
    138138    .def("_setsourcetype", &ScantableWrapper::setSourceType)
     139    .def("_setsourcename", &ScantableWrapper::setSourceName)
    139140    .def("_getdirectionvec", &ScantableWrapper::getDirectionVector)
    140141    .def("_parallactify", &ScantableWrapper::parallactify)
Note: See TracChangeset for help on using the changeset viewer.