Changeset 1857
- Timestamp:
- 08/05/10 11:45:38 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/scantable.py
r1856 r1857 22 22 def wrap(obj, *args, **kw): 23 23 basesel = obj.get_selection() 24 val = func(obj, *args, **kw) 25 obj.set_selection(basesel) 24 try: 25 val = func(obj, *args, **kw) 26 finally: 27 obj.set_selection(basesel) 26 28 return val 27 29 return wrap … … 1475 1477 for h in hist: 1476 1478 if h.startswith("---"): 1477 out += "\n"+h1479 out = "\n".join([out, h]) 1478 1480 else: 1479 1481 items = h.split("##") … … 1486 1488 s = i.split("=") 1487 1489 out += "\n %s = %s" % (s[0], s[1]) 1488 out += "\n"+"-"*801490 out = "\n".join([out, "-"*80]) 1489 1491 if filename is not None: 1490 1492 if filename is "": … … 2363 2365 2364 2366 @print_log_dec 2367 @preserve_selection 2365 2368 def auto_quotient(self, preserve=True, mode='paired', verify=False): 2366 2369 """\ … … 2373 2376 preserve: you can preserve (default) the continuum or 2374 2377 remove it. The equations used are 2378 2375 2379 preserve: Output = Toff * (on/off) - Toff 2380 2376 2381 remove: Output = Toff * (on/off) - Ton 2377 2382 … … 2385 2390 finds the closest off in time 2386 2391 2387 """ 2392 .. todo:: verify argument is not implemented 2393 2394 """ 2395 varlist = vars() 2388 2396 modes = ["time", "paired"] 2389 2397 if not mode in modes: 2390 2398 msg = "please provide valid mode. Valid modes are %s" % (modes) 2391 2399 raise ValueError(msg) 2392 varlist = vars()2393 2400 s = None 2394 2401 if mode.lower() == "paired": 2395 basesel = self.get_selection() 2396 sel = selector()+basesel 2402 sel = self.get_selection() 2397 2403 sel.set_query("SRCTYPE==1") 2398 2404 self.set_selection(sel) … … 2402 2408 ons = self.copy() 2403 2409 s = scantable(self._math._quotient(ons, offs, preserve)) 2404 self.set_selection(basesel)2405 2410 elif mode.lower() == "time": 2406 2411 s = scantable(self._math._auto_quotient(self, mode, preserve))
Note:
See TracChangeset
for help on using the changeset viewer.