Changeset 2712


Ignore:
Timestamp:
12/28/12 13:35:27 (12 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).


Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/sbseparator.py

    r2711 r2712  
    5757        self.set_data(infiles)
    5858       
    59         self.separator = SBSeparator()
     59        self._separator = SBSeparator()
    6060
    6161    @asaplog_post_dec
     
    7575                    raise TypeError, "Input data is not a list of scantables."
    7676
    77             #self.separator._setdata(infiles)
     77            #self._separator._setdata(infiles)
    7878            self._reset_data()
    7979            self.intables = infiles
     
    8585                    raise ValueError, "Could not find input file '%s'" % name
    8686           
    87             #self.separator._setdataname(infiles)
     87            #self._separator._setdataname(infiles)
    8888            self._reset_data()
    8989            self.intables = infiles
     
    200200        Set rejection limit of solution.
    201201        """
    202         #self.separator._setlimit(abs(threshold))
     202        #self._separator._setlimit(abs(threshold))
    203203        self.rejlimit = threshold
    204204        asaplog.push("The threshold of rejection is set to %f" % self.rejlimit)
     
    230230            asaplog.post("WARN")
    231231        else:
    232             self.separator.set_lo1(lo1val)
     232            self._separator.set_lo1(lo1val)
    233233
    234234
     
    241241               'ASDM_RECEIVER' tables.
    242242        """
    243         self.separator.set_lo1root(name)
     243        self._separator.set_lo1root(name)
    244244
    245245
     
    253253        """
    254254        # List up valid scantables and IFNOs to convolve.
    255         #self.separator._separate()
     255        #self._separator._separate()
    256256        self._setup_shift()
    257257        #self._preprocess_tables()
     258
     259        ### TEMPORAL ###
     260        self._separator._get_asistb_from_scantb(self.tables[0])
     261        ################
    258262
    259263        nshift = len(self.tables)
     
    314318                    shutil.rmtree(imagename)
    315319            # Update frequency information
    316             self.separator.set_imgtable(imagetab)
    317             self.separator.solve_imgfreq()
     320            self._separator.set_imgtable(imagetab)
     321            self._separator.solve_imgfreq()
    318322            imagetab.save(imagename)
    319323
     
    613617#             raise RuntimeError, "Output file '%s' already exists" % outfile
    614618#
    615 #         #self.separator._save(outfile, outform)
     619#         #self._separator._save(outfile, outform)
    616620
    617621#     def done(self):
     
    620624#     def close(self):
    621625#         pass
    622 #         #del self.separator
     626#         #del self._separator
    623627   
    624628
  • 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."));
  • trunk/src/STSideBandSep.h

    r2711 r2712  
    4747
    4848  /**
    49    * Set separated scantable to fill frequencies of image sideband (temporal)
     49   * Set scantable to fill frequencies of image sideband (temporal)
    5050   **/
    5151  void setImageTable(const ScantableWrapper &s);
     52  void setScanTb0(const ScantableWrapper &s);
    5253  /**
    5354   * Set additional information to fill frequencies of image sideband
     
    8081  string asdmName_, asisName_;
    8182
    82   CountedPtr< Scantable > imgTab_p, sigTab_p;
     83  CountedPtr<Scantable> imgTab_p, sigTab_p;
     84  // TEMPORAL member
     85  CountedPtr<Scantable> st0_;
    8386
    8487}; // class
  • trunk/src/python_STSideBandSep.cpp

    r2711 r2712  
    3131    .def( "set_imgtable", &STSideBandSep::setImageTable )
    3232    .def( "solve_imgfreq", &STSideBandSep::solveImageFreqency )
     33    .def( "_get_asistb_from_scantb", &STSideBandSep::setScanTb0 )
    3334  ;
    3435};
Note: See TracChangeset for help on using the changeset viewer.