Changeset 690 for trunk/python
- Timestamp:
- 09/26/05 10:19:05 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/__init__.py
r665 r690 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 60 61 61 # scantable 62 62 'scantable.save' : ['ASAP', str], … … 71 71 72 72 def list_rcparameters(): 73 73 74 74 print """ 75 75 # general … … 82 82 # apply operations on the input scantable or return new one 83 83 insitu : True 84 84 85 85 # plotting 86 86 # default mode for colour stacking … … 101 101 102 102 # apply action to all axes not just the cursor location 103 scantable.allaxes : True 103 scantable.allaxes : True 104 104 105 105 # use internal plotter … … 108 108 # Control the level of information printed by summary 109 109 scantable.verbosesummary : False 110 111 # Fitter 112 """ 113 110 111 # Fitter 112 """ 113 114 114 def rc_params(): 115 115 'Return the default params updated from the values in the rc file' 116 116 117 117 fname = _asap_fname() 118 118 119 119 if fname is None or not os.path.exists(fname): 120 120 message = 'could not find rc file; returning defaults' … … 122 122 #print message 123 123 return ret 124 124 125 125 cnt = 0 126 126 for line in file(fname): … … 133 133 print ('Illegal line #%d\n\t%s\n\tin file "%s"' % (cnt, line, fname)) 134 134 continue 135 135 136 136 key, val = tup 137 137 key = key.strip() … … 139 139 print ('Bad key "%s" on line %d in %s' % (key, cnt, fname)) 140 140 continue 141 141 142 142 default, converter = defaultParams[key] 143 143 … … 161 161 162 162 # this is the instance used by the asap classes 163 rcParams = rc_params() 163 rcParams = rc_params() 164 164 165 165 rcParamsDefault = dict(rcParams.items()) # a copy … … 175 175 176 176 sets the current rc params and is equivalent to 177 177 178 178 rcParams['scantable.save'] = 'SDFITS' 179 179 … … 182 182 183 183 aliases = {} 184 184 185 185 for k,v in kwargs.items(): 186 186 name = aliases.get(k) or k … … 188 188 if not rcParams.has_key(key): 189 189 raise KeyError('Unrecognized key "%s" for group "%s" and name "%s"' % (key, group, name)) 190 190 191 191 rcParams[key] = v 192 192 … … 224 224 if os.environ.has_key('DISPLAY'): 225 225 print "Initialising asapplotter with the name 'plotter' ..." 226 import asapplotter 226 import asapplotter 227 227 plotter = asapplotter.asapplotter() 228 228 else: 229 229 print "No $DISPLAY set. Disabling plotter.\n" 230 230 231 #from numarray ones,zeros232 233 234 231 __date__ = '$Date$'.split()[1] 235 __version__ = '1. 1'232 __version__ = '1.2' 236 233 237 234 def list_scans(t = scantable): … … 248 245 249 246 def commands(): 250 x = """ 247 x = """ 251 248 [The scan container] 252 249 scantable - a container for integrations/scans … … 287 284 history - print the history of the scantable 288 285 get_fit - get a fit which has been stored witnh the data 289 average_time - return the (weighted) time average of a scan 286 average_time - return the (weighted) time average of a scan 290 287 or a list of scans 291 288 average_pol - average the polarisations together. … … 293 290 all polarisations will contain the 294 291 averaged spectrum. 292 auto_quotient - return the on/off quotient with 293 automatic detection of the on/off scans 295 294 quotient - return the on/off quotient 296 295 scale - return a scan scaled by a given factor 297 add - return a scan with given value added 296 add - return a scan with given value added 298 297 bin - return a scan with binned channels 299 298 resample - return a scan with resampled channels 300 299 smooth - return the spectrally smoothed scan 301 300 poly_baseline - fit a polynomial baseline to all Beams/IFs/Pols 302 auto_poly_baseline - automatically fit a polynomial baseline 301 auto_poly_baseline - automatically fit a polynomial baseline 303 302 gain_el - apply gain-elevation correction 304 303 opacity - apply opacity correction … … 311 310 [Math] Mainly functions which operate on more than one scantable 312 311 313 average_time - return the (weighted) time average 312 average_time - return the (weighted) time average 314 313 of a list of scans 315 314 quotient - return the on/off quotient … … 349 348 set_abcissa - specify a user label for the abcissa 350 349 set_layout - specify the multi-panel layout (rows,cols) 351 350 352 351 [Reading files] 353 352 reader - access rpfits/sdfits files … … 369 368 mask_not - boolean operations on masks created with 370 369 scantable.create_mask 371 370 372 371 Note: 373 372 How to use this with help: … … 375 374 [xxx] is just a category 376 375 Every 'sub-level' in this list should be replaces by a '.' Period when 377 using help 376 using help 378 377 Example: 379 378 ASAP> help scantable # to get info on ths scantable
Note:
See TracChangeset
for help on using the changeset viewer.