[100] | 1 | """ |
---|
| 2 | This is the ATNF Single Dish Analysis package. |
---|
| 3 | |
---|
| 4 | """ |
---|
[226] | 5 | import os,sys |
---|
| 6 | |
---|
[513] | 7 | def _validate_bool(b): |
---|
[226] | 8 | 'Convert b to a boolean or raise' |
---|
| 9 | bl = b.lower() |
---|
| 10 | if bl in ('f', 'no', 'false', '0', 0): return False |
---|
| 11 | elif bl in ('t', 'yes', 'true', '1', 1): return True |
---|
| 12 | else: |
---|
| 13 | raise ValueError('Could not convert "%s" to boolean' % b) |
---|
| 14 | |
---|
[513] | 15 | def _validate_int(s): |
---|
[226] | 16 | 'convert s to int or raise' |
---|
| 17 | try: return int(s) |
---|
| 18 | except ValueError: |
---|
| 19 | raise ValueError('Could not convert "%s" to int' % s) |
---|
| 20 | |
---|
[513] | 21 | def _asap_fname(): |
---|
[226] | 22 | """ |
---|
| 23 | Return the path to the rc file |
---|
| 24 | |
---|
| 25 | Search order: |
---|
| 26 | |
---|
| 27 | * current working dir |
---|
| 28 | * environ var ASAPRC |
---|
[274] | 29 | * HOME/.asaprc |
---|
[706] | 30 | |
---|
[226] | 31 | """ |
---|
| 32 | |
---|
| 33 | fname = os.path.join( os.getcwd(), '.asaprc') |
---|
| 34 | if os.path.exists(fname): return fname |
---|
| 35 | |
---|
| 36 | if os.environ.has_key('ASAPRC'): |
---|
| 37 | path = os.environ['ASAPRC'] |
---|
| 38 | if os.path.exists(path): |
---|
| 39 | fname = os.path.join(path, '.asaprc') |
---|
| 40 | if os.path.exists(fname): |
---|
| 41 | return fname |
---|
| 42 | |
---|
| 43 | if os.environ.has_key('HOME'): |
---|
| 44 | home = os.environ['HOME'] |
---|
| 45 | fname = os.path.join(home, '.asaprc') |
---|
| 46 | if os.path.exists(fname): |
---|
| 47 | return fname |
---|
| 48 | return None |
---|
| 49 | |
---|
[706] | 50 | |
---|
[226] | 51 | defaultParams = { |
---|
| 52 | # general |
---|
[513] | 53 | 'verbose' : [True, _validate_bool], |
---|
| 54 | 'useplotter' : [True, _validate_bool], |
---|
[542] | 55 | 'insitu' : [True, _validate_bool], |
---|
[706] | 56 | |
---|
[226] | 57 | # plotting |
---|
[706] | 58 | 'plotter.gui' : [True, _validate_bool], |
---|
[226] | 59 | 'plotter.stacking' : ['p', str], |
---|
| 60 | 'plotter.panelling' : ['s', str], |
---|
[700] | 61 | 'plotter.colours' : ['', str], |
---|
| 62 | 'plotter.linestyles' : ['', str], |
---|
[710] | 63 | 'plotter.decimate' : [False, _validate_bool], |
---|
| 64 | 'plotter.ganged' : [True, _validate_bool], |
---|
| 65 | |
---|
[226] | 66 | # scantable |
---|
| 67 | 'scantable.save' : ['ASAP', str], |
---|
[513] | 68 | 'scantable.autoaverage' : [True, _validate_bool], |
---|
[226] | 69 | 'scantable.freqframe' : ['LSRK', str], #default frequency frame |
---|
[513] | 70 | 'scantable.verbosesummary' : [False, _validate_bool] |
---|
[226] | 71 | |
---|
| 72 | # fitter |
---|
| 73 | } |
---|
| 74 | |
---|
[255] | 75 | def list_rcparameters(): |
---|
[706] | 76 | |
---|
[255] | 77 | print """ |
---|
[737] | 78 | # general |
---|
| 79 | # print verbose output |
---|
| 80 | verbose : True |
---|
[255] | 81 | |
---|
[737] | 82 | # preload a default plotter |
---|
| 83 | useplotter : True |
---|
[255] | 84 | |
---|
[737] | 85 | # apply operations on the input scantable or return new one |
---|
| 86 | insitu : True |
---|
[706] | 87 | |
---|
[737] | 88 | # plotting |
---|
[710] | 89 | |
---|
[737] | 90 | # do we want a GUI or plot to a file |
---|
| 91 | plotter.gui : True |
---|
[710] | 92 | |
---|
[737] | 93 | # default mode for colour stacking |
---|
| 94 | plotter.stacking : Pol |
---|
[255] | 95 | |
---|
[737] | 96 | # default mode for panelling |
---|
| 97 | plotter.panelling : scan |
---|
[255] | 98 | |
---|
[737] | 99 | # push panels together, to share axislabels |
---|
| 100 | plotter.ganged : True |
---|
[710] | 101 | |
---|
[737] | 102 | # decimate the number of points plotted bya afactor of |
---|
| 103 | # nchan/1024 |
---|
| 104 | plotter.decimate : False |
---|
[733] | 105 | |
---|
[737] | 106 | # default colours/linestyles |
---|
| 107 | plotter.colours : |
---|
| 108 | plotter.linestyles : |
---|
[700] | 109 | |
---|
[737] | 110 | # scantable |
---|
| 111 | # default ouput format when saving |
---|
| 112 | scantable.save : ASAP |
---|
| 113 | # auto averaging on read |
---|
| 114 | scantable.autoaverage : True |
---|
[255] | 115 | |
---|
[737] | 116 | # default frequency frame to set when function |
---|
| 117 | # scantable.set_freqfrmae is called |
---|
| 118 | scantable.freqframe : LSRK |
---|
[255] | 119 | |
---|
[737] | 120 | # Control the level of information printed by summary |
---|
| 121 | scantable.verbosesummary : False |
---|
[706] | 122 | |
---|
[737] | 123 | # Fitter |
---|
| 124 | """ |
---|
[706] | 125 | |
---|
[226] | 126 | def rc_params(): |
---|
| 127 | 'Return the default params updated from the values in the rc file' |
---|
[706] | 128 | |
---|
[513] | 129 | fname = _asap_fname() |
---|
[706] | 130 | |
---|
[226] | 131 | if fname is None or not os.path.exists(fname): |
---|
| 132 | message = 'could not find rc file; returning defaults' |
---|
| 133 | ret = dict([ (key, tup[0]) for key, tup in defaultParams.items()]) |
---|
| 134 | #print message |
---|
| 135 | return ret |
---|
[706] | 136 | |
---|
[226] | 137 | cnt = 0 |
---|
| 138 | for line in file(fname): |
---|
| 139 | cnt +=1 |
---|
| 140 | line = line.strip() |
---|
| 141 | if not len(line): continue |
---|
| 142 | if line.startswith('#'): continue |
---|
| 143 | tup = line.split(':',1) |
---|
| 144 | if len(tup) !=2: |
---|
| 145 | print ('Illegal line #%d\n\t%s\n\tin file "%s"' % (cnt, line, fname)) |
---|
| 146 | continue |
---|
[706] | 147 | |
---|
[226] | 148 | key, val = tup |
---|
| 149 | key = key.strip() |
---|
| 150 | if not defaultParams.has_key(key): |
---|
| 151 | print ('Bad key "%s" on line %d in %s' % (key, cnt, fname)) |
---|
| 152 | continue |
---|
[706] | 153 | |
---|
[226] | 154 | default, converter = defaultParams[key] |
---|
| 155 | |
---|
| 156 | ind = val.find('#') |
---|
| 157 | if ind>=0: val = val[:ind] # ignore trailing comments |
---|
| 158 | val = val.strip() |
---|
| 159 | try: cval = converter(val) # try to convert to proper type or raise |
---|
| 160 | except Exception, msg: |
---|
| 161 | print ('Bad val "%s" on line #%d\n\t"%s"\n\tin file "%s"\n\t%s' % (val, cnt, line, fname, msg)) |
---|
| 162 | continue |
---|
| 163 | else: |
---|
| 164 | # Alles Klar, update dict |
---|
| 165 | defaultParams[key][0] = cval |
---|
| 166 | |
---|
| 167 | # strip the conveter funcs and return |
---|
| 168 | ret = dict([ (key, tup[0]) for key, tup in defaultParams.items()]) |
---|
[466] | 169 | print ('loaded rc file %s'%fname) |
---|
[226] | 170 | |
---|
| 171 | return ret |
---|
| 172 | |
---|
| 173 | |
---|
| 174 | # this is the instance used by the asap classes |
---|
[706] | 175 | rcParams = rc_params() |
---|
[226] | 176 | |
---|
| 177 | rcParamsDefault = dict(rcParams.items()) # a copy |
---|
| 178 | |
---|
| 179 | def rc(group, **kwargs): |
---|
| 180 | """ |
---|
| 181 | Set the current rc params. Group is the grouping for the rc, eg |
---|
[379] | 182 | for scantable.save the group is 'scantable', for plotter.stacking, the |
---|
| 183 | group is 'plotter', and so on. kwargs is a list of attribute |
---|
[226] | 184 | name/value pairs, eg |
---|
| 185 | |
---|
[379] | 186 | rc('scantable', save='SDFITS') |
---|
[226] | 187 | |
---|
| 188 | sets the current rc params and is equivalent to |
---|
[706] | 189 | |
---|
[379] | 190 | rcParams['scantable.save'] = 'SDFITS' |
---|
[226] | 191 | |
---|
| 192 | Use rcdefaults to restore the default rc params after changes. |
---|
| 193 | """ |
---|
| 194 | |
---|
[379] | 195 | aliases = {} |
---|
[706] | 196 | |
---|
[226] | 197 | for k,v in kwargs.items(): |
---|
| 198 | name = aliases.get(k) or k |
---|
| 199 | key = '%s.%s' % (group, name) |
---|
| 200 | if not rcParams.has_key(key): |
---|
| 201 | raise KeyError('Unrecognized key "%s" for group "%s" and name "%s"' % (key, group, name)) |
---|
[706] | 202 | |
---|
[226] | 203 | rcParams[key] = v |
---|
| 204 | |
---|
| 205 | |
---|
| 206 | def rcdefaults(): |
---|
| 207 | """ |
---|
| 208 | Restore the default rc params - the ones that were created at |
---|
| 209 | asap load time |
---|
| 210 | """ |
---|
| 211 | rcParams.update(rcParamsDefault) |
---|
| 212 | |
---|
[513] | 213 | |
---|
| 214 | def _is_sequence_or_number(param, ptype=int): |
---|
| 215 | if isinstance(param,tuple) or isinstance(param,list): |
---|
[928] | 216 | if len(param) == 0: return True # empty list |
---|
[513] | 217 | out = True |
---|
| 218 | for p in param: |
---|
| 219 | out &= isinstance(p,ptype) |
---|
| 220 | return out |
---|
| 221 | elif isinstance(param, ptype): |
---|
| 222 | return True |
---|
| 223 | return False |
---|
| 224 | |
---|
[928] | 225 | def _to_list(param, ptype=int): |
---|
| 226 | if isinstance(param, ptype): |
---|
| 227 | if ptype is str: return param.split() |
---|
| 228 | else: return [param] |
---|
| 229 | if _is_sequence_or_number(param, ptype): |
---|
| 230 | return param |
---|
| 231 | return None |
---|
[715] | 232 | |
---|
[944] | 233 | def unique(x): |
---|
[992] | 234 | """ |
---|
| 235 | Return the unique values in a list |
---|
| 236 | Parameters: |
---|
| 237 | x: the list to reduce |
---|
| 238 | Examples: |
---|
| 239 | x = [1,2,3,3,4] |
---|
| 240 | print unique(x) |
---|
| 241 | [1,2,3,4] |
---|
| 242 | """ |
---|
[944] | 243 | return dict([ (val, 1) for val in x]).keys() |
---|
| 244 | |
---|
[992] | 245 | def list_files(path=".",suffix="rpf"): |
---|
| 246 | """ |
---|
| 247 | Return a list files readable by asap, such as rpf, sdfits, mbf, asap |
---|
| 248 | Parameters: |
---|
| 249 | path: The directory to list (default '.') |
---|
| 250 | suffix: The file extension (default rpf) |
---|
| 251 | Example: |
---|
| 252 | files = list_files("data/","sdfits") |
---|
| 253 | print files |
---|
| 254 | ['data/2001-09-01_0332_P363.sdfits', |
---|
| 255 | 'data/2003-04-04_131152_t0002.sdfits', |
---|
| 256 | 'data/Sgr_86p262_best_SPC.sdfits'] |
---|
| 257 | """ |
---|
| 258 | import os |
---|
| 259 | if not os.path.isdir(path): |
---|
| 260 | return None |
---|
| 261 | valid = "rpf sdf sdfits mbf asap".split() |
---|
| 262 | if not suffix in valid: |
---|
| 263 | return None |
---|
| 264 | files = [os.path.expanduser(os.path.expandvars(path+"/"+f)) for f in os.listdir(path)] |
---|
| 265 | return filter(lambda x: x.endswith(suffix),files) |
---|
| 266 | |
---|
[715] | 267 | # workaround for ipython, which redirects this if banner=0 in ipythonrc |
---|
| 268 | sys.stdout = sys.__stdout__ |
---|
| 269 | sys.stderr = sys.__stderr__ |
---|
| 270 | |
---|
| 271 | # Logging |
---|
| 272 | from asap._asap import Log as _asaplog |
---|
| 273 | global asaplog |
---|
[710] | 274 | asaplog=_asaplog() |
---|
[715] | 275 | if rcParams['verbose']: |
---|
| 276 | asaplog.enable() |
---|
| 277 | else: |
---|
| 278 | asaplog.disable() |
---|
| 279 | |
---|
| 280 | def print_log(): |
---|
| 281 | log = asaplog.pop() |
---|
| 282 | if len(log) and rcParams['verbose']: print log |
---|
| 283 | return |
---|
| 284 | |
---|
[113] | 285 | from asapfitter import * |
---|
[895] | 286 | from asapreader import reader |
---|
[944] | 287 | from selector import selector |
---|
[710] | 288 | |
---|
[100] | 289 | from asapmath import * |
---|
[880] | 290 | from scantable import * |
---|
| 291 | from asaplinefind import * |
---|
[876] | 292 | #from asapfit import * |
---|
[285] | 293 | |
---|
[466] | 294 | from numarray import logical_and as mask_and |
---|
| 295 | from numarray import logical_or as mask_or |
---|
| 296 | from numarray import logical_not as mask_not |
---|
| 297 | |
---|
[928] | 298 | if rcParams['useplotter']: |
---|
| 299 | from asapplotter import * |
---|
| 300 | gui = os.environ.has_key('DISPLAY') and rcParams['plotter.gui'] |
---|
| 301 | plotter = asapplotter(gui) |
---|
| 302 | del gui |
---|
[285] | 303 | |
---|
[574] | 304 | __date__ = '$Date: 2006-04-13 05:05:23 +0000 (Thu, 13 Apr 2006) $'.split()[1] |
---|
[984] | 305 | __version__ = '2.0b' |
---|
[100] | 306 | |
---|
[706] | 307 | if rcParams['verbose']: |
---|
[1014] | 308 | def version(): print "ASAP %s(%s)"% (__version__, __date__) |
---|
[706] | 309 | def list_scans(t = scantable): |
---|
| 310 | import sys, types |
---|
| 311 | globs = sys.modules['__main__'].__dict__.iteritems() |
---|
| 312 | print "The user created scantables are:" |
---|
| 313 | sts = map(lambda x: x[0], filter(lambda x: isinstance(x[1], t), globs)) |
---|
| 314 | print filter(lambda x: not x.startswith('_'), sts) |
---|
| 315 | return |
---|
[100] | 316 | |
---|
[715] | 317 | def commands(): |
---|
| 318 | x = """ |
---|
[113] | 319 | [The scan container] |
---|
| 320 | scantable - a container for integrations/scans |
---|
[182] | 321 | (can open asap/rpfits/sdfits and ms files) |
---|
[113] | 322 | copy - returns a copy of a scan |
---|
| 323 | get_scan - gets a specific scan out of a scantable |
---|
[984] | 324 | (by name or number) |
---|
| 325 | set_selection - set a new subselection of the data |
---|
| 326 | get_selection - get the current selection object |
---|
[113] | 327 | summary - print info about the scantable contents |
---|
[182] | 328 | stats - get specified statistic of the spectra in |
---|
| 329 | the scantable |
---|
| 330 | stddev - get the standard deviation of the spectra |
---|
| 331 | in the scantable |
---|
[113] | 332 | get_tsys - get the TSys |
---|
| 333 | get_time - get the timestamps of the integrations |
---|
[733] | 334 | get_sourcename - get the source names of the scans |
---|
[794] | 335 | get_azimuth - get the azimuth of the scans |
---|
| 336 | get_elevation - get the elevation of the scans |
---|
| 337 | get_parangle - get the parallactic angle of the scans |
---|
[876] | 338 | get_unit - get the current unit |
---|
[513] | 339 | set_unit - set the abcissa unit to be used from this |
---|
| 340 | point on |
---|
[255] | 341 | get_abcissa - get the abcissa values and name for a given |
---|
| 342 | row (time) |
---|
[113] | 343 | set_freqframe - set the frame info for the Spectral Axis |
---|
| 344 | (e.g. 'LSRK') |
---|
[276] | 345 | set_doppler - set the doppler to be used from this point on |
---|
[984] | 346 | set_dirframe - set the frame for the direction on the sky |
---|
[240] | 347 | set_instrument - set the instrument name |
---|
[255] | 348 | get_fluxunit - get the brightness flux unit |
---|
[240] | 349 | set_fluxunit - set the brightness flux unit |
---|
[188] | 350 | create_mask - return an mask in the current unit |
---|
| 351 | for the given region. The specified regions |
---|
| 352 | are NOT masked |
---|
[255] | 353 | get_restfreqs - get the current list of rest frequencies |
---|
| 354 | set_restfreqs - set a list of rest frequencies |
---|
[1012] | 355 | flag - flag selected channels in the data |
---|
[116] | 356 | save - save the scantable to disk as either 'ASAP' |
---|
| 357 | or 'SDFITS' |
---|
[486] | 358 | nbeam,nif,nchan,npol - the number of beams/IFs/Pols/Chans |
---|
[733] | 359 | nscan - the number of scans in the scantable |
---|
[984] | 360 | nrow - te number of spectra in the scantable |
---|
[486] | 361 | history - print the history of the scantable |
---|
[530] | 362 | get_fit - get a fit which has been stored witnh the data |
---|
[706] | 363 | average_time - return the (weighted) time average of a scan |
---|
[513] | 364 | or a list of scans |
---|
| 365 | average_pol - average the polarisations together. |
---|
[113] | 366 | The dimension won't be reduced and |
---|
| 367 | all polarisations will contain the |
---|
| 368 | averaged spectrum. |
---|
[992] | 369 | convert_pol - convert to a different polarisation type |
---|
[690] | 370 | auto_quotient - return the on/off quotient with |
---|
| 371 | automatic detection of the on/off scans |
---|
[733] | 372 | (matched pairs and 1 off - n on) |
---|
[1014] | 373 | scale, *, / - return a scan scaled by a given factor |
---|
| 374 | add, +, - - return a scan with given value added |
---|
[513] | 375 | bin - return a scan with binned channels |
---|
| 376 | resample - return a scan with resampled channels |
---|
| 377 | smooth - return the spectrally smoothed scan |
---|
| 378 | poly_baseline - fit a polynomial baseline to all Beams/IFs/Pols |
---|
[706] | 379 | auto_poly_baseline - automatically fit a polynomial baseline |
---|
[780] | 380 | recalc_azel - recalculate azimuth and elevation based on |
---|
| 381 | the pointing |
---|
[513] | 382 | gain_el - apply gain-elevation correction |
---|
| 383 | opacity - apply opacity correction |
---|
| 384 | convert_flux - convert to and from Jy and Kelvin brightness |
---|
[255] | 385 | units |
---|
[513] | 386 | freq_align - align spectra in frequency frame |
---|
[1014] | 387 | invert_phase - Invert the phase of the cross-correlation |
---|
| 388 | swap_linears - Swap XX and YY |
---|
[513] | 389 | rotate_xyphase - rotate XY phase of cross correlation |
---|
| 390 | rotate_linpolphase - rotate the phase of the complex |
---|
| 391 | polarization O=Q+iU correlation |
---|
[733] | 392 | freq_switch - perform frequency switching on the data |
---|
| 393 | stats - Determine the specified statistic, e.g. 'min' |
---|
| 394 | 'max', 'rms' etc. |
---|
| 395 | stddev - Determine the standard deviation of the current |
---|
| 396 | beam/if/pol |
---|
[1014] | 397 | [Selection] |
---|
| 398 | selector - a selection object to set a subset of a scantable |
---|
| 399 | set_scans - set (a list of) scans by index |
---|
| 400 | set_cycles - set (a list of) cycles by index |
---|
| 401 | set_beams - set (a list of) beamss by index |
---|
| 402 | set_ifs - set (a list of) ifs by index |
---|
| 403 | set_polarisations - set (a list of) polarisations by name |
---|
| 404 | or by index |
---|
| 405 | set_names - set a selection by name (wildcards allowed) |
---|
| 406 | set_tsys - set a selection by tsys thresholds |
---|
| 407 | reset - unset all selections |
---|
| 408 | + - merge to selections |
---|
[733] | 409 | |
---|
[513] | 410 | [Math] Mainly functions which operate on more than one scantable |
---|
[100] | 411 | |
---|
[706] | 412 | average_time - return the (weighted) time average |
---|
[513] | 413 | of a list of scans |
---|
| 414 | quotient - return the on/off quotient |
---|
| 415 | simple_math - simple mathematical operations on two scantables, |
---|
| 416 | 'add', 'sub', 'mul', 'div' |
---|
| 417 | [Fitting] |
---|
[113] | 418 | fitter |
---|
| 419 | auto_fit - return a scan where the function is |
---|
| 420 | applied to all Beams/IFs/Pols. |
---|
| 421 | commit - return a new scan where the fits have been |
---|
| 422 | commited. |
---|
| 423 | fit - execute the actual fitting process |
---|
[984] | 424 | store_fit - store the fit parameters in the data (scantable) |
---|
[113] | 425 | get_chi2 - get the Chi^2 |
---|
| 426 | set_scan - set the scantable to be fit |
---|
| 427 | set_function - set the fitting function |
---|
| 428 | set_parameters - set the parameters for the function(s), and |
---|
| 429 | set if they should be held fixed during fitting |
---|
[513] | 430 | set_gauss_parameters - same as above but specialised for individual |
---|
| 431 | gaussian components |
---|
[113] | 432 | get_parameters - get the fitted parameters |
---|
[513] | 433 | plot - plot the resulting fit and/or components and |
---|
| 434 | residual |
---|
[210] | 435 | [Plotter] |
---|
| 436 | asapplotter - a plotter for asap, default plotter is |
---|
| 437 | called 'plotter' |
---|
[984] | 438 | plot - plot a scantable |
---|
[378] | 439 | save - save the plot to a file ('png' ,'ps' or 'eps') |
---|
[210] | 440 | set_mode - set the state of the plotter, i.e. |
---|
| 441 | what is to be plotted 'colour stacked' |
---|
| 442 | and what 'panelled' |
---|
[984] | 443 | set_selection - only plot a selected part of the data |
---|
[733] | 444 | set_range - set a 'zoom' window [xmin,xmax,ymin,ymax] |
---|
[255] | 445 | set_legend - specify user labels for the legend indeces |
---|
| 446 | set_title - specify user labels for the panel indeces |
---|
[733] | 447 | set_abcissa - specify a user label for the abcissa |
---|
[255] | 448 | set_ordinate - specify a user label for the ordinate |
---|
[378] | 449 | set_layout - specify the multi-panel layout (rows,cols) |
---|
[733] | 450 | set_colors - specify a set of colours to use |
---|
| 451 | set_linestyles - specify a set of linestyles to use if only |
---|
| 452 | using one color |
---|
| 453 | set_mask - set a plotting mask for a specific polarization |
---|
[706] | 454 | |
---|
[182] | 455 | [Reading files] |
---|
| 456 | reader - access rpfits/sdfits files |
---|
[984] | 457 | open - attach reader to a file |
---|
| 458 | close - detach reader from file |
---|
[182] | 459 | read - read in integrations |
---|
| 460 | summary - list info about all integrations |
---|
| 461 | |
---|
[113] | 462 | [General] |
---|
| 463 | commands - this command |
---|
| 464 | print - print details about a variable |
---|
| 465 | list_scans - list all scantables created bt the user |
---|
[992] | 466 | list_files - list all files readable by asap (default rpf) |
---|
[113] | 467 | del - delete the given variable from memory |
---|
| 468 | range - create a list of values, e.g. |
---|
| 469 | range(3) = [0,1,2], range(2,5) = [2,3,4] |
---|
| 470 | help - print help for one of the listed functions |
---|
| 471 | execfile - execute an asap script, e.g. execfile('myscript') |
---|
[255] | 472 | list_rcparameters - print out a list of possible values to be |
---|
[274] | 473 | put into $HOME/.asaprc |
---|
[466] | 474 | mask_and,mask_or, |
---|
| 475 | mask_not - boolean operations on masks created with |
---|
| 476 | scantable.create_mask |
---|
[706] | 477 | |
---|
[210] | 478 | Note: |
---|
| 479 | How to use this with help: |
---|
| 480 | # function 'summary' |
---|
| 481 | [xxx] is just a category |
---|
| 482 | Every 'sub-level' in this list should be replaces by a '.' Period when |
---|
[706] | 483 | using help |
---|
[210] | 484 | Example: |
---|
| 485 | ASAP> help scantable # to get info on ths scantable |
---|
| 486 | ASAP> help scantable.summary # to get help on the scantable's |
---|
| 487 | ASAP> help average_time |
---|
| 488 | |
---|
[715] | 489 | """ |
---|
| 490 | print x |
---|
| 491 | return |
---|
[113] | 492 | |
---|
[706] | 493 | def welcome(): |
---|
| 494 | return """Welcome to ASAP v%s (%s) - the ATNF Spectral Analysis Package |
---|
[100] | 495 | |
---|
| 496 | Please report any bugs to: |
---|
[555] | 497 | asap@atnf.csiro.au |
---|
[100] | 498 | |
---|
[378] | 499 | [IMPORTANT: ASAP is 0-based] |
---|
[706] | 500 | Type commands() to get a list of all available ASAP commands.""" % (__version__, __date__) |
---|