Changeset 700 for trunk/python
- Timestamp:
- 10/20/05 16:44:18 (19 years ago)
- Location:
- trunk/python
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/__init__.py
r690 r700 28 28 * environ var ASAPRC 29 29 * HOME/.asaprc 30 30 31 31 """ 32 32 … … 47 47 return fname 48 48 return None 49 49 50 50 51 51 defaultParams = { … … 54 54 'useplotter' : [True, _validate_bool], 55 55 'insitu' : [True, _validate_bool], 56 56 57 57 # plotting 58 58 'plotter.stacking' : ['p', str], 59 59 'plotter.panelling' : ['s', str], 60 'plotter.colours' : ['', str], 61 'plotter.linestyles' : ['', str], 60 62 61 63 # scantable … … 71 73 72 74 def list_rcparameters(): 73 75 74 76 print """ 75 77 # general … … 82 84 # apply operations on the input scantable or return new one 83 85 insitu : True 84 86 85 87 # plotting 86 88 # default mode for colour stacking … … 89 91 # default mode for panelling 90 92 plotter.panelling : scan 93 94 # default colours/linestyles 95 plotter.colours : 96 plotter.linestyles : 91 97 92 98 # scantable … … 101 107 102 108 # apply action to all axes not just the cursor location 103 scantable.allaxes : True 109 scantable.allaxes : True 104 110 105 111 # use internal plotter … … 108 114 # Control the level of information printed by summary 109 115 scantable.verbosesummary : False 110 111 # Fitter 112 """ 113 116 117 # Fitter 118 """ 119 114 120 def rc_params(): 115 121 'Return the default params updated from the values in the rc file' 116 122 117 123 fname = _asap_fname() 118 124 119 125 if fname is None or not os.path.exists(fname): 120 126 message = 'could not find rc file; returning defaults' … … 122 128 #print message 123 129 return ret 124 130 125 131 cnt = 0 126 132 for line in file(fname): … … 133 139 print ('Illegal line #%d\n\t%s\n\tin file "%s"' % (cnt, line, fname)) 134 140 continue 135 141 136 142 key, val = tup 137 143 key = key.strip() … … 139 145 print ('Bad key "%s" on line %d in %s' % (key, cnt, fname)) 140 146 continue 141 147 142 148 default, converter = defaultParams[key] 143 149 … … 161 167 162 168 # this is the instance used by the asap classes 163 rcParams = rc_params() 169 rcParams = rc_params() 164 170 165 171 rcParamsDefault = dict(rcParams.items()) # a copy … … 175 181 176 182 sets the current rc params and is equivalent to 177 183 178 184 rcParams['scantable.save'] = 'SDFITS' 179 185 … … 182 188 183 189 aliases = {} 184 190 185 191 for k,v in kwargs.items(): 186 192 name = aliases.get(k) or k … … 188 194 if not rcParams.has_key(key): 189 195 raise KeyError('Unrecognized key "%s" for group "%s" and name "%s"' % (key, group, name)) 190 196 191 197 rcParams[key] = v 192 198 … … 224 230 if os.environ.has_key('DISPLAY'): 225 231 print "Initialising asapplotter with the name 'plotter' ..." 226 import asapplotter 232 import asapplotter 227 233 plotter = asapplotter.asapplotter() 228 234 else: 229 235 print "No $DISPLAY set. Disabling plotter.\n" 230 236 237 231 238 __date__ = '$Date$'.split()[1] 232 __version__ = '1. 2'239 __version__ = '1.1' 233 240 234 241 def list_scans(t = scantable): 235 242 import sys, types 236 #meta_t = type(t)237 #if meta_t == types.InstanceType:238 # t = t.__class__239 #elif meta_t not in [types.ClassType, types.TypeType]:240 # t = meta_t241 243 globs = sys.modules['__main__'].__dict__.iteritems() 242 244 print "The user created scantables are:" … … 245 247 246 248 def commands(): 247 x = """ 249 x = """ 248 250 [The scan container] 249 251 scantable - a container for integrations/scans … … 284 286 history - print the history of the scantable 285 287 get_fit - get a fit which has been stored witnh the data 286 average_time - return the (weighted) time average of a scan 288 average_time - return the (weighted) time average of a scan 287 289 or a list of scans 288 290 average_pol - average the polarisations together. … … 294 296 quotient - return the on/off quotient 295 297 scale - return a scan scaled by a given factor 296 add - return a scan with given value added 298 add - return a scan with given value added 297 299 bin - return a scan with binned channels 298 300 resample - return a scan with resampled channels 299 301 smooth - return the spectrally smoothed scan 300 302 poly_baseline - fit a polynomial baseline to all Beams/IFs/Pols 301 auto_poly_baseline - automatically fit a polynomial baseline 303 auto_poly_baseline - automatically fit a polynomial baseline 302 304 gain_el - apply gain-elevation correction 303 305 opacity - apply opacity correction … … 310 312 [Math] Mainly functions which operate on more than one scantable 311 313 312 average_time - return the (weighted) time average 314 average_time - return the (weighted) time average 313 315 of a list of scans 314 316 quotient - return the on/off quotient … … 348 350 set_abcissa - specify a user label for the abcissa 349 351 set_layout - specify the multi-panel layout (rows,cols) 350 352 351 353 [Reading files] 352 354 reader - access rpfits/sdfits files … … 368 370 mask_not - boolean operations on masks created with 369 371 scantable.create_mask 370 372 371 373 Note: 372 374 How to use this with help: … … 374 376 [xxx] is just a category 375 377 Every 'sub-level' in this list should be replaces by a '.' Period when 376 using help 378 using help 377 379 Example: 378 380 ASAP> help scantable # to get info on ths scantable -
trunk/python/asapplotter.py
r652 r700 359 359 if self._title and len(self._title) > 0: 360 360 tlab = self._title[ii] 361 else: 362 if self._panelling == 'p': 363 tlab = self._get_pollabel(scan, polmode) 364 else: 365 tlab = self._ldict.get(self._panelling)+' '+str(i) 361 else: 362 tlab = self._ldict.get(self._panelling)+' '+str(i) 366 363 if self._lmap and len(self._lmap) > 0: 367 364 llab = self._lmap[jj]
Note:
See TracChangeset
for help on using the changeset viewer.