Changeset 1875
- Timestamp:
- 08/13/10 16:07:29 (14 years ago)
- Location:
- trunk/python
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/__init__.py
r1861 r1875 52 52 from opacity import skydip 53 53 from opacity import model as opacity_model 54 from _asap import srctype 54 55 55 56 __date__ = '$Date$'.split()[1] -
trunk/python/scantable.py
r1862 r1875 2248 2248 if mode.lower() == "paired": 2249 2249 sel = self.get_selection() 2250 sel.set_query("SRCTYPE== 1")2250 sel.set_query("SRCTYPE==psoff") 2251 2251 self.set_selection(sel) 2252 2252 offs = self.copy() 2253 sel.set_query("SRCTYPE== 0")2253 sel.set_query("SRCTYPE==pson") 2254 2254 self.set_selection(sel) 2255 2255 ons = self.copy() -
trunk/python/selector.py
r1826 r1875 1 from asap._asap import selector as _selector 1 import re 2 from asap._asap import selector as _selector, srctype 2 3 from asap.utils import unique, _to_list 3 4 … … 148 149 Example: 149 150 # select all off scans with integration times over 60 seconds. 150 selection.set_query("SRCTYPE == 1 AND INTERVAL > 60.0") 151 """ 151 selection.set_query("SRCTYPE == PSOFF AND INTERVAL > 60.0") 152 """ 153 rx = re.compile("((SRCTYPE *[!=][=] *)([a-zA-Z.]+))", re.I) 154 for r in rx.findall(query): 155 sval = None 156 stype = r[-1].lower() 157 if stype.find('srctype.') == -1: 158 stype = ".".join(["srctype", stype]) 159 try: 160 sval = eval(stype) 161 sval = "%s%d" % (r[1], sval) 162 except: 163 continue 164 query = query.replace(r[0], sval) 152 165 taql = "SELECT FROM $1 WHERE " + query 153 166 self._settaql(taql)
Note:
See TracChangeset
for help on using the changeset viewer.