Changeset 1757 for branches/alma/python/__init__.py
- Timestamp:
- 06/09/10 19:03:06 (14 years ago)
- Location:
- branches/alma
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/alma
-
Property
svn:ignore
set to
.sconf_temp
.sconsign.dblite
-
Property
svn:mergeinfo
set to
/branches/asap-3.x merged eligible
-
Property
svn:ignore
set to
-
branches/alma/python/__init__.py
r1729 r1757 4 4 """ 5 5 import os,sys,shutil, platform 6 try: 7 from functools import wraps as wraps_dec 8 except ImportError: 9 from asap.compatibility import wraps as wraps_dec 6 10 7 11 # Set up CASAPATH and first time use of asap i.e. ~/.asap/* … … 33 37 #shutil.copyfile(asapdata+"/data/ipythonrc-asap", userdir+"/ipythonrc-asap") 34 38 # commented out by TT on 2009.06.23 for casapy use 35 ##shutil.copyfile(asapdata+"/data/ipy_user_conf.py", 39 ##shutil.copyfile(asapdata+"/data/ipy_user_conf.py", 36 40 ## userdir+"/ipy_user_conf.py") 37 41 f = file(userdir+"/asapuserfuncs.py", "w") … … 43 47 # upgrade to support later ipython versions 44 48 ##if not os.path.exists(userdir+"/ipy_user_conf.py"): 45 ## shutil.copyfile(asapdata+"/data/ipy_user_conf.py", 49 ## shutil.copyfile(asapdata+"/data/ipy_user_conf.py", 46 50 ## userdir+"/ipy_user_conf.py") 47 51 … … 74 78 75 79 """ 76 77 80 fname = os.path.join( os.getcwd(), '.asaprc') 78 81 if os.path.exists(fname): return fname … … 109 112 'plotter.histogram' : [False, _validate_bool], 110 113 'plotter.papertype' : ['A4', str], 111 'plotter.xaxisformatting' : ['asap', str], 114 ## for older Matplotlib version 115 #'plotter.axesformatting' : ['mpl', str], 116 'plotter.axesformatting' : ['asap', str], 112 117 113 118 # scantable … … 118 123 'scantable.storage' : ['memory', str], 119 124 'scantable.history' : [True, _validate_bool], 120 'scantable.reference' : ['.*(e|w|_R)$', str] 125 'scantable.reference' : ['.*(e|w|_R)$', str], 126 'scantable.parallactify' : [False, _validate_bool] 121 127 # fitter 122 128 } … … 146 152 plotter.panelling : scan 147 153 148 # push panels together, to share axis labels154 # push panels together, to share axis labels 149 155 plotter.ganged : True 150 156 … … 164 170 165 171 # The formatting style of the xaxis 166 plotter. xaxisformatting : 'asap' or 'mpl'172 plotter.axesformatting : 'mpl' (default) or 'asap' (for old versions of matplotlib) 167 173 168 174 # scantable … … 189 195 # Control the identification of reference (off) scans 190 196 # This is has to be a regular expression 191 scantable.reference : .*(e|w|_R)$ 197 scantable.reference : .*(e|w|_R)$ 198 199 # Indicate whether the data was parallactified (total phase offest == 0.0) 200 scantable.parallactify : False 201 192 202 # Fitter 193 203 """ … … 290 300 291 301 def _n_bools(n, val): 292 return [ val for i in xrange(n) ] 302 return [ val for i in xrange(n) ] 293 303 294 304 def _is_sequence_or_number(param, ptype=int): … … 357 367 asaplog.disable() 358 368 369 370 def print_log_dec(f): 371 @wraps_dec(f) 372 def wrap_it(*args, **kw): 373 val = f(*args, **kw) 374 print_log() 375 return val 376 return wrap_it 377 359 378 def print_log(level='INFO'): 360 379 from taskinit import casalog … … 382 401 from scantable import scantable 383 402 from asaplinefind import linefinder 403 from simplelinefinder import simplelinefinder 384 404 from linecatalog import linecatalog 385 405 from interactivemask import interactivemask 406 from opacity import skydip 407 from opacity import model as opacity_model 386 408 387 409 if rcParams['useplotter']: … … 392 414 import matplotlib 393 415 if not matplotlib.sys.modules['matplotlib.backends']: matplotlib.use("TkAgg") 394 import pylab416 from matplotlib import pylab 395 417 xyplotter = pylab 396 418 plotter = asapplotter(gui) … … 402 424 403 425 __date__ = '$Date$'.split()[1] 404 __version__ = ' 2.3.1alma'426 __version__ = '3.0.0 alma' 405 427 # nrao casapy specific, get revision number 406 428 #__revision__ = ' unknown ' … … 427 449 428 450 def is_ipython(): 429 return ' __IP' in dir(sys.modules["__main__"])451 return 'IPython' in sys.modules.keys() 430 452 if is_ipython(): 431 453 def version(): print "ASAP %s(%s)"% (__version__, __date__) 454 432 455 def list_scans(t = scantable): 433 import types 434 globs = sys.modules['__main__'].__dict__.iteritems() 435 print "The user created scantables are:" 436 sts = map(lambda x: x[0], filter(lambda x: isinstance(x[1], t), globs)) 437 print filter(lambda x: not x.startswith('_'), sts) 438 return 456 import inspect 457 print "The user created scantables are: ", 458 globs=inspect.currentframe().f_back.f_locals.copy() 459 out = [ k for k,v in globs.iteritems() \ 460 if isinstance(v, scantable) and not k.startswith("_") ] 461 print out 462 return out 439 463 440 464 def commands(): … … 462 486 get_elevation - get the elevation of the scans 463 487 get_parangle - get the parallactic angle of the scans 488 get_coordinate - get the spectral coordinate for the given row, 489 which can be used for coordinate conversions 490 get_weather - get the weather condition parameters 464 491 get_unit - get the current unit 465 492 set_unit - set the abcissa unit to be used from this … … 506 533 mx_quotient - Form a quotient using MX data (off beams) 507 534 scale, *, / - return a scan scaled by a given factor 508 add, +, - - return a scan with given value added 535 add, + - return a scan with given value added 536 sub, - - return a scan with given value subtracted 509 537 bin - return a scan with binned channels 510 538 resample - return a scan with resampled channels … … 529 557 stddev - Determine the standard deviation of the current 530 558 beam/if/pol 559 get_row_selector - get the selection object for a specified row 560 number 531 561 [Selection] 532 562 selector - a selection object to set a subset of a scantable … … 590 620 plot - plot a scantable 591 621 plot_lines - plot a linecatalog overlay 622 plotazel - plot azimuth and elevation versus time 623 plotpointing - plot telescope pointings 592 624 save - save the plot to a file ('png' ,'ps' or 'eps') 593 625 set_mode - set the state of the plotter, i.e. … … 613 645 axhline,axvline - draw horizontal/vertical lines 614 646 axhspan,axvspan - draw horizontal/vertical regions 647 annotate - draw an arrow with label 648 create_mask - create a scnatble mask interactively 615 649 616 650 xyplotter - matplotlib/pylab plotting functions 617 618 [Reading files]619 reader - access rpfits/sdfits files620 open - attach reader to a file621 close - detach reader from file622 read - read in integrations623 summary - list info about all integrations624 651 625 652 [General] 626 653 commands - this command 627 654 print - print details about a variable 628 list_scans - list all scantables created b tthe user655 list_scans - list all scantables created by the user 629 656 list_files - list all files readable by asap (default rpf) 630 657 del - delete the given variable from memory … … 639 666 mask_not - boolean operations on masks created with 640 667 scantable.create_mask 668 skydip - gain opacity values from a sky dip observation 669 opacity_model - compute opacities fro given frequencies based on 670 atmospheric model 641 671 642 672 Note:
Note: See TracChangeset
for help on using the changeset viewer.