| [100] | 1 | """
|
|---|
| 2 | This is the ATNF Single Dish Analysis package.
|
|---|
| 3 |
|
|---|
| 4 | """
|
|---|
| 5 | #import _asap
|
|---|
| 6 | #from asaplot import ASAPlot
|
|---|
| [113] | 7 | from asapfitter import *
|
|---|
| [100] | 8 | from asapreader import reader
|
|---|
| 9 | from asapmath import *
|
|---|
| 10 | from scantable import *
|
|---|
| 11 | #from numarray ones,zeros
|
|---|
| 12 |
|
|---|
| 13 | __date__ = '$Date: 2004-12-26 07:38:07 +0000 (Sun, 26 Dec 2004) $'
|
|---|
| 14 | __version__ = '0.1a'
|
|---|
| 15 |
|
|---|
| 16 | def list_scans(t = scantable):
|
|---|
| 17 | import sys, types
|
|---|
| 18 | #meta_t = type(t)
|
|---|
| 19 | #if meta_t == types.InstanceType:
|
|---|
| 20 | # t = t.__class__
|
|---|
| 21 | #elif meta_t not in [types.ClassType, types.TypeType]:
|
|---|
| 22 | # t = meta_t
|
|---|
| 23 | globs = sys.modules['__main__'].__dict__.iteritems()
|
|---|
| [113] | 24 | print "The user created scantables are:"
|
|---|
| 25 | x = map(lambda x: x[0], filter(lambda x: isinstance(x[1], t), globs))
|
|---|
| 26 | print x
|
|---|
| [100] | 27 |
|
|---|
| [113] | 28 | def commands():
|
|---|
| 29 | x = """
|
|---|
| 30 | [Reading files]
|
|---|
| 31 | reader - access rpfits/sdfits files
|
|---|
| 32 | read - read in integrations
|
|---|
| 33 | summary - list info about all integrations
|
|---|
| 34 | [The scan container]
|
|---|
| 35 | scantable - a container for integrations/scans
|
|---|
| 36 | copy - returns a copy of a scan
|
|---|
| 37 | get_scan - gets a specific scan out of a scantable
|
|---|
| 38 | summary - print info about the scantable contents
|
|---|
| 39 | set_selection - set a specific Beam/IF/Pol for furthrt use
|
|---|
| 40 | get_selection - print out the current selection
|
|---|
| [128] | 41 | stats - get specified statistic of the spectra in the scantable
|
|---|
| 42 | stddev - get the standard deviation of the spectra in the scantable
|
|---|
| [113] | 43 | get_tsys - get the TSys
|
|---|
| 44 | get_time - get the timestamps of the integrations
|
|---|
| 45 | set_unit - set the units to be used from this point on
|
|---|
| 46 | set_freqframe - set the frame info for the Spectral Axis
|
|---|
| 47 | (e.g. 'LSRK')
|
|---|
| 48 | create_mask - return a mask in thecurrent unit
|
|---|
| 49 | set_restfreqs - give a list of rest frequencies
|
|---|
| 50 | flag_spectrum - flag a whole Beam/IF/Pol
|
|---|
| [116] | 51 | save - save the scantable to disk as either 'ASAP'
|
|---|
| 52 | or 'SDFITS'
|
|---|
| [113] | 53 | nbeam,nif,nchan,npol - the number of beams/IFs/Pols/Chans
|
|---|
| 54 | [Math]
|
|---|
| [142] | 55 | average_time - return the (weighted) time average of a scan
|
|---|
| 56 | or a list of scans
|
|---|
| [128] | 57 | average_pol - average the polarisations together.
|
|---|
| [113] | 58 | The dimension won't be reduced and
|
|---|
| 59 | all polarisations will contain the
|
|---|
| 60 | averaged spectrum.
|
|---|
| 61 | quotient - return the on/off quotient
|
|---|
| 62 | scale - returns a scan scaled by a given factor
|
|---|
| [149] | 63 | add - returns a scan with given value added
|
|---|
| [113] | 64 | bin - return a scan with binned channels
|
|---|
| 65 | hanning - return the hanning smoothed scan
|
|---|
| 66 | poly_baseline - fit a polynomial baseline to all Beams/IFs/Pols
|
|---|
| [100] | 67 |
|
|---|
| [113] | 68 | fitter
|
|---|
| 69 | auto_fit - return a scan where the function is
|
|---|
| 70 | applied to all Beams/IFs/Pols.
|
|---|
| 71 | commit - return a new scan where the fits have been
|
|---|
| 72 | commited.
|
|---|
| 73 | fit - execute the actual fitting process
|
|---|
| 74 | get_chi2 - get the Chi^2
|
|---|
| 75 | set_scan - set the scantable to be fit
|
|---|
| 76 | set_function - set the fitting function
|
|---|
| 77 | set_parameters - set the parameters for the function(s), and
|
|---|
| 78 | set if they should be held fixed during fitting
|
|---|
| 79 | get_parameters - get the fitted parameters
|
|---|
| 80 |
|
|---|
| 81 | [General]
|
|---|
| 82 | commands - this command
|
|---|
| 83 | print - print details about a variable
|
|---|
| 84 | list_scans - list all scantables created bt the user
|
|---|
| 85 | del - delete the given variable from memory
|
|---|
| 86 | range - create a list of values, e.g.
|
|---|
| 87 | range(3) = [0,1,2], range(2,5) = [2,3,4]
|
|---|
| 88 | help - print help for one of the listed functions
|
|---|
| 89 | execfile - execute an asap script, e.g. execfile('myscript')
|
|---|
| 90 | """
|
|---|
| 91 | print x
|
|---|
| 92 | return
|
|---|
| 93 |
|
|---|
| 94 | print """Welcome to ASAP - the ATNF Single Dish Analysis Package
|
|---|
| [100] | 95 | This is a testing pre-release v0.1a
|
|---|
| 96 |
|
|---|
| 97 | Please report any bugs to:
|
|---|
| [128] | 98 | Malte.Marquarding@csiro.au
|
|---|
| [100] | 99 |
|
|---|
| [113] | 100 | [NOTE: ASAP is 0-based]
|
|---|
| 101 | Type commands() to get a list of all available ASAP commands.
|
|---|
| [100] | 102 | """
|
|---|