Changeset 2480


Ignore:
Timestamp:
05/04/12 11:11:09 (13 years ago)
Author:
Malte Marquarding
Message:

Ticket #269: fix for custom reference scan expressions not being honoured.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/scantable.py

    r2435 r2480  
    436436
    437437        """
    438 #         info = Scantable._summary(self)
    439438        if filename is not None:
    440439            if filename is "":
     
    442441            from os.path import expandvars, isdir
    443442            filename = expandvars(filename)
    444 #             if not isdir(filename):
    445 #                 data = open(filename, 'w')
    446 #                 data.write(info)
    447 #                 data.close()
    448 #             else:
    449443            if isdir(filename):
    450444                msg = "Illegal file name '%s'." % (filename)
     
    453447            filename = ""
    454448        Scantable._summary(self, filename)
    455 #         info = Scantable._summary(self, filename)
    456 #         return page(info)
    457449
    458450    def get_spectrum(self, rowno):
     
    33353327        """
    33363328        varlist = vars()
    3337         basesel = self.get_selection()
    33383329        stype = -1
    3339         if sourcetype.lower().startswith("r"):
     3330        if sourcetype.lower().startswith("r") or sourcetype.lower() == "off":
    33403331            stype = 1
    3341         elif sourcetype.lower().startswith("s"):
     3332        elif sourcetype.lower().startswith("s") or sourcetype.lower() == "on":
    33423333            stype = 0
    33433334        else:
    3344             raise ValueError("Illegal sourcetype use s(ource) or r(eference)")
     3335            raise ValueError("Illegal sourcetype use s(ource)/on or r(eference)/off")
    33453336        if matchtype.lower().startswith("p"):
    33463337            matchtype = "pattern"
     
    33533344            sel = match
    33543345        else:
    3355             sel.set_query("SRCNAME == %s('%s')" % (matchtype, match))
     3346            sel.set_query("SRCNAME=%s('%s')" % (matchtype, match))
     3347        self.set_selection(sel)
    33563348        self._setsourcetype(stype)
    33573349        self._add_history("set_sourcetype", varlist)
     
    36883680            else:
    36893681                r = filler( tbl )
    3690                 rx = rcParams['scantable.reference']
    3691                 r.setreferenceexpr(rx)
    36923682            msg = "Importing %s..." % (name)
    36933683            asaplog.push(msg, False)
    36943684            r.open(name, opts)
     3685            rx = rcParams['scantable.reference']
     3686            r.setreferenceexpr(rx)
    36953687            r.fill()
    36963688            if average:
Note: See TracChangeset for help on using the changeset viewer.