Changeset 1504 for trunk/python
- Timestamp:
- 02/13/09 11:27:42 (16 years ago)
- Location:
- trunk/python
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/__init__.py
r1472 r1504 114 114 'scantable.verbosesummary' : [False, _validate_bool], 115 115 'scantable.storage' : ['memory', str], 116 'scantable.history' : [True, _validate_bool] 116 'scantable.history' : [True, _validate_bool], 117 'scantable.reference' : ['.*(e|w|_R)$', str] 117 118 # fitter 118 119 } … … 180 181 scantable.verbosesummary : False 181 182 183 # Control the identification of reference (off) scans 184 # This is has to be a regular expression 185 scantable.reference : .*(e|w|_R)$ 182 186 # Fitter 183 187 """ -
trunk/python/scantable.py
r1502 r1504 1515 1515 return s 1516 1516 1517 def set_sourcetype(self, match, sourcetype="reference"): 1517 def set_sourcetype(self, match, matchtype="pattern", 1518 sourcetype="reference"): 1518 1519 """ 1519 1520 Set the type of the source to be an source or reference scan 1520 1521 using the provided pattern: 1521 1522 Parameters: 1522 match: a Unix style pattern or asap selector 1523 match: a Unix style pattern, regular expression or selector 1524 matchtype: 'pattern' (default) UNIX style pattern or 1525 'regex' regular expression 1523 1526 sourcetype: the type of the source to use (source/reference) 1524 1527 """ … … 1530 1533 elif sourcetype.lower().startswith("s"): 1531 1534 stype = 0 1532 if stype == -1:1535 else: 1533 1536 raise ValueError("Illegal sourcetype use s(ource) or r(eference)") 1537 if matchtype.lower().startswith("p"): 1538 matchtype = "pattern" 1539 elif matchtype.lower().startswith("r"): 1540 matchtype = "regex" 1541 else: 1542 raise ValueError("Illegal matchtype, use p(attern) or r(egex)") 1534 1543 sel = selector() 1535 1544 if isinstance(match, selector): 1536 1545 sel = match 1537 1546 else: 1538 sel.set_query("SRCNAME == pattern('%s')" % match)1547 sel.set_query("SRCNAME == %s('%s')" % (matchtype, match)) 1539 1548 self.set_selection(basesel+sel) 1540 1549 self._setsourcetype(stype) … … 1831 1840 tbl = Scantable(stype) 1832 1841 r = stfiller(tbl) 1842 rx = rcParams['scantable.reference'] 1843 r._setreferenceexpr(rx) 1833 1844 msg = "Importing %s..." % (name) 1834 1845 asaplog.push(msg, False)
Note:
See TracChangeset
for help on using the changeset viewer.