[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 * |
---|
[210] | 11 | print "Initialising plotter..." |
---|
| 12 | from asapplotter import * |
---|
| 13 | plotter = asapplotter() |
---|
[100] | 14 | #from numarray ones,zeros |
---|
| 15 | |
---|
| 16 | __date__ = '$Date: 2005-01-18 06:48:30 +0000 (Tue, 18 Jan 2005) $' |
---|
| 17 | __version__ = '0.1a' |
---|
| 18 | |
---|
| 19 | def list_scans(t = scantable): |
---|
| 20 | import sys, types |
---|
| 21 | #meta_t = type(t) |
---|
| 22 | #if meta_t == types.InstanceType: |
---|
| 23 | # t = t.__class__ |
---|
| 24 | #elif meta_t not in [types.ClassType, types.TypeType]: |
---|
| 25 | # t = meta_t |
---|
| 26 | globs = sys.modules['__main__'].__dict__.iteritems() |
---|
[113] | 27 | print "The user created scantables are:" |
---|
| 28 | x = map(lambda x: x[0], filter(lambda x: isinstance(x[1], t), globs)) |
---|
| 29 | print x |
---|
[100] | 30 | |
---|
[113] | 31 | def commands(): |
---|
[210] | 32 | x = """ |
---|
[113] | 33 | [The scan container] |
---|
| 34 | scantable - a container for integrations/scans |
---|
[182] | 35 | (can open asap/rpfits/sdfits and ms files) |
---|
[113] | 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 |
---|
[182] | 41 | stats - get specified statistic of the spectra in |
---|
| 42 | the scantable |
---|
| 43 | stddev - get the standard deviation of the spectra |
---|
| 44 | in the scantable |
---|
[113] | 45 | get_tsys - get the TSys |
---|
| 46 | get_time - get the timestamps of the integrations |
---|
| 47 | set_unit - set the units to be used from this point on |
---|
| 48 | set_freqframe - set the frame info for the Spectral Axis |
---|
| 49 | (e.g. 'LSRK') |
---|
[188] | 50 | create_mask - return an mask in the current unit |
---|
| 51 | for the given region. The specified regions |
---|
| 52 | are NOT masked |
---|
[113] | 53 | set_restfreqs - give a list of rest frequencies |
---|
| 54 | flag_spectrum - flag a whole Beam/IF/Pol |
---|
[116] | 55 | save - save the scantable to disk as either 'ASAP' |
---|
| 56 | or 'SDFITS' |
---|
[113] | 57 | nbeam,nif,nchan,npol - the number of beams/IFs/Pols/Chans |
---|
| 58 | [Math] |
---|
[142] | 59 | average_time - return the (weighted) time average of a scan |
---|
| 60 | or a list of scans |
---|
[128] | 61 | average_pol - average the polarisations together. |
---|
[113] | 62 | The dimension won't be reduced and |
---|
| 63 | all polarisations will contain the |
---|
| 64 | averaged spectrum. |
---|
| 65 | quotient - return the on/off quotient |
---|
| 66 | scale - returns a scan scaled by a given factor |
---|
[149] | 67 | add - returns a scan with given value added |
---|
[113] | 68 | bin - return a scan with binned channels |
---|
[179] | 69 | smooth - return the spectrally smoothed scan |
---|
[113] | 70 | poly_baseline - fit a polynomial baseline to all Beams/IFs/Pols |
---|
[100] | 71 | |
---|
[113] | 72 | fitter |
---|
| 73 | auto_fit - return a scan where the function is |
---|
| 74 | applied to all Beams/IFs/Pols. |
---|
| 75 | commit - return a new scan where the fits have been |
---|
| 76 | commited. |
---|
| 77 | fit - execute the actual fitting process |
---|
| 78 | get_chi2 - get the Chi^2 |
---|
| 79 | set_scan - set the scantable to be fit |
---|
| 80 | set_function - set the fitting function |
---|
| 81 | set_parameters - set the parameters for the function(s), and |
---|
| 82 | set if they should be held fixed during fitting |
---|
| 83 | get_parameters - get the fitted parameters |
---|
[210] | 84 | [Plotter] |
---|
| 85 | asapplotter - a plotter for asap, default plotter is |
---|
| 86 | called 'plotter' |
---|
| 87 | plot - plot a (list of) scantable |
---|
| 88 | set_mode - set the state of the plotter, i.e. |
---|
| 89 | what is to be plotted 'colour stacked' |
---|
| 90 | and what 'panelled' |
---|
| 91 | set_range - set the abcissa 'zoom' range |
---|
| 92 | set_legend_map - specify user labels for the legend indeces |
---|
| 93 | |
---|
[182] | 94 | [Reading files] |
---|
| 95 | reader - access rpfits/sdfits files |
---|
| 96 | read - read in integrations |
---|
| 97 | summary - list info about all integrations |
---|
| 98 | |
---|
[113] | 99 | [General] |
---|
| 100 | commands - this command |
---|
| 101 | print - print details about a variable |
---|
| 102 | list_scans - list all scantables created bt the user |
---|
| 103 | del - delete the given variable from memory |
---|
| 104 | range - create a list of values, e.g. |
---|
| 105 | range(3) = [0,1,2], range(2,5) = [2,3,4] |
---|
| 106 | help - print help for one of the listed functions |
---|
| 107 | execfile - execute an asap script, e.g. execfile('myscript') |
---|
[210] | 108 | Note: |
---|
| 109 | How to use this with help: |
---|
| 110 | # function 'summary' |
---|
| 111 | [xxx] is just a category |
---|
| 112 | Every 'sub-level' in this list should be replaces by a '.' Period when |
---|
| 113 | using help |
---|
| 114 | Example: |
---|
| 115 | ASAP> help scantable # to get info on ths scantable |
---|
| 116 | ASAP> help scantable.summary # to get help on the scantable's |
---|
| 117 | ASAP> help average_time |
---|
| 118 | |
---|
[113] | 119 | """ |
---|
| 120 | print x |
---|
| 121 | return |
---|
| 122 | |
---|
| 123 | print """Welcome to ASAP - the ATNF Single Dish Analysis Package |
---|
[100] | 124 | This is a testing pre-release v0.1a |
---|
| 125 | |
---|
| 126 | Please report any bugs to: |
---|
[128] | 127 | Malte.Marquarding@csiro.au |
---|
[100] | 128 | |
---|
[113] | 129 | [NOTE: ASAP is 0-based] |
---|
| 130 | Type commands() to get a list of all available ASAP commands. |
---|
[100] | 131 | """ |
---|