Ignore:
Timestamp:
12/28/12 13:35:27 (11 years ago)
Author:
Kana Sugimoto
Message:

New Development: No

JIRA Issue: Yes (CAS-4141)

Ready for Test: Yes

Interface Changes: Yes

What Interface Changed: added temporal methods to set scantable to STSideBandSep for a workaround.

Test Programs:

Put in Release Notes: No

Module(s): STSideBandSep and sbseparator

Description:

Enabled getting LO1 frequency based on information in scantable header
(if necessary information exists).


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STSideBandSep.cpp

    r2711 r2712  
    130130#endif
    131131};
     132
     133///// TEMPORAL FUNCTION!!! /////
     134void STSideBandSep::setScanTb0(const ScantableWrapper &s){
     135  st0_ = s.getCP();
     136};
     137////////////////////////////////
    132138
    133139void STSideBandSep::solveImageFreqency()
     
    229235    // Try getting ASDM name from scantable header
    230236    os << "Try getting information from scantable header" << LogIO::POST;
    231     if (!getLo1FromScanTab(imgTab_p, sigrefval, refpix, increment, nChan)) {
     237    if (!getLo1FromScanTab(st0_, sigrefval, refpix, increment, nChan)) {
    232238      //throw AipsError("Failed to get LO1 frequency from asis table");
    233239      os << LogIO::WARN << "Failed to get LO1 frequency using information in scantable." << LogIO::POST;
     
    333339{
    334340  LogIO os(LogOrigin("STSideBandSep","getLo1FromScanTab()", WHERE));
    335   Table& tab = scantab->table();
    336341  // Check for relevant tables.
     342  const TableRecord &rec = scantab->table().keywordSet() ;
    337343  String spwname, recname;
    338   try {
    339     spwname = tab.keywordSet().asString("ASDM_SPECTRALWINDOW");
    340     recname = tab.keywordSet().asString("ASDM_RECEIVER");
    341   } catch (...) {
     344  if (rec.isDefined("ASDM_SPECTRALWINDOW") && rec.isDefined("ASDM_RECEIVER")){
     345    spwname = rec.asString("ASDM_SPECTRALWINDOW");
     346    recname = rec.asString("ASDM_RECEIVER");
     347  }
     348  else {
    342349    // keywords are not there
    343350    os << LogIO::WARN
     
    353360  const String recsuff = "/ASDM_RECEIVER";
    354361  String::size_type pos;
    355   pos = recname.size()-recsuff.size()-1;
     362  pos = recname.size()-recsuff.size();
    356363  if (recname.substr(pos) == recsuff)
    357     msname = recname.substr(0, pos-1);
     364    msname = recname.substr(0, pos);
    358365  else
    359366    throw(AipsError("Internal error in parsing table name from a scantable keyword."));
Note: See TracChangeset for help on using the changeset viewer.