Changeset 1283 for tags/Release2.1.1b/python/__init__.py
- Timestamp:
- 11/06/06 12:10:26 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/Release2.1.1b/python/__init__.py
r1274 r1283 253 253 rcParams.update(rcParamsDefault) 254 254 255 def _n_bools(n, val): 256 return [ val for i in xrange(n) ] 255 257 256 258 def _is_sequence_or_number(param, ptype=int): … … 301 303 if not os.path.isdir(path): 302 304 return None 303 valid = "rpf sdf sdfits mbf asap".split()305 valid = "rpf rpf.1 rpf.2 sdf sdfits mbf asap".split() 304 306 if not suffix in valid: 305 307 return None … … 325 327 return 326 328 327 try: 328 import numpy.core as NUM 329 except ImportError: 330 try: 331 import numarray as NUM 332 except ImportError: 333 raise ImportError("You need to have numpy or numarray installed") 329 def mask_and(a, b): 330 assert(len(a)==len(b)) 331 return [ a[i] & b[i] for i in xrange(len(a)) ] 332 333 def mask_or(a, b): 334 assert(len(a)==len(b)) 335 return [ a[i] | b[i] for i in xrange(len(a)) ] 336 337 def mask_not(a): 338 return [ not i for i in a ] 334 339 335 340 from asapfitter import fitter … … 342 347 from linecatalog import linecatalog 343 348 344 mask_and = NUM.logical_and345 mask_or = NUM.logical_or346 mask_not = NUM.logical_not347 348 349 if rcParams['useplotter']: 349 from asapplotter import asapplotter 350 gui = os.environ.has_key('DISPLAY') and rcParams['plotter.gui'] 351 if gui: 352 import pylab as xyplotter 353 plotter = asapplotter(gui) 354 del gui 350 try: 351 from asapplotter import asapplotter 352 gui = os.environ.has_key('DISPLAY') and rcParams['plotter.gui'] 353 if gui: 354 import pylab as xyplotter 355 plotter = asapplotter(gui) 356 del gui 357 except ImportError: 358 print "Matplotlib not installed. No plotting available" 355 359 356 360 __date__ = '$Date$'.split()[1]
Note: See TracChangeset
for help on using the changeset viewer.