Changeset 790 for branches/Release12


Ignore:
Timestamp:
12/09/05 13:24:44 (19 years ago)
Author:
phi196
Message:

Added index, Mopra example, updated function sumary

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Release12/doc/cookbook.tex

    r774 r790  
    33\usepackage{calc}
    44\usepackage[dvips]{graphicx}
     5\usepackage{makeidx}
    56
    67% Adjust the page size
     
    2223  \begin{minipage}[t]{\textwidth-75mm}#3\end{minipage}
    2324}
     25
     26\makeindex
     27
    2428
    2529\begin{document}
     
    5054\end{itemize}
    5155
    52 To start asap log onto one of these Linux hosts and enter
     56\index{Running}To start asap log onto one of these Linux hosts and enter
    5357
    5458\begin{verbatim}
     
    6266\section{Interface}
    6367
    64 ASAP is written in C++ and python. The user interface uses the
     68\index{Interface}ASAP is written in C++ and python. The user interface uses the
    6569``ipython'' interactive shell, which is a simple interactive interface
    6670to python. The user does not need to understand python to use this,
     
    7579
    7680\subsection{Objects}
    77 
     81\index{objects}
    7882The ASAP interface is based around a number of ``objects'' which the
    7983user deals with. Objects range from the data which have been read from
     
    98102\subsection{Member Functions (functions)}
    99103
    100 Following the object oriented approach, objects have associated
    101 ``member functions'' which can either be used to modify the data in
    102 some way or change global properties of the object. In this document
    103 member functions will be referred to simply as functions. From the
    104 command line, the user can execute these functions using the syntax:
     104\index{Functions!member}Following the object oriented approach,
     105objects have associated ``member functions'' which can either be used
     106to modify the data in some way or change global properties of the
     107object. In this document member functions will be referred to simply
     108as functions. From the command line, the user can execute these
     109functions using the syntax:
    105110\begin{verbatim}
    106111  ASAP> out = object.function(arguments)
     
    126131\subsection{Global Functions}
    127132
    128 It does not make sense to implement some functions as member
     133\index{Functions!global}It does not make sense to implement some functions as member
    129134functions, typically functions which operate on more than one
    130135scantable (e.g. time averaging of many scans). These functions will
     
    133138\subsection{Interactive environment}
    134139
    135 ipython has a number of useful interactive features and a few things
    136 to be aware of for the new user.
     140\index{ipython!environment}ipython has a number of useful interactive
     141features and a few things to be aware of for the new user.
    137142
    138143\subsubsection{String completion}
    139144
    140 Tab completion is enabled for all function names. If you type the
    141 first few letters of a function name, then type {\tt <TAB>} the
    142 function name will be auto completed if it is un-ambiguous, or a list
    143 of possibilities will be given. Auto-completion works for the user
    144 object names as well as function names. It does not work for
    145 filenames, nor for function arguments.
     145\index{ipython!string completion}Tab completion is enabled for all
     146function names. If you type the first few letters of a function name,
     147then type {\tt <TAB>} the function name will be auto completed if it
     148is un-ambiguous, or a list of possibilities will be
     149given. Auto-completion works for the user object names as well as
     150function names. It does not work for filenames, nor for function
     151arguments.
    146152
    147153Example
     
    158164\subsubsection{Leading Spaces}
    159165
    160 Python uses leading space to mark blocks of code. This means that it
    161 you start a command line with a space, the command generally will
    162 fail with an syntax error.
     166\index{ipython!leading space}Python uses leading space to mark blocks
     167of code. This means that it you start a command line with a space, the
     168command generally will fail with an syntax error.
    163169
    164170\subsubsection{Variable Names}
    165171
    166 During normal data processing, the user will have to create named
    167 variables to hold spectra etc. These must conform to the normal python
    168 syntax, specifically they cannot contain ``special'' characters such
    169 as \@ \$ etc and cannot start with a number (but can contain numbers).
    170 Variable (and function) names are case sensitive.
     172\index{ipython!variable names}During normal data processing, the user
     173will have to create named variables to hold spectra etc. These must
     174conform to the normal python syntax, specifically they cannot contain
     175``special'' characters such as \@ \$ etc and cannot start with a
     176number (but can contain numbers).  Variable (and function) names are
     177case sensitive.
    171178
    172179\subsubsection{Unix Interaction}
    173180
    174 Basic unix shell commands (\cmd{pwd}, \cmd{ls}, \cmd{cd} etc) can be
    175 issued from within ASAP. This allows the user to do things like look
    176 at files in the current directory. The shell command ``\cmd{cd}''
    177 works within ASAP, allowing the user to change between data
    178 directories. Unix programs cannot be run this way, but the shell
    179 escape ``$!$'' can be used to run arbitrary programs. E.g.
     181\index{ipython!unix interaction}Basic unix shell commands (\cmd{pwd},
     182\cmd{ls}, \cmd{cd} etc) can be issued from within ASAP. This allows
     183the user to do things like look at files in the current directory. The
     184shell command ``\cmd{cd}'' works within ASAP, allowing the user to
     185change between data directories. Unix programs cannot be run this way,
     186but the shell escape ``$!$'' can be used to run arbitrary
     187programs. E.g.
    180188
    181189\begin{verbatim}
     
    187195\subsection{Help}
    188196
    189 ASAP has built in help for all functions. To get a list of functions type:
     197\index{Help}ASAP has built in help for all functions. To get a list of
     198functions type:
    190199
    191200\begin{verbatim}
     
    218227\subsection{Customisation - .asaprc}
    219228
    220 ASAP use an \cmd{.asaprc} file to control the user's preference of
    221 default values for various functions arguments. This includes the
    222 defaults for arguments such as \cmd{insitu}, scantable \cmd{freqframe}
    223 and the plotters \cmd{set\_mode} values. The help on individual
    224 functions says which arguments can be set default values from the
    225 \cmd{.asaprc} file. To get a sample contents for the \cmd{.asaprc}
    226 file use then command \cmd{list\_rcparameters}.
     229\index{.asaprc}ASAP use an \cmd{.asaprc} file to control the user's
     230preference of default values for various functions arguments. This
     231includes the defaults for arguments such as \cmd{insitu}, scantable
     232\cmd{freqframe} and the plotters \cmd{set\_mode} values. The help on
     233individual functions says which arguments can be set default values
     234from the \cmd{.asaprc} file. To get a sample contents for the
     235\cmd{.asaprc} file use then command \cmd{list\_rcparameters}.
    227236
    228237Common values include:
     
    245254
    246255\section{Scantables}
    247 
     256\index{Scantables}
    248257\subsection {Description}
    249258
    250259\subsubsection {Basic Structure}
    251260
    252 ASAP data handling works on objects called scantables.  A scantable
    253 holds your data, and also provides functions to operate
    254 upon it.
     261\index{Scantable!structure}ASAP data handling works on objects called
     262scantables.  A scantable holds your data, and also provides functions
     263to operate upon it.
    255264
    256265The building block of a scantable is an integration, which is a single
     
    274283\subsubsection {Contents}
    275284
    276 A scantable has header information and data (a scantable is actually an AIPS++
    277 Table and it is stored in Memory when you are manipulating it with ASAP.
    278 You can store it to disk and then browse it with the AIPS++
    279 Table browser if you know how to do that !).
     285\index{Scantable!contents}A scantable has header information and data
     286(a scantable is actually an AIPS++ Table and it is stored in Memory
     287when you are manipulating it with ASAP.  You can store it to disk and
     288then browse it with the AIPS++ Table browser if you know how to do
     289that !).
    280290
    281291The data are stored in columns (the length of a column is the number of
     
    297307\subsection{Management}
    298308
    299 During processing it is possible to create a large number of scan
    300 tables. These all consume memory, so it is best to periodically remove
    301 unneeded scan tables. Use \cmd{list\_scans} to print a list of all
    302 scantables and \cmd{del} to remove unneeded ones.
     309\index{Scantable!management}During processing it is possible to create
     310a large number of scan tables. These all consume memory, so it is best
     311to periodically remove unneeded scan tables. Use \cmd{list\_scans} to
     312print a list of all scantables and \cmd{del} to remove unneeded ones.
    303313
    304314Example:
     
    350360\subsection{State}
    351361
    352 Each scantable contains "state"; these are properties  applying to all
    353 of the data in the scantable.
     362\index{Scantable!state}Each scantable contains "state"; these are
     363properties applying to all of the data in the scantable.
    354364
    355365Examples are the selection of beam, IF and polarisation,  spectral unit
     
    391401\subsubsection{Rest Frequency}
    392402
    393 ASAP reads the line rest frequency from the RPFITS file when reading
    394 the data. The values stored in the RPFITS file are not always correct
    395 and so there is a function \cmd{set\_restfreq} to set the rest frequencies.
     403\index{Scantable!rest frequency}ASAP reads the line rest frequency
     404from the RPFITS file when reading the data. The values stored in the
     405RPFITS file are not always correct and so there is a function
     406\cmd{set\_restfreq} to set the rest frequencies.
    396407
    397408For each integration, there is a rest-frequency per IF (the rest
     
    437448\subsection{Data Selection}
    438449
    439 Data selection is currently fairly limited. This will be improved in
    440 the future.
     450\index{Scantable!data selection}Data selection is currently fairly limited. This
     451will be improved in the future.
    441452
    442453
    443454\subsubsection{Cursor}
    444455
    445 Generally the user will want to run functions on all rows in a
    446 scantable. This allows very fast reduction of data. There are situations
    447 when functions should only operate on specific elements of the spectra. This
    448 is handled by the scantable cursor, which allows the user to select a
    449 single beam, IF and polarisation combination.
     456\index{Scantable!cursor}Generally the user will want to run functions
     457on all rows in a scantable. This allows very fast reduction of
     458data. There are situations when functions should only operate on
     459specific elements of the spectra. This is handled by the scantable
     460cursor, which allows the user to select a single beam, IF and
     461polarisation combination.
    450462
    451463Example :
     
    458470\subsubsection{Row number}
    459471
    460 Most functions work on all rows of a scan table. Exceptions are the
    461 fitter and plotter. If you wish to only operate on a selected set of
    462 scantable rows, use the \cmd{get\_scan} function to copy the rows into
    463 a new scantable.
     472\index{Scantable!row selection}Most functions work on all rows of a
     473scan table. Exceptions are the fitter and plotter. If you wish to only
     474operate on a selected set of scantable rows, use the \cmd{get\_scan}
     475function to copy the rows into a new scantable.
    464476
    465477\subsubsection{Allaxes}
    466478
    467 Many functions have an \cmd{allaxes} option which controls whether the
    468 function will operate on all elements within a scantable row, or just
    469 those selected with the current cursor. The default is taken from the
    470 users {\tt .asaprc} file.
     479\index{allaxes}\index{Scantable!allaxes}Many functions have an
     480\cmd{allaxes} option which controls whether the function will operate
     481on all elements within a scantable row, or just those selected with
     482the current cursor. The default is taken from the users {\tt .asaprc}
     483file.
    471484
    472485\subsubsection{Masks}
    473486
    474 Many tasks (fitting, baseline subtraction, statistics etc) should only
    475 be run on range of channels. Depending on the current ``unit'' setting
    476 this range is set directly as channels, velocity or frequency
    477 ranges. Internally these are converted into a simple boolean mask for
    478 each channel of the abscissa. This means that if the unit setting is
    479 later changed, previously created mask are still valid. (This is not
    480 true for functions which change the shape or shift the frequency axis).
    481 You create masks with the function \cmd{create\_mask} and this specified
     487\index{Masks}\index{Scantable!masks}Many tasks (fitting, baseline
     488subtraction, statistics etc) should only be run on range of
     489channels. Depending on the current ``unit'' setting this range is set
     490directly as channels, velocity or frequency ranges. Internally these
     491are converted into a simple boolean mask for each channel of the
     492abscissa. This means that if the unit setting is later changed,
     493previously created mask are still valid. (This is not true for
     494functions which change the shape or shift the frequency axis).  You
     495create masks with the function \cmd{create\_mask} and this specified
    482496the channels to be included in the selection.
    483497
     
    535549\section{Data Input}
    536550
    537 Data can be loaded in one of two ways; using the reader object or via
     551\index{Reading data}Data can be loaded in one of two ways; using the reader object or via
    538552the scantable constructor. The scantable method is simpler but the
    539553reader allow the user more control on what is read.
     
    541555\subsection{Scantable constructor}
    542556
    543 This loads all of the data from filename into the scantable object scans
    544 and averages all the data within a scan (i.e.  the resulting scantable
     557\index{Scantable constructor}\index{Scantable!constructor}This loads
     558all of the data from filename into the scantable object scans and
     559averages all the data within a scan (i.e.  the resulting scantable
    545560will have one row per scan).  The recognised input file formats are
    546561RPFITS, SDFITS (singledish fits), ASAP's scantable format and aips++
    547562MeasurementSet2 format.
    548563
    549 
    550564Example usage:
    551565
     
    560574\subsection{Reader object}
    561575
    562 For more control when reading data into ASAP, the reader object should
    563 be used.  This has the option of only reading in a range of integrations
    564 and does not perform any scan averaging of the data, allowing analysis
    565 of the individual integrations.  Note that due to limitation of the
    566 RPFITS library, only one reader object can be open at one time reading
    567 RPFITS files.  To read multiple RPFITS files, the old reader must be
    568 destroyed before the new file is opened.  However, multiple readers can
    569 be created and attached to SDFITS files.
     576\index{Reader object}\index{Scantable!reader object}For more control
     577when reading data into ASAP, the reader object should be used.  This
     578has the option of only reading in a range of integrations and does not
     579perform any scan averaging of the data, allowing analysis of the
     580individual integrations.  Note that due to limitation of the RPFITS
     581library, only one reader object can be open at one time reading RPFITS
     582files.  To read multiple RPFITS files, the old reader must be
     583destroyed before the new file is opened.  However, multiple readers
     584can be created and attached to SDFITS files.
    570585
    571586
     
    591606%How and when?
    592607\subsection{Auto quotient}
    593 Quotients can be computed ``automatically''. This requires the data to
    594 have matching source/reference pairs or one reference for multiple
    595 sources. Auto quotient assumes reference scans have a trailing ``\_R''
    596 in the source name for data from Parkes and Mopra, and a trailing
    597 ``e'' or ``w'' for data fro, Tidbinbilla.
     608\index{Auto quotient}Quotients can be computed ``automatically''. This
     609requires the data to have matching source/reference pairs or one
     610reference for multiple sources. Auto quotient assumes reference scans
     611have a trailing ``\_R'' in the source name for data from Parkes and
     612Mopra, and a trailing ``e'' or ``w'' for data fro, Tidbinbilla.
    598613
    599614\begin{verbatim}
     
    605620\subsection{Separate reference and source observations}
    606621
    607 Most data from ATNF observatories distinguishes on and off source data
    608 using the file name. This makes it easy to create two scantables with
    609 the source and reference data. As long as there was exactly one
    610 reference observation for each on source observation for following
    611 method will work.
     622\index{Quotient spectra}Most data from ATNF observatories
     623distinguishes on and off source data using the file name. This makes
     624it easy to create two scantables with the source and reference
     625data. As long as there was exactly one reference observation for each
     626on source observation for following method will work.
    612627
    613628For Mopra and Parkes data:
     
    644659\subsection{Time average separate scans}
    645660
    646 If you have observed the source with multiple source/reference cycles you
    647 will want to scan-average the quotient spectra together.
     661\index{Time average}If you have observed the source with multiple
     662source/reference cycles you will want to scan-average the quotient
     663spectra together.
    648664
    649665\begin{verbatim}
     
    673689\end{verbatim}
    674690
     691Note that, if needed, you should run \cmd{freq\_align}, \cmd{gain\_el}
     692and \cmd{opacity} before you average the data in time (\S
     693\ref{sec:gainel} \& \ref{sec:freqalign}).
     694
    675695\subsection{Baseline fitting}
    676696
    677 To make a baseline fit, you must first create a mask of channels to
    678 use in the baseline fit.
     697\index{Baseline fitting}To make a baseline fit, you must first create
     698a mask of channels to use in the baseline fit.
    679699
    680700\begin{verbatim}
     
    688708\subsubsection{Auto-baselining}
    689709
    690 The function \cmd{auto\_poly\_baseline} can be used to automatically
     710\index{Auto-baseline}The function \cmd{auto\_poly\_baseline} can be used to automatically
    691711baseline your data without having to specify channel ranges for the
    692712line free data. It automatically figures out the line-free emission
     
    724744\subsection{Average the polarisations}
    725745
    726 If you are just interested in the highest SNR for total intensity you
     746\index{average\_pol}If you are just interested in the highest SNR for total intensity you
    727747will want to average the parallel polarisations together.
    728748
     
    733753\subsection{Calibration}
    734754
    735 For most uses, calibration happens transparently as the input data
     755\index{Calibration}For most uses, calibration happens transparently as the input data
    736756contains the Tsys measurements taken during observations. The nominal
    737757``Tsys'' values may be in Kelvin or Jansky. The user may wish to
     
    741761\subsubsection{Brightness Units}
    742762
    743 RPFITS files do not contain any information as to whether the telescope
    744 calibration was in units of Kelvin or Janskys.  On reading the data a
    745 default value is set depending on the telescope and frequency of
    746 observation.  If this default is incorrect (you can see it in the
    747 listing from the \cmd{summary} function) the user can either override
    748 this value on reading the data or later.  E.g:
     763\index{Brightness Units}RPFITS files do not contain any information as
     764to whether the telescope calibration was in units of Kelvin or
     765Janskys.  On reading the data a default value is set depending on the
     766telescope and frequency of observation.  If this default is incorrect
     767(you can see it in the listing from the \cmd{summary} function) the
     768user can either override this value on reading the data or later.
     769E.g:
    749770
    750771\begin{verbatim}
     
    757778\subsubsection{Tsys scaling}
    758779
    759 Sometime the nominal Tsys measurement at the telescope is wrong due to
    760 an incorrect noise diode calibration. This can easily be corrected for
    761 with the scale function. By default, \cmd{scale} only scans the
    762 spectra and not the corresponding Tsys.
     780\index{Tsys scaling}Sometime the nominal Tsys measurement at the
     781telescope is wrong due to an incorrect noise diode calibration. This
     782can easily be corrected for with the scale function. By default,
     783\cmd{scale} only scans the spectra and not the corresponding Tsys.
    763784
    764785\begin{verbatim}
     
    768789\subsubsection{Unit Conversion}
    769790
    770 To convert measurements in Kelvin to Jy (and vice versa) the global
    771 function \cmd{convert\_flux} is needed. This converts and scales the data
    772 from K to Jy or vice-versa depending on what the current brightness unit is
    773 set to. The function knows the basic parameters for some frequencies
    774 and telescopes, but the user may need to supply the aperture
    775 efficiency, telescope diameter or the Jy/K factor.
     791\index{Unit conversion}To convert measurements in Kelvin to Jy (and
     792vice versa) the global function \cmd{convert\_flux} is needed. This
     793converts and scales the data from K to Jy or vice-versa depending on
     794what the current brightness unit is set to. The function knows the
     795basic parameters for some frequencies and telescopes, but the user may
     796need to supply the aperture efficiency, telescope diameter or the Jy/K
     797factor.
    776798
    777799\begin{verbatim}
     
    783805
    784806\subsubsection{Gain-Elevation and Opacity Corrections}
    785 
    786 As higher frequencies (particularly $>$20~GHz) it is important to make
    787 corrections for atmospheric opacity and gain-elevation effects.
     807\label{sec:gainel}
     808
     809\index{Gain-elevation}As higher frequencies (particularly $>$20~GHz)
     810it is important to make corrections for atmospheric opacity and
     811gain-elevation effects.
    788812
    789813Note that currently the elevation is not written correctly into
     
    795819\end{verbatim}
    796820
    797 
    798821Gain-elevation curves for some telescopes and frequencies are known to
    799 ASAP (currently only for Tidbinbilla at 20~GHz).  In these cases making
    800 gain-corrections is simple.  If the gain curve for your data is not
    801 known, the user can supply either a gain polynomial or text file
     822ASAP (currently only for Tidbinbilla at 20~GHz).  In these cases
     823making gain-corrections is simple.  If the gain curve for your data is
     824not known, the user can supply either a gain polynomial or text file
    802825tabulating gain factors at a range of elevations (see \cmd{help
    803826scantable.gain\_el}).
     
    810833\end{verbatim}
    811834
    812 Opacity corrections can be made with the global function
    813 \cmd{opacity}. This should work on all telescopes as long as a
    814 measurement of the opacity factor was made during the observation.
     835\index{Opacity}Opacity corrections can be made with the global
     836function \cmd{opacity}. This should work on all telescopes as long as
     837a measurement of the opacity factor was made during the observation.
    815838
    816839\begin{verbatim}
     
    823846
    824847\subsection{Frequency Frame Alignment}
    825 
    826 When time averaging a series of scans together, it is possible that
    827 the velocity scales are not exactly aligned.  This may be for many
    828 reasons such as not Doppler tracking the observations, errors in the
    829 Doppler tracking etc.  This mostly affects very long integrations or
    830 integrations averaged together from different days.  Before averaging
    831 such data together, they should be frequency aligned using
    832 \cmd{freq\_align}.
     848\label{sec:freqalign}
     849
     850\index{Frequency alignment}\index{Velicity alignment}When time
     851averaging a series of scans together, it is possible that the velocity
     852scales are not exactly aligned.  This may be for many reasons such as
     853not Doppler tracking the observations, errors in the Doppler tracking
     854etc.  This mostly affects very long integrations or integrations
     855averaged together from different days.  Before averaging such data
     856together, they should be frequency aligned using \cmd{freq\_align}.
    833857
    834858E.g.:
     
    868892\section{Scantable manipulation}
    869893
    870 While it is very useful to have many independent sources within one
    871 scantable, it is often inconvenient for data processing. The
    872 \cmd{get\_scan} function can be used to create a new scantable with a
    873 selection of scans from a scantable. The selection can either be on
    874 the source name, with simple wildcard matching or set of scan ids.
     894\index{Scantable!manipulation}While it is very useful to have many
     895independent sources within one scantable, it is often inconvenient for
     896data processing. The \cmd{get\_scan} function can be used to create a
     897new scantable with a selection of scans from a scantable. The
     898selection can either be on the source name, with simple wildcard
     899matching or set of scan ids.
    875900
    876901For example:
     
    908933\section{Data Output}
    909934
    910 ASAP can save scantables in a variety of formats, suitable for reading
    911 into other packages. The formats are:
     935\index{Scantable!save}\index{Saving data}ASAP can save scantables in a
     936variety of formats, suitable for reading into other packages. The
     937formats are:
    912938
    913939\begin{itemize}
     
    950976\section{Plotter}
    951977
    952 Scantable spectra can be plotted at any time. An asapplotter object is
     978\index{Plotter}Scantable spectra can be plotted at any time. An asapplotter object is
    953979used for plotting, meaning multiple plot windows can be active at the
    954980same time. On start up a default asapplotter object is created called
     
    9931019\label{sec:plotter_cursor}
    9941020
    995 The plotter can plot up to 25 panels and stacked spectra per
    996 panel. If you have data larger than this (or for your own sanity) you
    997 need to select a subset of this data. This is particularly true for
    998 multibeam or multi IF data. The plotter \cmd{set\_cursor} function is
    999 used to select a subset of the data. The arguments \cmd{row},
    1000 \cmd{beam} and \cmd{IF} all accept a vector of indices corresponding
    1001 to row, beam or IF selection. Only the selected data will be plotted.
    1002 To select on polarisation, see section~\ref{sec:polplot}.
     1021\index{Plotter!selection}The plotter can plot up to 25 panels and
     1022stacked spectra per panel. If you have data larger than this (or for
     1023your own sanity) you need to select a subset of this data. This is
     1024particularly true for multibeam or multi IF data. The plotter
     1025\cmd{set\_cursor} function is used to select a subset of the data. The
     1026arguments \cmd{row}, \cmd{beam} and \cmd{IF} all accept a vector of
     1027indices corresponding to row, beam or IF selection. Only the selected
     1028data will be plotted.  To select on polarisation, see
     1029section~\ref{sec:polplot}.
    10031030
    10041031Examples:
     
    10231050\subsection{Plot Control}
    10241051
    1025 The plotter window has a row of buttons on the lower left. These can
    1026 be used to control the plotter (mostly for zooming the individual
    1027 plots). From left to right:
     1052\index{Plotter!control}The plotter window has a row of buttons on the
     1053lower left. These can be used to control the plotter (mostly for
     1054zooming the individual plots). From left to right:
    10281055
    10291056\begin{itemize}
     
    10471074\item[Save] (floppy disk). Save the plot as a postscript or .png file
    10481075
     1076You can also type ``g'' in the plot window to toggle on and off grid
     1077lines. Typing 'l' turns on and off logarithmic Y-axis.
     1078
    10491079\end{itemize}
    10501080
     
    10791109\section{Fitting}
    10801110
    1081 Currently multicomponent Gaussian function is available. This is done
    1082 by creating a fitting object, setting up the fit and actually fitting
    1083 the data. Fitting can either be done on a single scantable row/cursor
    1084 selection or on an entire scantable using the \cmd{auto\_fit} function.
     1111\index{Fitting}Currently multicomponent Gaussian function is
     1112available. This is done by creating a fitting object, setting up the
     1113fit and actually fitting the data. Fitting can either be done on a
     1114single scantable row/cursor selection or on an entire scantable using
     1115the \cmd{auto\_fit} function.
    10851116
    10861117\begin{verbatim}
     
    11471178\subsection{Fit saving}
    11481179
    1149 One you are happy with your fit, it is possible to store it as part of
    1150 the scantable.
     1180\index{Fitter!Fit saving}One you are happy with your fit, it is
     1181possible to store it as part of the scantable.
    11511182
    11521183\begin{verbatim}
     
    11681199\section{Polarisation}
    11691200
    1170 Currently ASAP only supports polarmetric analysis on linearly
    1171 polarised feeds and the cross polarisation products measured. Other
    1172 cases will be added on an as needed basic.
     1201\index{Polarisation}Currently ASAP only supports polarmetric analysis
     1202on linearly polarised feeds and the cross polarisation products
     1203measured. Other cases will be added on an as needed basic.
    11731204
    11741205Conversions of linears to Stokes or Circular polarisations are done
     
    11841215for transparent polarimetric calibration.}
    11851216
    1186 It is possible that there is a phase offset between polarisation which
    1187 will effect the phase of the cross polarisation correlation, and so give
    1188 rise to spurious polarisation. \cmd{rotate\_xyphase} can be used to
    1189 correct for this error. At this point, the user must know how to
    1190 determine the size of the phase offset themselves.
     1217\index{Polarisation!calibration}It is possible that there is a phase
     1218offset between polarisation which will effect the phase of the cross
     1219polarisation correlation, and so give rise to spurious
     1220polarisation. \cmd{rotate\_xyphase} can be used to correct for this
     1221error. At this point, the user must know how to determine the size of
     1222the phase offset themselves.
    11911223
    11921224\begin{verbatim}
     
    12131245\label{sec:polplot}
    12141246
    1215 To plot Stokes values, the plotter \cmd{set\_cursor} function should
    1216 be called first using the \cmd{pol} argument. The values which can be
    1217 plotted include a selection of [I,Q,U,V], [I, Plinear, Pangle, V],
    1218 [RR, LL] or [XX, YY, Real(XY), Imaginary(XY)]. (Plinear and Pangle are
    1219 the percentage and position angle of linear polarisation). Conversion
    1220 to circular polarisations are currently not available.
     1247\index{Polarisation!plotting}To plot Stokes values, the plotter
     1248\cmd{set\_cursor} function should be called first using the \cmd{pol}
     1249argument. The values which can be plotted include a selection of
     1250[I,Q,U,V], [I, Plinear, Pangle, V], [RR, LL] or [XX, YY, Real(XY),
     1251Imaginary(XY)]. (Plinear and Pangle are the percentage and position
     1252angle of linear polarisation). Conversion to circular polarisations
     1253are currently not available.
    12211254
    12221255Example:
     
    12341267\subsection{Saving}
    12351268
    1236 When saving data using the \cmd{save} function, the \cmd{stokes}
    1237 argument can be used to save the data as Stoke values when saving in
    1238 FITS format.
     1269\index{Polarisation!saving}When saving data using the \cmd{save}
     1270function, the \cmd{stokes} argument can be used to save the data as
     1271Stoke values when saving in FITS format.
    12391272
    12401273Example:
     
    12471280\section{Scantable Mathematics}
    12481281
    1249 It is possible to to simple mathematics directly on scantables from
    1250 the command line using the \cmd{+, -, *, /} operators as well as their
    1251 cousins \cmd{+=, -= *=, /=}. This works between two scantables or a
    1252 scantable and a float. (Note that it does not work for integers).
     1282\index{Scantable!maths}It is possible to to simple mathematics
     1283directly on scantables from the command line using the \cmd{+, -, *,
     1284/} operators as well as their cousins \cmd{+=, -= *=, /=}. This works
     1285between two scantables or a scantable and a float. (Note that it does
     1286not work for integers).
    12531287
    12541288\begin{verbatim}
     
    12601294\section{Scripting}
    12611295
    1262 Because asap is based on python, it easy for the user write their own
    1263 scripts and functions to process data. This is highly recommended as
    1264 most processing of user data could then be done in a couple of steps
    1265 using a few simple user defined functions. A Python primer is beyond
    1266 the scope of this userguide. See the asap home pages for a scripting
    1267 tutorial or the main python website for comprehensive documentation.
     1296\index{Scripting}Because asap is based on python, it easy for the user
     1297write their own scripts and functions to process data. This is highly
     1298recommended as most processing of user data could then be done in a
     1299couple of steps using a few simple user defined functions. A Python
     1300primer is beyond the scope of this userguide. See the asap home pages
     1301for a scripting tutorial or the main python website for comprehensive
     1302documentation.
    12681303
    12691304\hspace{1cm} http://www.atnf.csiro.au/computing/software/asap/tutorials
     
    12901325
    12911326\subsection{Mopra}
     1327\index{Mopra}
     1328
     1329The following example is of some dual polarisation, position switched
     1330data from Mopra. The source has been observed mulitple times split
     1331into a number of seperate rpfits files. To make the processing easier,
     1332the first step is to \cmd{cat} the seeprate rpfits files together and
     1333load as a whole (future versions of asap will make this unnecessary).
     1334
     1335
     1336\begin{verbatim}
     1337# Concatenate the individual rpfits files together before loading
     1338!cat 2005-06*.rpf > data.rpf
     1339
     1340# Load the data into a scantable
     1341data = scantable('data.rpf')
     1342print data
     1343
     1344# Form the quotient spectra
     1345q = data.auto_quotient()
     1346print q
     1347
     1348# Look at the spectra
     1349plotter.plot(q)
     1350
     1351# Velocity align the data before averaging
     1352q.set_unit('km/s')
     1353q.set_freqframe('LSRK')
     1354q.freq_align()
     1355
     1356# Average all scans in time
     1357av = q.average_time()
     1358plotter.plot(av)
     1359
     1360# Remove the baseline
     1361msk = av.create_mask([100,130],[160,200])
     1362av.poly_baseline(msk,2)
     1363
     1364# Average the two polarisations together
     1365iav = av.average_pol()
     1366print iav
     1367plotter.plot(iav)
     1368
     1369# Set a sensible velocity range on the plot
     1370plotter.set_range(85,200)
     1371
     1372# Smooth the data a little
     1373av.smooth('gauss',4)
     1374plotter.plot()
     1375
     1376# Fit a guassian to the emission
     1377f = fitter()
     1378f.set_function(gauss=1)
     1379f.set_scan(av)
     1380f.fit()
     1381
     1382# View the fit
     1383f.plot()
     1384
     1385# Get the fit parameters
     1386f.get_parameters()
     1387
     1388\end{verbatim}
     1389
    12921390
    12931391\subsection{Parkes Polarimetry}
    12941392
    1295 The following example is processing of some Parkes polarmetric
    1296 observations of OH masers at 1.6~GHz. Because digital filters where
    1297 used in the backend, the baselines are stable enough not to require a
    1298 quotient spectra. The 4~MHz bandwidth is wide enough to observe both
    1299 the 1665 and 1667~MHz OH maser transitions. Each source was observed
    1300 once for about 10 minutes. Tsys information was not written to the
    1301 rpfits file (a nominal 25K values was used), so the amplitudes need
    1302 to be adjusted based on a separate log file. A simple user function is
    1303 used to simplify this, contained in a file called mypol.py:
     1393\index{Parkes}\index{Polarisation}The following example is processing
     1394of some Parkes polarmetric observations of OH masers at
     13951.6~GHz. Because digital filters where used in the backend, the
     1396baselines are stable enough not to require a quotient spectra. The
     13974~MHz bandwidth is wide enough to observe both the 1665 and 1667~MHz
     1398OH maser transitions. Each source was observed once for about 10
     1399minutes. Tsys information was not written to the rpfits file (a
     1400nominal 25K values was used), so the amplitudes need to be adjusted
     1401based on a separate log file. A simple user function is used to
     1402simplify this, contained in a file called mypol.py:
    13041403
    13051404\begin{verbatim}
     
    13881487\subsection{Tidbinbilla}
    13891488
    1390 The following example is processing of some Tidbinbilla observations
    1391 of NH$_3$ at 12~mm. Tidbinbilla has (at the time of observations) a
    1392 single polarisation, but can process two IFs simultaneously. In the
    1393 example, the first half of the observation was observing the (1,1) and
    1394 (2,2) transitions simultaneously). The second half observed only the
    1395 (4,4) transition due to bandwidth limitations. The data is position
    1396 switched, observing first an reference to the west, then the source
    1397 twice and finally reference to the east.
     1489\index{Tidbinbilla}The following example is processing of some
     1490Tidbinbilla observations of NH$_3$ at 12~mm. Tidbinbilla has (at the
     1491time of observations) a single polarisation, but can process two IFs
     1492simultaneously. In the example, the first half of the observation was
     1493observing the (1,1) and (2,2) transitions simultaneously). The second
     1494half observed only the (4,4) transition due to bandwidth
     1495limitations. The data is position switched, observing first an
     1496reference to the west, then the source twice and finally reference to
     1497the east.
    13981498
    13991499\begin{verbatim}
     
    14471547\subsection{Function Summary}
    14481548
     1549\index{Functions!summary}%
    14491550\begin{verbatim}
    14501551    [The scan container]
     
    14631564            get_tsys        - get the TSys
    14641565            get_time        - get the timestamps of the integrations
     1566            get_azimuth     - get the azimuth of the scans
     1567            get_elevation   - get the elevation of the scans
     1568            get_parangle    - get the parallactic angle of the scans
    14651569            get_unit        - get the currnt unit
    14661570            set_unit        - set the abcissa unit to be used from this
     
    15881692\subsection{Installation}
    15891693
    1590 ASAP depends on a number of third-party libraries which you must
     1694\index{Installation}ASAP depends on a number of third-party libraries which you must
    15911695have installed before attempting to build ASAP. These are:
    15921696
     
    16061710
    16071711\subsection{.asaprc settings}
    1608 
     1712\index{.asaprc}
    16091713\asaprc{verbose}{{\bf True}/False}{Print verbose output}
    16101714
     
    16541758of information printed by summary}
    16551759
     1760\printindex
     1761
    16561762\end{document}
    16571763
Note: See TracChangeset for help on using the changeset viewer.