Changeset 2711 for trunk/python


Ignore:
Timestamp:
12/27/12 17:37:43 (12 years ago)
Author:
Kana Sugimoto
Message:

New Development: No

JIRA Issue: Yes (CAS-4141/CSV-1526)

Ready for Test: Yes

Interface Changes: Yes

What Interface Changed: Added asap.sbseparator.set_lo1root() = SBSeparator::set_lo1root(),

and STSideBandSep::setLO1Root()

Test Programs:

Put in Release Notes: No

Module(s): sbseparator and STSideBandSep

Description:

Added a new python method asap.sbseparator.set_lo1root() to set MS
name to search for LO1 frequency.
Underlying c++ functions are SBSeparator::set_lo1root (interface) and STSideBandSep::setLO1Root().
Also developed a capability to get relevant table names from scantable header and
fill frequencies of image side band.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/sbseparator.py

    r2707 r2711  
    4949        self.solveother = False
    5050        self.dirtol = [1.e-5, 1.e-5] # direction tolerance in rad (2 arcsec)
    51         self.lo1 = 0.
     51        #self.lo1 = 0.
    5252
    5353        self.tables = []
     
    5757        self.set_data(infiles)
    5858       
    59         #self.separator = sidebandsep()
     59        self.separator = SBSeparator()
    6060
    6161    @asaplog_post_dec
     
    221221        lo1 : LO1 frequency in float
    222222        """
     223        lo1val = -1.
    223224        if isinstance(lo1, dict) and lo1["unit"] == "Hz":
    224             self.lo1 = lo1["value"]
    225         else:
    226             self.lo1 = float(lo1)
    227         if self.lo1 <= 0.:
     225            lo1val = lo1["value"]
     226        else:
     227            lo1val = float(lo1)
     228        if lo1val <= 0.:
    228229            asaplog.push("Got negative LO1 frequency. It will be ignored.")
    229230            asaplog.post("WARN")
     231        else:
     232            self.separator.set_lo1(lo1val)
     233
     234
     235    def set_lo1root(self, name):
     236        """
     237        Set MS name which stores LO1 frequency of signal side band.
     238        It is used to calculate frequency of image sideband.
     239
     240        name : MS name which contains 'ASDM_SPECTRALWINDOW' and
     241               'ASDM_RECEIVER' tables.
     242        """
     243        self.separator.set_lo1root(name)
    230244
    231245
     
    289303            asaplog.post()
    290304            asaplog.push("Saving IMAGE sideband.")
    291             asaplog.push("Note, frequency information of IMAGE sideband cannot be properly filled so far. (future development)")
    292             asaplog.push("Storing frequency setting of SIGNAL sideband in FREQUENCIES table for now.")
    293             asaplog.post("WARN")
     305            #asaplog.push("Note, frequency information of IMAGE sideband cannot be properly filled so far. (future development)")
     306            #asaplog.push("Storing frequency setting of SIGNAL sideband in FREQUENCIES table for now.")
     307            #asaplog.post("WARN")
    294308
    295309            imagename = outname + ".imageband"
     
    300314                    shutil.rmtree(imagename)
    301315            # Update frequency information
    302             sbsep = SBSeparator()
    303             sbsep.set_imgtable(imagetab)
    304             if self.lo1 > 0.:
    305                 sbsep.set_lo1(self.lo1)
    306             sbsep.solve_imgfreq()
     316            self.separator.set_imgtable(imagetab)
     317            self.separator.solve_imgfreq()
    307318            imagetab.save(imagename)
    308             del sbsep
    309319
    310320
Note: See TracChangeset for help on using the changeset viewer.