[534] | 1 | \documentclass[11pt]{article}
|
---|
| 2 | \usepackage{a4}
|
---|
[770] | 3 | \usepackage{calc}
|
---|
[534] | 4 | \usepackage[dvips]{graphicx}
|
---|
[794] | 5 | \usepackage{makeidx}
|
---|
[534] | 6 |
|
---|
| 7 | % Adjust the page size
|
---|
| 8 | \addtolength{\oddsidemargin}{-0.4in}
|
---|
| 9 | \addtolength{\evensidemargin}{+0.4in}
|
---|
| 10 | \addtolength{\textwidth}{+0.8in}
|
---|
| 11 |
|
---|
| 12 | \setlength{\parindent}{0mm}
|
---|
| 13 | \setlength{\parskip}{1ex}
|
---|
| 14 |
|
---|
[1217] | 15 | \title{ATNF Spectral Analysis Package\\User Guide v2.1\\DRAFT }
|
---|
[534] | 16 | \author{Chris Phillips}
|
---|
| 17 |
|
---|
| 18 | \newcommand{\cmd}[1]{{\tt #1}}
|
---|
| 19 |
|
---|
[770] | 20 | \newcommand{\asaprc}[3]{
|
---|
| 21 | \begin{minipage}[t]{45mm}#1\end{minipage}
|
---|
| 22 | \begin{minipage}[t]{30mm}\raggedright #2\end{minipage}\hspace{3mm}
|
---|
| 23 | \begin{minipage}[t]{\textwidth-75mm}#3\end{minipage}
|
---|
| 24 | }
|
---|
| 25 |
|
---|
[1217] | 26 | \newcommand{\commanddef}[3]{
|
---|
| 27 | \begin{minipage}[t]{27mm}\tt #1\end{minipage}\hspace{3mm}
|
---|
| 28 | \begin{minipage}[t]{\textwidth-30mm}#2 \\ \tt #3\end{minipage}
|
---|
| 29 | }
|
---|
| 30 |
|
---|
| 31 | \newcommand{\bigcommanddef}[3]{
|
---|
| 32 | \begin{minipage}[t]{45mm}\tt #1\end{minipage}\hspace{3mm}
|
---|
| 33 | \begin{minipage}[t]{\textwidth-47mm}#2 \\ \tt #3\end{minipage}
|
---|
| 34 | }
|
---|
| 35 |
|
---|
[794] | 36 | \makeindex
|
---|
| 37 |
|
---|
[534] | 38 | \begin{document}
|
---|
| 39 |
|
---|
| 40 | \maketitle
|
---|
| 41 |
|
---|
| 42 | \section{Introduction}
|
---|
| 43 |
|
---|
[544] | 44 | ASAP is a single dish spectral line processing package currently being
|
---|
| 45 | developed by the ATNF. It is intended to process data from all ATNF
|
---|
[770] | 46 | antennas, and can probably be used for other antennas if they can
|
---|
[544] | 47 | produce ``Single Dish FITS'' format. It is based on the AIPS++
|
---|
| 48 | package.
|
---|
| 49 |
|
---|
[1217] | 50 | This userguide is being updated for the ASAP 2.1. Please report any
|
---|
| 51 | mistakes you find.
|
---|
[534] | 52 |
|
---|
[544] | 53 | \section{Installation and Running}
|
---|
[534] | 54 |
|
---|
[738] | 55 | Currently there are installations running on Linux machines at
|
---|
[534] | 56 |
|
---|
| 57 | \begin{itemize}
|
---|
| 58 | \item Epping - use hosts {\tt draco} or {\tt hydra}
|
---|
| 59 | \item Narrabri - use host {\tt kaputar}
|
---|
[537] | 60 | \item Parkes - use host {\tt bourbon}
|
---|
[534] | 61 | \item Mopra - use host {\tt minos}
|
---|
| 62 | \end{itemize}
|
---|
| 63 |
|
---|
[1217] | 64 | Or use your own Linux desktop.
|
---|
| 65 |
|
---|
| 66 | {\em Note. ASAP2.1 only runs on ATNF Linux machines which have been
|
---|
| 67 | updated to Debian Sarge and are using the ``DEBIANsarge''
|
---|
| 68 | /usr/local. If your favourite machine has not been upgraded, send a
|
---|
| 69 | request your your friendly IT support.}
|
---|
| 70 |
|
---|
[794] | 71 | \index{Running}To start asap log onto one of these Linux hosts and enter
|
---|
[534] | 72 |
|
---|
| 73 | \begin{verbatim}
|
---|
| 74 | > cd /my/data/directory
|
---|
[966] | 75 | > asap
|
---|
[534] | 76 | \end{verbatim}
|
---|
| 77 |
|
---|
[544] | 78 | This starts the ASAP. To quit, you need to type \verb+^+-d
|
---|
[971] | 79 | (control-d) or type \cmd{\%Exit}.
|
---|
[534] | 80 |
|
---|
| 81 | \section{Interface}
|
---|
| 82 |
|
---|
[1064] | 83 | \index{Interface}ASAP is written in C++ and python. The user interface
|
---|
| 84 | uses the ``ipython'' interactive shell, which is a simple interactive
|
---|
| 85 | interface to python. The user does not need to understand python to
|
---|
| 86 | use this, but certain aspects python affect what the user can do. The
|
---|
| 87 | current interface is object oriented.
|
---|
[534] | 88 |
|
---|
| 89 | \subsection {Integer Indices are 0-relative}
|
---|
| 90 |
|
---|
| 91 | Please note, all integer indices in ASAP and iPython are {\bf 0-relative}.
|
---|
| 92 |
|
---|
| 93 | \subsection{Objects}
|
---|
[794] | 94 | \index{objects}
|
---|
[534] | 95 | The ASAP interface is based around a number of ``objects'' which the
|
---|
| 96 | user deals with. Objects range from the data which have been read from
|
---|
| 97 | disk, to tools used for fitting functions to the data. The following
|
---|
| 98 | main objects are used :
|
---|
| 99 |
|
---|
| 100 | \begin{itemize}
|
---|
[544] | 101 | \item[\cmd{scantable}] The data container (actual spectra and header
|
---|
| 102 | information)
|
---|
[953] | 103 | \item[\cmd{selector}] Allows the user to select a subsection of the
|
---|
[1064] | 104 | data, such as a specified or range of beam numbers, IFs, etc.
|
---|
[953] | 105 | \item[\cmd{plotter}] A tool used to plot the spectral line data
|
---|
[544] | 106 | \item[\cmd{fitter}] A tool used to fit functions to the spectral data
|
---|
| 107 | \item[\cmd{reader}] A tool which can be used to read data from disks
|
---|
[971] | 108 | into a scantable object (advanced use).
|
---|
[534] | 109 | \end{itemize}
|
---|
| 110 |
|
---|
[738] | 111 | There can be many objects of the same type. Each object is referred to
|
---|
[534] | 112 | by a variable name made by the user. The name of this variable is not
|
---|
[770] | 113 | important and can be set to whatever the user prefers (i.e. ``s'' and
|
---|
[534] | 114 | ``ParkesHOH-20052002'' are equivalent). However, having a simple and
|
---|
| 115 | consistent naming convention will help you a lot.
|
---|
| 116 |
|
---|
[544] | 117 | \subsection{Member Functions (functions)}
|
---|
[534] | 118 |
|
---|
[794] | 119 | \index{Functions!member}Following the object oriented approach,
|
---|
| 120 | objects have associated ``member functions'' which can either be used
|
---|
| 121 | to modify the data in some way or change global properties of the
|
---|
| 122 | object. In this document member functions will be referred to simply
|
---|
| 123 | as functions. From the command line, the user can execute these
|
---|
| 124 | functions using the syntax:
|
---|
[534] | 125 | \begin{verbatim}
|
---|
[1259] | 126 | ASAP>out = object.function(arguments)
|
---|
[534] | 127 | \end{verbatim}
|
---|
| 128 |
|
---|
| 129 | Where \cmd{out} is the name of the returned variable (could be a new
|
---|
[544] | 130 | scantable object, or a vector of data, or a status return),
|
---|
| 131 | \cmd{object} is the object variable name (set by the user),
|
---|
| 132 | \cmd{function} is the name of the member function and \cmd{arguments}
|
---|
| 133 | is a list of arguments to the function. The arguments can be provided
|
---|
| 134 | either though position or \cmd{name=}. A mix of the two can be used.
|
---|
| 135 | E.g.
|
---|
[534] | 136 |
|
---|
| 137 | \begin{verbatim}
|
---|
[1259] | 138 | ASAP>av = scans.average_time(msk,weight='tsys')
|
---|
| 139 | ASAP>av = scans.average_time(mask=msk,weight='tsys')
|
---|
| 140 | ASAP>av = scans.average_time(msk,tsys)
|
---|
| 141 | ASAP>scans.poly_baseline(mask=msk, order=0, insitu=True)
|
---|
| 142 | ASAP>scans.poly_baseline(msk,0,True)
|
---|
| 143 | ASAP>scans.poly_baseline(mask, insitu=True)
|
---|
[534] | 144 | \end{verbatim}
|
---|
| 145 |
|
---|
| 146 | \subsection{Global Functions}
|
---|
| 147 |
|
---|
[794] | 148 | \index{Functions!global}It does not make sense to implement some functions as member
|
---|
[544] | 149 | functions, typically functions which operate on more than one
|
---|
| 150 | scantable (e.g. time averaging of many scans). These functions will
|
---|
| 151 | always be referred to as global functions.
|
---|
[534] | 152 |
|
---|
[538] | 153 | \subsection{Interactive environment}
|
---|
[534] | 154 |
|
---|
[794] | 155 | \index{ipython!environment}ipython has a number of useful interactive
|
---|
| 156 | features and a few things to be aware of for the new user.
|
---|
[534] | 157 |
|
---|
| 158 | \subsubsection{String completion}
|
---|
| 159 |
|
---|
[794] | 160 | \index{ipython!string completion}Tab completion is enabled for all
|
---|
| 161 | function names. If you type the first few letters of a function name,
|
---|
| 162 | then type {\tt <TAB>} the function name will be auto completed if it
|
---|
| 163 | is un-ambiguous, or a list of possibilities will be
|
---|
| 164 | given. Auto-completion works for the user object names as well as
|
---|
| 165 | function names. It does not work for filenames, nor for function
|
---|
| 166 | arguments.
|
---|
[534] | 167 |
|
---|
| 168 | Example
|
---|
| 169 | \begin{verbatim}
|
---|
[1259] | 170 | ASAP>scans = scantable('MyData.rpf')
|
---|
| 171 | ASAP>scans.se<TAB>
|
---|
| 172 | ASAP>scans.set_in<TAB>
|
---|
[971] | 173 | scans.set_cursor scans.set_freqframe scans.set_selection
|
---|
| 174 | scans.set_doppler scans.set_instrument scans.set_unit
|
---|
| 175 | scans.set_fluxunit scans.set_restfreqs
|
---|
| 176 |
|
---|
[1259] | 177 | ASAP>scans.set_instrument()
|
---|
[534] | 178 | \end{verbatim}
|
---|
| 179 |
|
---|
[544] | 180 | \subsubsection{Leading Spaces}
|
---|
| 181 |
|
---|
[794] | 182 | \index{ipython!leading space}Python uses leading space to mark blocks
|
---|
| 183 | of code. This means that it you start a command line with a space, the
|
---|
| 184 | command generally will fail with an syntax error.
|
---|
[544] | 185 |
|
---|
[770] | 186 | \subsubsection{Variable Names}
|
---|
| 187 |
|
---|
[794] | 188 | \index{ipython!variable names}During normal data processing, the user
|
---|
| 189 | will have to create named variables to hold spectra etc. These must
|
---|
| 190 | conform to the normal python syntax, specifically they cannot contain
|
---|
| 191 | ``special'' characters such as \@ \$ etc and cannot start with a
|
---|
| 192 | number (but can contain numbers). Variable (and function) names are
|
---|
| 193 | case sensitive.
|
---|
[770] | 194 |
|
---|
[534] | 195 | \subsubsection{Unix Interaction}
|
---|
| 196 |
|
---|
[794] | 197 | \index{ipython!unix interaction}Basic unix shell commands (\cmd{pwd},
|
---|
| 198 | \cmd{ls}, \cmd{cd} etc) can be issued from within ASAP. This allows
|
---|
| 199 | the user to do things like look at files in the current directory. The
|
---|
| 200 | shell command ``\cmd{cd}'' works within ASAP, allowing the user to
|
---|
| 201 | change between data directories. Unix programs cannot be run this way,
|
---|
| 202 | but the shell escape ``$!$'' can be used to run arbitrary
|
---|
| 203 | programs. E.g.
|
---|
[534] | 204 |
|
---|
| 205 | \begin{verbatim}
|
---|
[1259] | 206 | ASAP>pwd
|
---|
| 207 | ASAP>ls
|
---|
| 208 | ASAP>cd /my/data/directory
|
---|
| 209 | ASAP>! mozilla&
|
---|
[534] | 210 | \end{verbatim}
|
---|
| 211 |
|
---|
| 212 | \subsection{Help}
|
---|
| 213 |
|
---|
[794] | 214 | \index{Help}ASAP has built in help for all functions. To get a list of
|
---|
| 215 | functions type:
|
---|
[534] | 216 |
|
---|
[538] | 217 | \begin{verbatim}
|
---|
[1259] | 218 | ASAP>commands()
|
---|
[538] | 219 | \end{verbatim}
|
---|
| 220 |
|
---|
| 221 | To get help on specific functions, the built in help needs to be given
|
---|
| 222 | the object and function name. E.g.
|
---|
| 223 |
|
---|
| 224 | \begin{verbatim}
|
---|
[1259] | 225 | ASAP>help scantable.get_scan # or help(scantable.get_scan)
|
---|
| 226 | ASAP>help scantable.stats
|
---|
| 227 | ASAP>help plotter.plot
|
---|
| 228 | ASAP>help fitter.plot
|
---|
[538] | 229 |
|
---|
[1259] | 230 | ASAP>scans = scantable('mydata.asap')
|
---|
| 231 | ASAP>help scans.get_scan # Same as above
|
---|
[544] | 232 | \end{verbatim}
|
---|
[538] | 233 |
|
---|
[544] | 234 | Global functions just need their name
|
---|
[538] | 235 |
|
---|
[544] | 236 | \begin{verbatim}
|
---|
[1259] | 237 | ASAP>help average_time
|
---|
[538] | 238 | \end{verbatim}
|
---|
| 239 |
|
---|
| 240 | Note that if you just type \cmd{help} the internal ipython help is
|
---|
| 241 | invoked, which is probably {\em not} what you want. Type \verb+^+-d
|
---|
| 242 | (control-d) to escape from this.
|
---|
| 243 |
|
---|
[738] | 244 | \subsection{Customisation - .asaprc}
|
---|
[534] | 245 |
|
---|
[794] | 246 | \index{.asaprc}ASAP use an \cmd{.asaprc} file to control the user's
|
---|
| 247 | preference of default values for various functions arguments. This
|
---|
| 248 | includes the defaults for arguments such as \cmd{insitu}, scantable
|
---|
| 249 | \cmd{freqframe} and the plotters \cmd{set\_mode} values. The help on
|
---|
| 250 | individual functions says which arguments can be set default values
|
---|
| 251 | from the \cmd{.asaprc} file. To get a sample contents for the
|
---|
[1064] | 252 | \cmd{.asaprc} file use the command \cmd{list\_rcparameters}.
|
---|
[534] | 253 |
|
---|
[538] | 254 | Common values include:
|
---|
| 255 | \begin{verbatim}
|
---|
| 256 | # apply operations on the input scantable or return new one
|
---|
| 257 | insitu : False
|
---|
| 258 |
|
---|
[738] | 259 | # default output format when saving scantable
|
---|
[953] | 260 | scantable.save : ASAP
|
---|
[538] | 261 |
|
---|
| 262 | # default frequency frame to set when function
|
---|
| 263 | # scantable.set_freqframe is called
|
---|
[953] | 264 | scantable.freqframe : LSRK
|
---|
[538] | 265 |
|
---|
| 266 | # auto averaging on read
|
---|
| 267 | scantable.autoaverage : True
|
---|
| 268 | \end{verbatim}
|
---|
| 269 |
|
---|
[953] | 270 | For a complete list of \cmd{.asaprc} values, see the Appendix.
|
---|
[770] | 271 |
|
---|
[534] | 272 | \section{Scantables}
|
---|
[794] | 273 | \index{Scantables}
|
---|
[534] | 274 | \subsection {Description}
|
---|
| 275 |
|
---|
| 276 | \subsubsection {Basic Structure}
|
---|
| 277 |
|
---|
[794] | 278 | \index{Scantable!structure}ASAP data handling works on objects called
|
---|
| 279 | scantables. A scantable holds your data, and also provides functions
|
---|
| 280 | to operate upon it.
|
---|
[534] | 281 |
|
---|
| 282 | The building block of a scantable is an integration, which is a single
|
---|
[1217] | 283 | row of a scantable. Each row contains just one spectrum for each beam,
|
---|
| 284 | IF and polarisation. For example Parkes OH-multibeam data would
|
---|
| 285 | normally contain 13 beams, 1 IF and 2 polarisations, Parkes
|
---|
| 286 | methanol-multibeam data would contain 7 beams, 2 IFs and 2
|
---|
[1259] | 287 | polarisations while the Mopra 8-GHz MOPS filterbank will produce one
|
---|
[1217] | 288 | beam, many IFs, and 2-4 polarisations.
|
---|
| 289 |
|
---|
| 290 | All of the combinations of Beams/IFs an Polarisations are
|
---|
[1259] | 291 | contained in separate rows. These rows are grouped in cycles (same time stamp).
|
---|
[534] | 292 |
|
---|
[1217] | 293 | A collection of cycles for one source is termed a scan (and each scan
|
---|
| 294 | has a unique numeric identifier, the SCANNO). A scantable is then a
|
---|
| 295 | collection of one or more scans. If you have scan-averaged your data
|
---|
[1259] | 296 | in time, i.e. you have averaged all cycles within a scan, then each
|
---|
[1217] | 297 | scan would hold just one (averaged) integration.
|
---|
[534] | 298 |
|
---|
[1217] | 299 | Many of the functions which work on scantables can either return a new
|
---|
| 300 | scantable with modified data or change the scantable insitu. Which
|
---|
[534] | 301 | method is used depends on the users preference. The default can be
|
---|
| 302 | changed via the {\tt .asaprc} resource file.
|
---|
| 303 |
|
---|
[1259] | 304 | For example a Mopra scan with a 4s integration time, two IFs and
|
---|
[1011] | 305 | dual polarisations has two (2s) cycles.
|
---|
| 306 | \begin{verbatim}
|
---|
[1064] | 307 | SCANNO CYCLENO BEAMNO IFNO POLNO
|
---|
| 308 | 0 0 0 0 0
|
---|
| 309 | 0 0 0 0 1
|
---|
| 310 | 0 0 0 1 0
|
---|
| 311 | 0 0 0 1 1
|
---|
| 312 | 0 1 0 0 0
|
---|
| 313 | 0 1 0 0 1
|
---|
| 314 | 0 1 0 1 0
|
---|
| 315 | 0 1 0 1 1
|
---|
[1011] | 316 | \end{verbatim}
|
---|
| 317 |
|
---|
| 318 |
|
---|
[534] | 319 | \subsubsection {Contents}
|
---|
| 320 |
|
---|
[794] | 321 | \index{Scantable!contents}A scantable has header information and data
|
---|
[953] | 322 | (a scantable is actually an AIPS++ Table and it is generally stored in
|
---|
| 323 | memory when you are manipulating it with ASAP. You can save it to
|
---|
| 324 | disk and then browse it with the AIPS++ Table browser if you know how
|
---|
| 325 | to do that !).
|
---|
[534] | 326 |
|
---|
| 327 | The data are stored in columns (the length of a column is the number of
|
---|
[1011] | 328 | rows/spectra of course).
|
---|
[534] | 329 |
|
---|
| 330 | Two important columns are those that describe the frequency setup. We mention
|
---|
[538] | 331 | them explicitly here because you need to be able to understand the presentation
|
---|
[534] | 332 | of the frequency information and possibly how to manipulate it.
|
---|
| 333 |
|
---|
[1011] | 334 | These columns are called FREQ\_ID and MOLECULE\_ID. They contain indices, for
|
---|
[971] | 335 | each IF, pointing into tables with all of the frequency and rest-frequency
|
---|
[1054] | 336 | information for that integration.
|
---|
[534] | 337 |
|
---|
| 338 | There are of course many other columns which contain the actual spectra,
|
---|
[971] | 339 | the flags, the Tsys, the source names and so on.
|
---|
[534] | 340 |
|
---|
| 341 | There is also a function \cmd{summary} to list a summary of the scantable.
|
---|
| 342 | You will find this very useful.
|
---|
| 343 |
|
---|
| 344 | Example:
|
---|
| 345 |
|
---|
| 346 | \begin{verbatim}
|
---|
[1259] | 347 | ASAP>scans = scantable('MyData.rpf')
|
---|
| 348 | ASAP>scans.summary() # Brief listing
|
---|
[544] | 349 |
|
---|
| 350 | # Equivalent to brief summary function call
|
---|
[1259] | 351 | ASAP>print scan
|
---|
[534] | 352 | \end{verbatim}
|
---|
| 353 |
|
---|
[971] | 354 | The summary function gives you a scan-based summary, presenting the
|
---|
[1054] | 355 | scantable as a cascading view of Beams and IFs. Note that the output
|
---|
| 356 | of summary is redirected into your current pager specified by the
|
---|
| 357 | \$PAGER environment variable. If you find the screen is reset to the
|
---|
[1259] | 358 | original state when summary is finished (i.e. the output from summary
|
---|
[1054] | 359 | disappears), you may need to set the \$LESS environment variable to
|
---|
| 360 | include the \cmd{-X} option.
|
---|
[534] | 361 |
|
---|
[953] | 362 | \subsection{Data Selection}
|
---|
| 363 | \label{sec:selection}
|
---|
| 364 |
|
---|
[966] | 365 | ASAP contains flexible data selection. Data can be selected based on
|
---|
| 366 | IF, beam, polarisation, scan number as well as values such as
|
---|
| 367 | Tsys. Advanced users can also make use of the AIPS++ TAQL language to
|
---|
[971] | 368 | create selections based on almost any of the values recorded.
|
---|
[953] | 369 |
|
---|
[966] | 370 | Selection is based on a \cmd{selector} object. This object is created
|
---|
| 371 | and various selection functions applied to it (\cmd{set\_ifs},
|
---|
| 372 | \cmd{set\_beams} etc). The selection object then must be applied to a
|
---|
| 373 | scantable using the \cmd{set\_selection} function. A single selection
|
---|
| 374 | object can be created and setup then applied to multiple scantables.
|
---|
[534] | 375 |
|
---|
[966] | 376 | Once a selection has been applied, all following functions will only
|
---|
| 377 | ``see'' the selected spectra (including functions such as
|
---|
| 378 | \cmd{summary}). The selection can then be reset and all spectra are
|
---|
| 379 | visible. Note that if functions such as \cmd{copy} are run on a
|
---|
| 380 | scantable with active selection, only the selected spectra are copied.
|
---|
[534] | 381 |
|
---|
[966] | 382 | The common selection functions are:
|
---|
[534] | 383 |
|
---|
[966] | 384 | \begin{itemize}
|
---|
| 385 |
|
---|
| 386 | \item[\cmd{set\_beams}] Select beams by index number
|
---|
| 387 | \item[\cmd{set\_ifs}] Select ifs by index number
|
---|
| 388 | \item[\cmd{set\_name}] Select by source name. Can contain ``*'' as a
|
---|
| 389 | wildcard, e.g. ``Orion*\_R''.
|
---|
[1064] | 390 | \item[\cmd{set\_ifs}] Select IFs by index number
|
---|
| 391 | \item[\cmd{set\_polarisation}] Select by polarisation index or
|
---|
[966] | 392 | name. If polarisation names are given, the data will be on-the-fly
|
---|
[971] | 393 | converted (for example from linears to Stokes).
|
---|
[966] | 394 | \item[\cmd{set\_query}] Set query directly. For power users only!
|
---|
| 395 | \item[\cmd{set\_tsys}] Select data based on Tsys. Also example of user
|
---|
| 396 | definable query.
|
---|
| 397 | \item[\cmd{reset}] Reset the selection to include all spectra.
|
---|
| 398 |
|
---|
| 399 |
|
---|
| 400 | Note that all indices are zero based.
|
---|
| 401 |
|
---|
| 402 | Examples:
|
---|
| 403 |
|
---|
| 404 | \begin{verbatim}
|
---|
[1259] | 405 | ASAP>selection = selector() # Create selection object
|
---|
| 406 | ASAP>selection.set_ifs(0) # Just select the first IF
|
---|
| 407 | ASAP>scans.set_selection(selection) # Apply the selection
|
---|
| 408 | ASAP>print scans # Will just show the first IF
|
---|
[966] | 409 |
|
---|
[1259] | 410 | ASAP>selection.set_ifs([0,1]) # Select the first two IFs
|
---|
| 411 | ASAP>selection.set_beams([1,3,5]) # Also select three of the beams
|
---|
| 412 | ASAP>scans.set_selection(selection) # Apply the selection
|
---|
[966] | 413 |
|
---|
[1259] | 414 | ASAP>selection.set_name('G308*') # Select by source name
|
---|
[966] | 415 |
|
---|
[1259] | 416 | ASAP>selection.reset() # Turn off selection
|
---|
| 417 | ASAP>scans.set_selection(selection) # Apply the reset selection
|
---|
[966] | 418 |
|
---|
[970] | 419 | \end{verbatim}
|
---|
| 420 |
|
---|
[966] | 421 | \end{itemize}
|
---|
| 422 |
|
---|
[534] | 423 | \subsection{State}
|
---|
| 424 |
|
---|
[794] | 425 | \index{Scantable!state}Each scantable contains "state"; these are
|
---|
| 426 | properties applying to all of the data in the scantable.
|
---|
[534] | 427 |
|
---|
| 428 | Examples are the selection of beam, IF and polarisation, spectral unit
|
---|
[770] | 429 | (e.g. km/s), frequency reference frame (e.g. BARY) and velocity Doppler
|
---|
[534] | 430 | type (e.g. RADIO).
|
---|
| 431 |
|
---|
| 432 | \subsubsection{Units, Doppler and Frequency Reference Frame}
|
---|
| 433 |
|
---|
| 434 | The information describing the frequency setup for each integration
|
---|
| 435 | is stored fundamentally in frequency in the reference frame
|
---|
[738] | 436 | of observation (E.g. TOPO).
|
---|
[534] | 437 |
|
---|
[544] | 438 | When required, this is converted to the desired reference frame
|
---|
| 439 | (e.g. LSRK), Doppler (e.g. OPTICAL) and unit (e.g. km/s) on-the-fly.
|
---|
| 440 | This is important, for example, when you are displaying the data or
|
---|
[971] | 441 | fitting to it. The reference frame is set on file read to the value
|
---|
| 442 | set in the user \cmd{.asaprc} file.
|
---|
[534] | 443 |
|
---|
| 444 | For units, the user has the choice of frequency, velocity or channel.
|
---|
| 445 | The \cmd{set\_unit} function is used to set the current unit for a
|
---|
| 446 | scantable. All functions will (where relevant) work with the selected
|
---|
| 447 | unit until this changes. This is mainly important for fitting (the fits
|
---|
[738] | 448 | can be computed in any of these units), plotting and mask creation.
|
---|
[534] | 449 |
|
---|
[544] | 450 | The velocity definition can be changed with the \cmd{set\_doppler}
|
---|
| 451 | function, and the frequency reference frame can be changed with the
|
---|
[534] | 452 | \cmd{set\_freqframe} function.
|
---|
| 453 |
|
---|
| 454 | Example usage:
|
---|
| 455 |
|
---|
| 456 | \begin{verbatim}
|
---|
[1259] | 457 | ASAP>scans = scantable('2004-11-23_1841-P484.rpf') # Read in the data
|
---|
| 458 | ASAP>scans.set_freqframe('LSRK') # Use the LSR velocity frame
|
---|
| 459 | ASAP>scans.set_unit('km/s') # Use velocity for plots etc from now on
|
---|
| 460 | ASAP>scans.set_doppler('OPTICAL') # Use the optical velocity convention
|
---|
| 461 | ASAP>scans.set_unit('MHz') # Use frequency in MHz from now on
|
---|
[534] | 462 | \end{verbatim}
|
---|
| 463 |
|
---|
| 464 |
|
---|
| 465 | \subsubsection{Rest Frequency}
|
---|
| 466 |
|
---|
[794] | 467 | \index{Scantable!rest frequency}ASAP reads the line rest frequency
|
---|
| 468 | from the RPFITS file when reading the data. The values stored in the
|
---|
| 469 | RPFITS file are not always correct and so there is a function
|
---|
[953] | 470 | \cmd{set\_restfreq} to set the rest frequencies for the currently
|
---|
| 471 | selected data.
|
---|
[534] | 472 |
|
---|
| 473 | For each integration, there is a rest-frequency per IF (the rest
|
---|
| 474 | frequencies are just stored as a list with an index into them).
|
---|
| 475 | There are a few ways to set the rest frequencies with this function.
|
---|
| 476 |
|
---|
[953] | 477 | If you specify just one rest frequency, then it is set for all IF.
|
---|
[534] | 478 |
|
---|
| 479 | \begin{verbatim}
|
---|
[953] | 480 | # Set all IFs
|
---|
[1259] | 481 | ASAP>scans.set_restfreqs(freqs=1.667359e9)
|
---|
[534] | 482 | \end{verbatim}
|
---|
| 483 |
|
---|
[953] | 484 | If set a rest frequency for each IF, specify a list of frequencies (of
|
---|
| 485 | length the number of IFs). Regardless of the source, the rest
|
---|
| 486 | frequency will be set for each IF to the corresponding value in the
|
---|
[970] | 487 | provided list.
|
---|
[534] | 488 |
|
---|
| 489 | \begin{verbatim}
|
---|
[770] | 490 | # Set rest frequency for all IFs
|
---|
[1259] | 491 | ASAP>scans.set_restfreqs(freqs=[1.6654018e9,1.667359e9,])
|
---|
[538] | 492 |
|
---|
[534] | 493 | \end{verbatim}
|
---|
| 494 |
|
---|
[1217] | 495 | {\em Currently the following is not implemented
|
---|
[953] | 496 |
|
---|
[534] | 497 | In both of the above modes, you can also specify the rest frequencies via
|
---|
| 498 | names in a known list rather than by their values.
|
---|
| 499 |
|
---|
| 500 | Examples:
|
---|
| 501 |
|
---|
| 502 | \begin{verbatim}
|
---|
[1259] | 503 | ASAP>scans.set_restfreqs(freqs=['OH1665','OH1667'])
|
---|
[534] | 504 | \end{verbatim}
|
---|
[1217] | 505 | }
|
---|
[534] | 506 |
|
---|
| 507 | \subsubsection{Masks}
|
---|
| 508 |
|
---|
[970] | 509 | \index{Masks}\index{Scantable!masks}
|
---|
[534] | 510 |
|
---|
[966] | 511 | Many tasks (fitting, baseline subtraction, statistics etc) should only
|
---|
| 512 | be run on range of channels. Depending on the current ``unit'' setting
|
---|
| 513 | this range is set directly as channels, velocity or frequency
|
---|
| 514 | ranges. Internally these are converted into a simple boolean mask for
|
---|
| 515 | each channel of the abscissa. This means that if the unit setting is
|
---|
| 516 | later changed, previously created mask are still valid. (This is not
|
---|
| 517 | true for functions which change the shape or shift the frequency
|
---|
| 518 | axis). You create masks with the function \cmd{create\_mask} and this
|
---|
| 519 | specified the channels to be included in the selection. When setting
|
---|
| 520 | the mask in velocity, the conversion from velocity to channels is
|
---|
[1064] | 521 | based on the current selection, specified row and selected frequency
|
---|
| 522 | reference frame.
|
---|
[534] | 523 |
|
---|
[966] | 524 |
|
---|
| 525 | Note that for multi IF data with different number of channels per IF a
|
---|
| 526 | single mask cannot be applied to different IFs. To use a mask on such
|
---|
| 527 | data the selector should be applied to select all IFs with the same
|
---|
| 528 | number of channels.
|
---|
| 529 |
|
---|
[534] | 530 | Example :
|
---|
| 531 | \begin{verbatim}
|
---|
| 532 |
|
---|
| 533 | # Select channel range for baselining
|
---|
[1259] | 534 | ASAP>scans.set_unit('channels')
|
---|
| 535 | ASAP>msk = scans.create_mask([100,400],[600,800])
|
---|
[738] | 536 |
|
---|
[534] | 537 | # Select velocity range for fitting
|
---|
[1259] | 538 | ASAP>scans.set_unit('km/s')
|
---|
| 539 | ASAP>msk = scans.create_mask([-30,-10])
|
---|
[534] | 540 | \end{verbatim}
|
---|
| 541 |
|
---|
[544] | 542 | Sometimes it is more convenient to specify the channels to be
|
---|
| 543 | excluded, rather included. You can do this with the ``invert''
|
---|
| 544 | argument.
|
---|
[534] | 545 |
|
---|
| 546 | Example :
|
---|
| 547 | \begin{verbatim}
|
---|
[1259] | 548 | ASAP>scans.set_unit('channels')
|
---|
| 549 | ASAP>msk = scans.create_mask([0,100],[900-1023], invert=True)
|
---|
[534] | 550 | \end{verbatim}
|
---|
| 551 |
|
---|
[544] | 552 | By default \cmd{create\_mask} uses the frequency setup of the first row
|
---|
| 553 | to convert velocities into a channel mask. If the rows in the data
|
---|
| 554 | cover different velocity ranges, the scantable row to use should be
|
---|
| 555 | specified:
|
---|
| 556 |
|
---|
| 557 | \begin{verbatim}
|
---|
[1259] | 558 | ASAP>scans.set_unit('km/s')
|
---|
| 559 | ASAP>msk = q.create_mask([-30,-10], row=5)
|
---|
[544] | 560 | \end{verbatim}
|
---|
| 561 |
|
---|
[534] | 562 | Because the mask is stored in a simple python variable, the users is
|
---|
| 563 | able to combine masks using simple arithmetic. To create a mask
|
---|
| 564 | excluding the edge channels, a strong maser feature and a birdie in
|
---|
| 565 | the middle of the band:
|
---|
| 566 |
|
---|
| 567 | \begin{verbatim}
|
---|
[1259] | 568 | ASAP>scans.set_unit('channels')
|
---|
| 569 | ASAP>msk1 = q.create_mask([0,100],[511,511],[900,1023],invert=True)
|
---|
| 570 | ASAP>scans.set_unit('km/s')
|
---|
| 571 | ASAP>msk2 = q.create_mask([-20,-10],invert=True)
|
---|
[534] | 572 |
|
---|
[1259] | 573 | ASAP>mask = msk1 and msk2
|
---|
[534] | 574 | \end{verbatim}
|
---|
| 575 |
|
---|
| 576 |
|
---|
[953] | 577 | \subsection{Management}
|
---|
| 578 |
|
---|
| 579 | \index{Scantable!management}During processing it is possible to create
|
---|
| 580 | a large number of scan tables. These all consume memory, so it is best
|
---|
| 581 | to periodically remove unneeded scan tables. Use \cmd{list\_scans} to
|
---|
| 582 | print a list of all scantables and \cmd{del} to remove unneeded ones.
|
---|
| 583 |
|
---|
| 584 | Example:
|
---|
| 585 |
|
---|
| 586 | \begin{verbatim}
|
---|
[1259] | 587 | ASAP>list_scans()
|
---|
[953] | 588 | The user created scantables are:
|
---|
| 589 | ['s', 'scans', 'av', 's2', 'ss']
|
---|
| 590 |
|
---|
[1259] | 591 | ASAP>del s2
|
---|
| 592 | ASAP>del ss
|
---|
[953] | 593 | \end{verbatim}
|
---|
| 594 |
|
---|
[534] | 595 | \section{Data Input}
|
---|
| 596 |
|
---|
[971] | 597 | \index{Reading data}Data can be loaded in one of two ways; using the
|
---|
| 598 | reader object or via the scantable constructor. The scantable method
|
---|
| 599 | is simpler but the reader allows the user more control on what is read.
|
---|
[534] | 600 |
|
---|
| 601 | \subsection{Scantable constructor}
|
---|
| 602 |
|
---|
[794] | 603 | \index{Scantable constructor}\index{Scantable!constructor}This loads
|
---|
| 604 | all of the data from filename into the scantable object scans and
|
---|
| 605 | averages all the data within a scan (i.e. the resulting scantable
|
---|
[534] | 606 | will have one row per scan). The recognised input file formats are
|
---|
| 607 | RPFITS, SDFITS (singledish fits), ASAP's scantable format and aips++
|
---|
[738] | 608 | MeasurementSet2 format.
|
---|
[534] | 609 |
|
---|
| 610 | Example usage:
|
---|
| 611 |
|
---|
| 612 | \begin{verbatim}
|
---|
[1259] | 613 | ASAP>scan = scantable('2004-11-23_1841-P484.rpf')
|
---|
[544] | 614 |
|
---|
| 615 | # Don't scan average the data
|
---|
[1259] | 616 | ASAP>scan = scantable('2004-11-23_1841-P484.rpf', average=False)
|
---|
[534] | 617 | \end{verbatim}
|
---|
| 618 |
|
---|
| 619 |
|
---|
| 620 | \subsection{Reader object}
|
---|
| 621 |
|
---|
[794] | 622 | \index{Reader object}\index{Scantable!reader object}For more control
|
---|
| 623 | when reading data into ASAP, the reader object should be used. This
|
---|
[953] | 624 | has the option of only reading in a range of integrations, only a
|
---|
| 625 | specified beam or IF and does not perform any scan averaging of the
|
---|
| 626 | data, allowing analysis of the individual integrations. Note that due
|
---|
| 627 | to limitation of the RPFITS library, only one reader object can be
|
---|
| 628 | open at one time reading RPFITS files. To read multiple RPFITS files,
|
---|
| 629 | the old reader must be destroyed before the new file is opened.
|
---|
| 630 | However, multiple readers can be created and attached to SDFITS files.
|
---|
[534] | 631 |
|
---|
| 632 |
|
---|
| 633 | Example usage:
|
---|
| 634 |
|
---|
| 635 | \begin{verbatim}
|
---|
[1259] | 636 | ASAP>r = reader('2003-03-16_082048_t0002.rpf')
|
---|
| 637 | ASAP>r.summary()
|
---|
| 638 | ASAP>scan = r.read()
|
---|
| 639 | ASAP>del r
|
---|
[534] | 640 | \end{verbatim}
|
---|
| 641 |
|
---|
| 642 | \section{Basic Processing}
|
---|
| 643 |
|
---|
| 644 | In the following section, a simple data reduction to form a quotient
|
---|
[544] | 645 | spectrum of a single source is followed. It has been assume that the
|
---|
| 646 | \cmd{.asaprc} file has {\em not} been used to change the \cmd{insitu}
|
---|
| 647 | default value from \cmd{True}.
|
---|
[534] | 648 |
|
---|
[738] | 649 | \subsection{Auto quotient}
|
---|
[794] | 650 | \index{Auto quotient}Quotients can be computed ``automatically''. This
|
---|
| 651 | requires the data to have matching source/reference pairs or one
|
---|
| 652 | reference for multiple sources. Auto quotient assumes reference scans
|
---|
| 653 | have a trailing ``\_R'' in the source name for data from Parkes and
|
---|
| 654 | Mopra, and a trailing ``e'' or ``w'' for data fro, Tidbinbilla.
|
---|
[534] | 655 |
|
---|
[738] | 656 | \begin{verbatim}
|
---|
[1259] | 657 | ASAP>q = s.auto_quotient()
|
---|
[738] | 658 | \end{verbatim}
|
---|
| 659 |
|
---|
[971] | 660 | By default the quotient spectra is calculated
|
---|
| 661 | to preserve continuum emission. If you wish to remove the continuum
|
---|
| 662 | contribution, use the \cmd{preserve} argument:
|
---|
| 663 |
|
---|
| 664 | \begin{verbatim}
|
---|
[1259] | 665 | ASAP>q = s.auto_quotient(preserve=True)
|
---|
[971] | 666 | \end{verbatim}
|
---|
| 667 |
|
---|
[1217] | 668 | If this is not sufficient the following alternative method can be used.
|
---|
[738] | 669 |
|
---|
[1217] | 670 | \subsection{Separate reference and source observations}
|
---|
| 671 |
|
---|
| 672 | \index{Quotient spectra}Most data from ATNF observatories
|
---|
| 673 | distinguishes on and off source data using the file name. This makes
|
---|
| 674 | it easy to create two scantables with the source and reference
|
---|
| 675 | data. As long as there was exactly one reference observation for each
|
---|
| 676 | on source observation for following method will work.
|
---|
| 677 |
|
---|
| 678 | For Mopra and Parkes data:
|
---|
| 679 | \begin{verbatim}
|
---|
[1259] | 680 | ASAP>r = scans.get_scan('*_R')
|
---|
| 681 | ASAP>s = scans.get_scan('*_S')
|
---|
[1217] | 682 | \end{verbatim}
|
---|
| 683 |
|
---|
| 684 | For Tidbinbilla data
|
---|
| 685 | \begin{verbatim}
|
---|
[1259] | 686 | ASAP>r = scans.get_scan('*_[ew]')
|
---|
| 687 | ASAP>s = scans.get_scan('*_[^ew]')
|
---|
[1217] | 688 | \end{verbatim}
|
---|
| 689 |
|
---|
| 690 | \subsection{Make the quotient spectra}
|
---|
| 691 |
|
---|
| 692 | Use the quotient function
|
---|
| 693 |
|
---|
| 694 | \begin{verbatim}
|
---|
[1259] | 695 | ASAP>q = s.quotient(r)
|
---|
[1217] | 696 | \end{verbatim}
|
---|
| 697 |
|
---|
| 698 | This uses the rows in scantable \cmd{r} as reference spectra for the
|
---|
| 699 | rows in scantable \cmd{s}. Scantable \cmd{r} must have either 1 row
|
---|
| 700 | (which is applied to all rows in \cmd{s}) or both scantables must have
|
---|
| 701 | the same number of rows.
|
---|
| 702 |
|
---|
[534] | 703 | \subsection{Time average separate scans}
|
---|
| 704 |
|
---|
[794] | 705 | \index{Time average}If you have observed the source with multiple
|
---|
| 706 | source/reference cycles you will want to scan-average the quotient
|
---|
| 707 | spectra together.
|
---|
[534] | 708 |
|
---|
| 709 | \begin{verbatim}
|
---|
[1259] | 710 | ASAP>av = q.average_time()
|
---|
[534] | 711 | \end{verbatim}
|
---|
| 712 |
|
---|
[544] | 713 | If for some you want to average multiple sets of scantables together
|
---|
| 714 | you can:
|
---|
[534] | 715 |
|
---|
| 716 | \begin{verbatim}
|
---|
[1259] | 717 | ASAP>av = average_time(q1, q2, q3)
|
---|
[534] | 718 | \end{verbatim}
|
---|
| 719 |
|
---|
[544] | 720 | The default is to use integration time weighting. The alternative is
|
---|
[1217] | 721 | to use none, variance, Tsys weighting, Tsys \& integration time or
|
---|
| 722 | median averaging.
|
---|
[534] | 723 |
|
---|
[544] | 724 | \begin{verbatim}
|
---|
[1259] | 725 | ASAP>av = average_time(q, weight='tintsys')
|
---|
[544] | 726 | \end{verbatim}
|
---|
| 727 |
|
---|
[534] | 728 | To use variance based weighting, you need to supply a mask saying which
|
---|
| 729 | channel range you want it to calculate the variance from.
|
---|
| 730 |
|
---|
| 731 | \begin{verbatim}
|
---|
[1259] | 732 | ASAP>msk = scans.create_mask([200,400],[600,800])
|
---|
| 733 | ASAP>av = average_time(scans, mask=msk, weight='var')
|
---|
[534] | 734 | \end{verbatim}
|
---|
| 735 |
|
---|
[953] | 736 | If you have not observed your data with Doppler tracking (or run
|
---|
[1259] | 737 | \cmd{freq\_align} explicitly) you should align the data in frequency
|
---|
[953] | 738 | before averaging.
|
---|
[794] | 739 |
|
---|
[953] | 740 | \begin{verbatim}
|
---|
[1259] | 741 | ASAP>av = scans.average_time(align=True)
|
---|
[953] | 742 | \end{verbatim}
|
---|
| 743 |
|
---|
| 744 | Note that, if needed, you should run \cmd{gain\_el} and \cmd{opacity}
|
---|
| 745 | before you average the data in time (\S \ref{sec:gainel} \&
|
---|
| 746 | \ref{sec:freqalign}).
|
---|
| 747 |
|
---|
[534] | 748 | \subsection{Baseline fitting}
|
---|
| 749 |
|
---|
[794] | 750 | \index{Baseline fitting}To make a baseline fit, you must first create
|
---|
| 751 | a mask of channels to use in the baseline fit.
|
---|
[534] | 752 |
|
---|
| 753 | \begin{verbatim}
|
---|
[1259] | 754 | ASAP>msk = scans.create_mask([100,400],[600,900])
|
---|
| 755 | ASAP>scans.poly_baseline(msk, order=1)
|
---|
[534] | 756 | \end{verbatim}
|
---|
| 757 |
|
---|
| 758 | This will fit a first order polynomial to the selected channels and subtract
|
---|
| 759 | this polynomial from the full spectra.
|
---|
| 760 |
|
---|
| 761 | \subsubsection{Auto-baselining}
|
---|
| 762 |
|
---|
[794] | 763 | \index{Auto-baseline}The function \cmd{auto\_poly\_baseline} can be used to automatically
|
---|
[770] | 764 | baseline your data without having to specify channel ranges for the
|
---|
| 765 | line free data. It automatically figures out the line-free emission
|
---|
| 766 | and fits a polynomial baseline to that data. The user can use masks to
|
---|
| 767 | fix the range of channels or velocity range for the fit as well as
|
---|
| 768 | mark the band edge as invalid.
|
---|
[534] | 769 |
|
---|
| 770 | Simple example
|
---|
| 771 |
|
---|
| 772 | \begin{verbatim}
|
---|
[1259] | 773 | ASAP>scans.auto_poly_baseline(order=2,threshold=5)
|
---|
[534] | 774 | \end{verbatim}
|
---|
| 775 |
|
---|
| 776 | \cmd{order} is the polynomial order for the fit. \cmd{threshold} is
|
---|
| 777 | the SNR threshold to use to deliminate line emission from
|
---|
[548] | 778 | signal. Generally the value of threshold is not too critical, however
|
---|
| 779 | making this too large will compromise the fit (as it will include
|
---|
| 780 | strong line features) and making it too small will mean it cannot find
|
---|
| 781 | enough line free channels.
|
---|
[534] | 782 |
|
---|
[548] | 783 |
|
---|
[534] | 784 | Other examples:
|
---|
| 785 |
|
---|
| 786 | \begin{verbatim}
|
---|
| 787 | # Don't try and fit the edge of the bandpass which is noisier
|
---|
[1259] | 788 | ASAP>scans.auto_poly_baseline(edge=(500,450),order=3,threshold=3)
|
---|
[534] | 789 |
|
---|
| 790 | # Only fit a given region around the line
|
---|
[1259] | 791 | ASAP>scans.set_unit('km/s')
|
---|
| 792 | ASAP>msk = scans.create_mask([-60,-20])
|
---|
| 793 | ASAP>scans.auto_poly_baseline(mask=msk,order=3,threshold=3)
|
---|
[534] | 794 |
|
---|
| 795 | \end{verbatim}
|
---|
| 796 |
|
---|
| 797 | \subsection{Average the polarisations}
|
---|
| 798 |
|
---|
[794] | 799 | \index{average\_pol}If you are just interested in the highest SNR for total intensity you
|
---|
[534] | 800 | will want to average the parallel polarisations together.
|
---|
| 801 |
|
---|
| 802 | \begin{verbatim}
|
---|
[1259] | 803 | ASAP>scans.average_pol()
|
---|
[534] | 804 | \end{verbatim}
|
---|
| 805 |
|
---|
| 806 | \subsection{Calibration}
|
---|
| 807 |
|
---|
[794] | 808 | \index{Calibration}For most uses, calibration happens transparently as the input data
|
---|
[534] | 809 | contains the Tsys measurements taken during observations. The nominal
|
---|
| 810 | ``Tsys'' values may be in Kelvin or Jansky. The user may wish to
|
---|
| 811 | supply a Tsys correction or apply gain-elevation and opacity
|
---|
| 812 | corrections.
|
---|
| 813 |
|
---|
| 814 | \subsubsection{Brightness Units}
|
---|
| 815 |
|
---|
[794] | 816 | \index{Brightness Units}RPFITS files do not contain any information as
|
---|
| 817 | to whether the telescope calibration was in units of Kelvin or
|
---|
| 818 | Janskys. On reading the data a default value is set depending on the
|
---|
| 819 | telescope and frequency of observation. If this default is incorrect
|
---|
| 820 | (you can see it in the listing from the \cmd{summary} function) the
|
---|
| 821 | user can either override this value on reading the data or later.
|
---|
| 822 | E.g:
|
---|
[534] | 823 |
|
---|
| 824 | \begin{verbatim}
|
---|
[1259] | 825 | ASAP>scans = scantable('2004-11-23_1841-P484.rpf', unit='Jy')
|
---|
[534] | 826 | # Or in two steps
|
---|
[1259] | 827 | ASAP>scans = scantable('2004-11-23_1841-P484.rpf')
|
---|
| 828 | ASAP>scans.set_fluxunit('Jy')
|
---|
[534] | 829 | \end{verbatim}
|
---|
| 830 |
|
---|
[1217] | 831 | \subsubsection{Feed Polarisation}
|
---|
| 832 |
|
---|
| 833 | \index{Brightness Units}The RPFITS files also do not contain any
|
---|
| 834 | information as to the feed polarisation. ASAP will set a default based
|
---|
| 835 | on the antenna, but this will often be wrong the data has been read,
|
---|
| 836 | the default can be changed using the \cmd{set\_feedtype} function with
|
---|
| 837 | an argument of \cmd{'linear'} or \cmd{'circular'}.
|
---|
| 838 |
|
---|
| 839 | E.g:
|
---|
| 840 |
|
---|
| 841 | \begin{verbatim}
|
---|
[1259] | 842 | ASAP>scans = scantable('2004-11-23_1841-P484.rpf')
|
---|
| 843 | ASAP>scans.set_feedtype('circular')
|
---|
[1217] | 844 | \end{verbatim}
|
---|
| 845 |
|
---|
[534] | 846 | \subsubsection{Tsys scaling}
|
---|
| 847 |
|
---|
[794] | 848 | \index{Tsys scaling}Sometime the nominal Tsys measurement at the
|
---|
| 849 | telescope is wrong due to an incorrect noise diode calibration. This
|
---|
| 850 | can easily be corrected for with the scale function. By default,
|
---|
| 851 | \cmd{scale} only scans the spectra and not the corresponding Tsys.
|
---|
[534] | 852 |
|
---|
| 853 | \begin{verbatim}
|
---|
[1259] | 854 | ASAP>scans.scale(1.05, tsys=True)
|
---|
[534] | 855 | \end{verbatim}
|
---|
| 856 |
|
---|
| 857 | \subsubsection{Unit Conversion}
|
---|
| 858 |
|
---|
[794] | 859 | \index{Unit conversion}To convert measurements in Kelvin to Jy (and
|
---|
| 860 | vice versa) the global function \cmd{convert\_flux} is needed. This
|
---|
| 861 | converts and scales the data from K to Jy or vice-versa depending on
|
---|
| 862 | what the current brightness unit is set to. The function knows the
|
---|
| 863 | basic parameters for some frequencies and telescopes, but the user may
|
---|
| 864 | need to supply the aperture efficiency, telescope diameter or the Jy/K
|
---|
| 865 | factor.
|
---|
[534] | 866 |
|
---|
| 867 | \begin{verbatim}
|
---|
[1259] | 868 | ASAP>scans.convert_flux() # If efficency known
|
---|
| 869 | ASAP>scans.convert_flux(eta=0.48) # If telescope diameter known
|
---|
| 870 | ASAP>scans.convert_flux(eta=0.48,d=35) # Unknown telescope
|
---|
| 871 | ASAP>scans.convert_flux(jypk=15) # Alternative
|
---|
[534] | 872 | \end{verbatim}
|
---|
| 873 |
|
---|
| 874 | \subsubsection{Gain-Elevation and Opacity Corrections}
|
---|
[794] | 875 | \label{sec:gainel}
|
---|
[534] | 876 |
|
---|
[794] | 877 | \index{Gain-elevation}As higher frequencies (particularly $>$20~GHz)
|
---|
| 878 | it is important to make corrections for atmospheric opacity and
|
---|
| 879 | gain-elevation effects.
|
---|
[534] | 880 |
|
---|
[794] | 881 | Note that currently the elevation is not written correctly into
|
---|
[770] | 882 | Tidbinbilla rpfits files. This means that gain-elevation and opacity
|
---|
[794] | 883 | corrections will not work unless these get recalculated.
|
---|
[770] | 884 |
|
---|
[794] | 885 | \begin{verbatim}
|
---|
[1259] | 886 | ASAP>scans.recalc_azel() # recalculate az/el based on pointing
|
---|
[794] | 887 | \end{verbatim}
|
---|
| 888 |
|
---|
[544] | 889 | Gain-elevation curves for some telescopes and frequencies are known to
|
---|
[794] | 890 | ASAP (currently only for Tidbinbilla at 20~GHz). In these cases
|
---|
| 891 | making gain-corrections is simple. If the gain curve for your data is
|
---|
| 892 | not known, the user can supply either a gain polynomial or text file
|
---|
[534] | 893 | tabulating gain factors at a range of elevations (see \cmd{help
|
---|
[544] | 894 | scantable.gain\_el}).
|
---|
[534] | 895 |
|
---|
| 896 | Examples:
|
---|
| 897 |
|
---|
| 898 | \begin{verbatim}
|
---|
[1259] | 899 | ASAP>scans.gain_el() # If gain table known
|
---|
| 900 | ASAP>scans.gain_el(poly=[3.58788e-1,2.87243e-2,-3.219093e-4])
|
---|
[534] | 901 | \end{verbatim}
|
---|
| 902 |
|
---|
[794] | 903 | \index{Opacity}Opacity corrections can be made with the global
|
---|
| 904 | function \cmd{opacity}. This should work on all telescopes as long as
|
---|
| 905 | a measurement of the opacity factor was made during the observation.
|
---|
[534] | 906 |
|
---|
| 907 | \begin{verbatim}
|
---|
[1259] | 908 | ASAP>scans.opacity(0.083)
|
---|
[534] | 909 | \end{verbatim}
|
---|
| 910 |
|
---|
| 911 | Note that at 3~mm Mopra uses a paddle wheel for Tsys calibration,
|
---|
| 912 | which takes opacity effects into account (to first order). ASAP
|
---|
[544] | 913 | opacity corrections should not be used for Mopra 3-mm data.
|
---|
[534] | 914 |
|
---|
| 915 | \subsection{Frequency Frame Alignment}
|
---|
[794] | 916 | \label{sec:freqalign}
|
---|
[534] | 917 |
|
---|
[1259] | 918 | \index{Frequency alignment}\index{Velocity alignment}When time
|
---|
[794] | 919 | averaging a series of scans together, it is possible that the velocity
|
---|
| 920 | scales are not exactly aligned. This may be for many reasons such as
|
---|
| 921 | not Doppler tracking the observations, errors in the Doppler tracking
|
---|
| 922 | etc. This mostly affects very long integrations or integrations
|
---|
| 923 | averaged together from different days. Before averaging such data
|
---|
| 924 | together, they should be frequency aligned using \cmd{freq\_align}.
|
---|
[534] | 925 |
|
---|
| 926 | E.g.:
|
---|
| 927 |
|
---|
| 928 | \begin{verbatim}
|
---|
[1259] | 929 | ASAP>scans.freq_align()
|
---|
| 930 | ASAP>av = average_time(scans)
|
---|
[534] | 931 | \end{verbatim}
|
---|
| 932 |
|
---|
[953] | 933 | {\em A Global freq\_align command will be made eventually}
|
---|
[534] | 934 |
|
---|
| 935 | To average together data taken on different days, which are in
|
---|
| 936 | different scantables, each scantable must aligned to a common
|
---|
| 937 | reference time then the scantables averaged. The simplest way of
|
---|
| 938 | doing this is to allow ASAP to choose the reference time for the first
|
---|
[738] | 939 | scantable then using this time for the subsequent scantables.
|
---|
[534] | 940 |
|
---|
| 941 | \begin{verbatim}
|
---|
[1259] | 942 | ASAP>scans1.freq_align() # Copy the refeference Epoch from the output
|
---|
| 943 | ASAP>scans2.freq_align(reftime='2004/11/23/18:43:35')
|
---|
| 944 | ASAP>scans3.freq_align(reftime='2004/11/23/18:43:35')
|
---|
| 945 | ASAP>av = average_time(scans1, scans2, scans3)
|
---|
[534] | 946 | \end{verbatim}
|
---|
| 947 |
|
---|
| 948 | \section{Scantable manipulation}
|
---|
| 949 |
|
---|
[794] | 950 | \index{Scantable!manipulation}While it is very useful to have many
|
---|
| 951 | independent sources within one scantable, it is often inconvenient for
|
---|
| 952 | data processing. The \cmd{get\_scan} function can be used to create a
|
---|
| 953 | new scantable with a selection of scans from a scantable. The
|
---|
| 954 | selection can either be on the source name, with simple wildcard
|
---|
[953] | 955 | matching or set of scan ids. Internally this uses the selector object,
|
---|
| 956 | so for more complicated selection the selector should be used directly
|
---|
| 957 | instead.
|
---|
[534] | 958 |
|
---|
| 959 | For example:
|
---|
| 960 |
|
---|
| 961 | \begin{verbatim}
|
---|
[1259] | 962 | ASAP>ss = scans.get_scan(10) # Get the 11th scan (zero based)
|
---|
| 963 | ASAP>ss = scans.get_scan(range(10)) # Get the first 10 scans
|
---|
| 964 | ASAP>ss = scans.get_scan(range(10,20)) # Get the next 10 scans
|
---|
| 965 | ASAP>ss = scans.get_scan([2,4,6,8,10]) # Get a selection of scans
|
---|
[534] | 966 |
|
---|
[1259] | 967 | ASAP>ss = scans.get_scan('345p407') # Get a specific source
|
---|
| 968 | ASAP>ss = scans.get_scan('345*') # Get a few sources
|
---|
[534] | 969 |
|
---|
[1259] | 970 | ASAP>r = scans.get_scan('*_R') # Get all reference sources (Parkes/Mopra)
|
---|
| 971 | ASAP>s = scans.get_scan('*_S') # Get all program sources (Parkes/Mopra)
|
---|
| 972 | ASAP>r = scans.get_scan('*[ew]') # Get all reference sources (Tid)
|
---|
| 973 | ASAP>s = scans.get_scan('*[^ew]') # Get all program sources (Tid)
|
---|
[534] | 974 |
|
---|
| 975 | \end{verbatim}
|
---|
| 976 |
|
---|
| 977 | To copy a scantable the following does not work:
|
---|
| 978 |
|
---|
| 979 | \begin{verbatim}
|
---|
[1259] | 980 | ASAP>ss = scans
|
---|
[534] | 981 | \end{verbatim}
|
---|
| 982 |
|
---|
[544] | 983 | as this just creates a reference to the original scantable. Any
|
---|
| 984 | changes made to \cmd{ss} are also seen in \cmd{scans}. To duplicate a
|
---|
[534] | 985 | scantable, use the copy function.
|
---|
| 986 |
|
---|
| 987 | \begin{verbatim}
|
---|
[1259] | 988 | ASAP>ss = scans.copy()
|
---|
[534] | 989 | \end{verbatim}
|
---|
| 990 |
|
---|
| 991 | \section{Data Output}
|
---|
| 992 |
|
---|
[794] | 993 | \index{Scantable!save}\index{Saving data}ASAP can save scantables in a
|
---|
| 994 | variety of formats, suitable for reading into other packages. The
|
---|
| 995 | formats are:
|
---|
[534] | 996 |
|
---|
| 997 | \begin{itemize}
|
---|
| 998 | \item[ASAP] This is the internal format used for ASAP. It is the only
|
---|
[544] | 999 | format that allows the user to restore the data, fits etc. without
|
---|
| 1000 | loosing any information. As mentioned before, the ASAP scantable is
|
---|
| 1001 | an AIPS++ Table (a memory-based table). This function just converts
|
---|
| 1002 | it to a disk-based Table. You can the access that Table with the
|
---|
| 1003 | AIPS++ Table browser or any other AIPS++ tool.
|
---|
[534] | 1004 |
|
---|
[544] | 1005 | \item[SDFITS] The Single Dish FITS format. This format was designed to
|
---|
| 1006 | for interchange between packages, but few packages actually can read
|
---|
| 1007 | it.
|
---|
[534] | 1008 |
|
---|
[1064] | 1009 | %\item[FITS] This uses simple ``image'' fits to save the data, each row
|
---|
| 1010 | % being written to a separate fits file. This format is suitable for
|
---|
| 1011 | % importing the data into CLASS.
|
---|
[534] | 1012 |
|
---|
| 1013 | \item[ASCII] A simple text based format suitable for the user to
|
---|
| 1014 | processing using Perl or, Python, gnuplot etc.
|
---|
| 1015 |
|
---|
| 1016 | \item[MS2] Saves the data in an aips++ MeasurementSet V2 format.
|
---|
| 1017 | You can also access this with the Table browser and other AIPS++
|
---|
| 1018 | tools.
|
---|
| 1019 |
|
---|
| 1020 | \end{itemize}
|
---|
| 1021 |
|
---|
[738] | 1022 | The default output format can be set in the users {\tt .asaprc} file.
|
---|
[534] | 1023 | Typical usages are:
|
---|
| 1024 |
|
---|
| 1025 | \begin{verbatim}
|
---|
[1259] | 1026 | ASAP>scans.save('myscans') # Save in default format
|
---|
| 1027 | ASAP>scans.save('myscans', 'FITS') # Save as FITS for exporting into CLASS
|
---|
| 1028 | ASAP>scans.save('myscans', overwrite=True) # Overwrite an existing file
|
---|
[534] | 1029 | \end{verbatim}
|
---|
| 1030 |
|
---|
| 1031 | \section{Plotter}
|
---|
| 1032 |
|
---|
[1259] | 1033 | \index{Plotter}Scantable spectra can be plotted at any time. An
|
---|
| 1034 | asapplotter object is used for plotting, meaning multiple plot windows
|
---|
| 1035 | can be active at the same time. On start up a default asapplotter
|
---|
| 1036 | object is created called ``plotter''. This would normally be used for
|
---|
| 1037 | standard plotting.
|
---|
[534] | 1038 |
|
---|
[1259] | 1039 | The plotter, optionally, will run in a multi-panel mode and contain
|
---|
[534] | 1040 | multiple plots per panel. The user must tell the plotter how they want
|
---|
| 1041 | the data distributed. This is done using the set\_mode function. The
|
---|
| 1042 | default can be set in the users {\tt .asaprc} file. The units (and frame
|
---|
[538] | 1043 | etc) of the abscissa will be whatever has previously been set by
|
---|
| 1044 | \cmd{set\_unit}, \cmd{set\_freqframe} etc.
|
---|
[534] | 1045 |
|
---|
| 1046 | Typical plotter usage would be:
|
---|
| 1047 |
|
---|
| 1048 | \begin{verbatim}
|
---|
[1259] | 1049 | ASAP>scans.set_unit('km/s')
|
---|
| 1050 | ASAP>plotter.set_mode(stacking='p',panelling='t')
|
---|
| 1051 | ASAP>plotter.plot(scans)
|
---|
[534] | 1052 | \end{verbatim}
|
---|
| 1053 |
|
---|
| 1054 | This will plot multiple polarisation within each plot panel and each
|
---|
[544] | 1055 | scan row in a separate panel.
|
---|
[534] | 1056 |
|
---|
[538] | 1057 | Other possibilities include:
|
---|
[534] | 1058 |
|
---|
| 1059 | \begin{verbatim}
|
---|
| 1060 | # Plot multiple IFs per panel
|
---|
[1259] | 1061 | ASAP>plotter.set_mode(stacking='i',panelling='t')
|
---|
[538] | 1062 |
|
---|
| 1063 | # Plot multiple beams per panel
|
---|
[1259] | 1064 | ASAP>plotter.set_mode(stacking='b',panelling='t')
|
---|
[538] | 1065 |
|
---|
| 1066 | # Plot one IF per panel, time stacked
|
---|
[1259] | 1067 | ASAP>plotter.set_mode('t', 'i')
|
---|
[538] | 1068 |
|
---|
| 1069 | # Plot each scan in a seperate panel
|
---|
[1259] | 1070 | ASAP>plotter.set_mode('t', 's')
|
---|
[538] | 1071 |
|
---|
[534] | 1072 | \end{verbatim}
|
---|
| 1073 |
|
---|
[538] | 1074 | \subsection{Plot Selection}
|
---|
| 1075 | \label{sec:plotter_cursor}
|
---|
| 1076 |
|
---|
[794] | 1077 | \index{Plotter!selection}The plotter can plot up to 25 panels and
|
---|
| 1078 | stacked spectra per panel. If you have data larger than this (or for
|
---|
| 1079 | your own sanity) you need to select a subset of this data. This is
|
---|
[953] | 1080 | particularly true for multibeam or multi IF data. The selector object
|
---|
[971] | 1081 | should be used for this purpose. Selection can either be applied to
|
---|
[953] | 1082 | the scantable or directly to the plotter, the end result is the same.
|
---|
[1259] | 1083 | You don't have to reset the scantable selection though, if you set
|
---|
[971] | 1084 | the selection on the plotter.
|
---|
[538] | 1085 |
|
---|
| 1086 | Examples:
|
---|
| 1087 |
|
---|
| 1088 | \begin{verbatim}
|
---|
[1259] | 1089 | ASAP>selection = selector()
|
---|
[538] | 1090 | # Select second IF
|
---|
[1259] | 1091 | ASAP>selection.set_ifs(1)
|
---|
| 1092 | ASAP>plotter.set_selection(selection)
|
---|
[538] | 1093 |
|
---|
| 1094 | # Select first 4 beams
|
---|
[1259] | 1095 | ASAP>selection.set_beams([0,1,2,3])
|
---|
| 1096 | ASAP>plotter.set_selection(selection)
|
---|
[538] | 1097 |
|
---|
[953] | 1098 | # Select a few scans
|
---|
[1259] | 1099 | ASAP>selection.set_scans([2,4,6,10])
|
---|
| 1100 | ASAP>plotter.set_selection(selection)
|
---|
[538] | 1101 |
|
---|
| 1102 | # Multiple selection
|
---|
[1259] | 1103 | ASAP>selection.set_ifs(1)
|
---|
| 1104 | ASAP>selection.set_scans([2,4,6,10])
|
---|
| 1105 | ASAP>plotter.set_selection(selection)
|
---|
[953] | 1106 |
|
---|
[538] | 1107 | \end{verbatim}
|
---|
| 1108 |
|
---|
[544] | 1109 | \subsection{Plot Control}
|
---|
| 1110 |
|
---|
[794] | 1111 | \index{Plotter!control}The plotter window has a row of buttons on the
|
---|
| 1112 | lower left. These can be used to control the plotter (mostly for
|
---|
| 1113 | zooming the individual plots). From left to right:
|
---|
[534] | 1114 |
|
---|
| 1115 | \begin{itemize}
|
---|
| 1116 |
|
---|
| 1117 | \item[Home] This will unzoom the plots to the original zoom factor
|
---|
| 1118 |
|
---|
| 1119 | \item[Plot history] (left and right arrow). The plotter keeps a
|
---|
| 1120 | history of zoom settings. The left arrow sets the plot zoom to the
|
---|
| 1121 | previous value. The right arrow returns back again. This allows you,
|
---|
| 1122 | for example, to zoom in on one feature then return the plot to how it
|
---|
| 1123 | was previously.
|
---|
| 1124 |
|
---|
| 1125 | \item[Pan] (The Cross) This sets the cursor to pan, or scroll mode
|
---|
[953] | 1126 | allowing you to shift the plot within the window. Useful when
|
---|
| 1127 | zoomed in on a feature.
|
---|
[534] | 1128 |
|
---|
| 1129 | \item[Zoom] (the letter with the magnifying glass) lets you draw a
|
---|
[953] | 1130 | rectangle around a region of interest then zooms in on that
|
---|
| 1131 | region. Use the plot history to unzoom again.
|
---|
[534] | 1132 |
|
---|
[1259] | 1133 | \item[Adjust] (rectangle with 4 arrows) adjust subplot parameters
|
---|
[953] | 1134 | (space at edge of plots)
|
---|
| 1135 |
|
---|
[534] | 1136 | \item[Save] (floppy disk). Save the plot as a postscript or .png file
|
---|
| 1137 |
|
---|
[794] | 1138 | You can also type ``g'' in the plot window to toggle on and off grid
|
---|
| 1139 | lines. Typing 'l' turns on and off logarithmic Y-axis.
|
---|
| 1140 |
|
---|
[534] | 1141 | \end{itemize}
|
---|
| 1142 |
|
---|
| 1143 | \subsection{Other control}
|
---|
| 1144 |
|
---|
| 1145 | The plotter has a number of functions to describe the layout of the
|
---|
| 1146 | plot. These include \cmd{set\_legend}, \cmd{set\_layout} and \cmd{set\_title}.
|
---|
| 1147 |
|
---|
| 1148 | To set the exact velocity or channel range to be plotted use the
|
---|
| 1149 | \cmd{set\_range} function. To reset to the default value, call
|
---|
| 1150 | \cmd{set\_range} with no arguments. E.g.
|
---|
| 1151 |
|
---|
| 1152 | \begin{verbatim}
|
---|
[1259] | 1153 | ASAP>scans.set_unit('km/s')
|
---|
| 1154 | ASAP>plotter.plot(scans)
|
---|
| 1155 | ASAP>plotter.set_range(-150,-50)
|
---|
| 1156 | ASAP>plotter.set_range() # To reset
|
---|
[534] | 1157 | \end{verbatim}
|
---|
| 1158 |
|
---|
[544] | 1159 | Both the range of the ``x'' and ``y'' axis can be set at once, if desired:
|
---|
| 1160 |
|
---|
| 1161 | \begin{verbatim}
|
---|
[1259] | 1162 | ASAP>plotter.set_range(-10,30,-1,6.6)
|
---|
[544] | 1163 | \end{verbatim}
|
---|
| 1164 |
|
---|
[738] | 1165 | To save a hardcopy of the current plot, use the save function, e.g.
|
---|
[534] | 1166 |
|
---|
| 1167 | \begin{verbatim}
|
---|
[1259] | 1168 | ASAP>plotter.save('myplot.ps')
|
---|
| 1169 | ASAP>plotter.save('myplot.png', dpi=80)
|
---|
[534] | 1170 | \end{verbatim}
|
---|
| 1171 |
|
---|
[1217] | 1172 | \subsection{Plotter Customisation}
|
---|
| 1173 |
|
---|
| 1174 | The plotter allows the user to change most properties such as text
|
---|
[1259] | 1175 | size and colour. The \cmd{commands} function and {\cmd help\
|
---|
[1217] | 1176 | asapplotter} list all the possible commands that can be used with the
|
---|
| 1177 | plotter.
|
---|
| 1178 |
|
---|
| 1179 | \commanddef{set\_colors}{Change the default colours used for line
|
---|
| 1180 | plotting. Colours can be given either by name, using the html standard
|
---|
| 1181 | (e.g. red, blue or hotpink), or hexadecimal code (e.g. for black
|
---|
| 1182 | \#000000). If less colours are specified than lines plotted , the
|
---|
| 1183 | plotter cycles through the colours. Example:} {ASAP>
|
---|
| 1184 | plotter.set\_colors('red blue green')\\ ASAP>
|
---|
| 1185 | plotter.set\_colors(`\#0000 blue \#FF00FF')\\ }
|
---|
| 1186 |
|
---|
| 1187 | \commanddef{set\_linestyles}{Change the line styles used for
|
---|
| 1188 | plots. Allowable values are 'line', 'dashed', 'dotted', 'dashdot',
|
---|
| 1189 | 'dashdotdot' and 'dashdashdot. Example: }{
|
---|
[1259] | 1190 | ASAP>plotter.set\_linestyles('line dash cotted datshot.)\\
|
---|
| 1191 | ASAP>plotter.set\_font(size=10)\\
|
---|
[1217] | 1192 | }
|
---|
| 1193 |
|
---|
| 1194 | \commanddef{set\_font}{Change the font style and size. Example}{
|
---|
[1259] | 1195 | ASAP>plotter.set\_font(weight='bold')\\
|
---|
| 1196 | ASAP>plotter.set\_font(size=10)\\
|
---|
| 1197 | ASAP>plotter.set\_font(style='italic')\\
|
---|
[1217] | 1198 | }
|
---|
| 1199 |
|
---|
[1259] | 1200 | \commanddef{set\_layout}{Change the multi-panel layout, i.e. now many
|
---|
[1217] | 1201 | rows and columns}{
|
---|
[1259] | 1202 | ASAP>plotter.set\_layout(3,2)
|
---|
[1217] | 1203 | }
|
---|
| 1204 |
|
---|
| 1205 | \commanddef{set\_legend}{Set the position, size and optional value of the legend}{
|
---|
[1259] | 1206 | ASAP>plotter.set\_legend(fontsize=16)\\
|
---|
| 1207 | ASAP>plotter.set\_legend(mode=0) \# ASAP chooses where to put the legend\\
|
---|
| 1208 | ASAP>plotter.set\_legend(mode=4) \# Put legend on lower right\\
|
---|
| 1209 | ASAP>plotter.set\_legend(mode=-1) \# No legend\\
|
---|
| 1210 | ASAP>plotter.set\_legend(mp=['RR','LL']) \# Specify legend labels\\
|
---|
| 1211 | ASAP>plotter.set\_legend(mp=[r'\$\^\{12\}CO\$',r'\$\^\{13\}CO\$']) \# Latex labels
|
---|
[1217] | 1212 | }
|
---|
| 1213 |
|
---|
| 1214 | \commanddef{set\_title}{Set the plot title. If multiple panels are
|
---|
| 1215 | plotted, multiple titles have to be specified}{
|
---|
[1259] | 1216 | ASAP>plotter.set\_title(`G323.12$-$1.79`)\\
|
---|
| 1217 | ASAP>plotter.set\_title([`SiO`, 'Methanol'], fontsize=18)\\
|
---|
[1217] | 1218 | }
|
---|
| 1219 |
|
---|
| 1220 | \subsection{Plotter Annotations}
|
---|
| 1221 |
|
---|
[1259] | 1222 | The plotter allows various annotations (lines, arrows, text and
|
---|
[1217] | 1223 | ``spans'') to be added to the plot. These annotations are
|
---|
| 1224 | ``temporary'', when the plotter is next refreshed
|
---|
| 1225 | (e.g. \cmd{plotter.plot} or \cmd{plotter.set\_range}) the annotations
|
---|
| 1226 | will be removed.
|
---|
| 1227 |
|
---|
[1259] | 1228 | \bigcommanddef{arrow(x,y,x+dx,y+dy)}{Draw an arrow from a specified
|
---|
[1217] | 1229 | \cmd{(x,y)} position to \cmd{(x+dx, y+dy)}. The values are in world
|
---|
| 1230 | coordinates. \em {HOW TO SET ARROW HEAD??}}{
|
---|
[1259] | 1231 | ASAP>plotter.arrow(-40,7,35,0)
|
---|
[1217] | 1232 | }
|
---|
| 1233 |
|
---|
| 1234 | \bigcommanddef{axhline(y, xmin, xmax)}{Draw a horizontal line at the
|
---|
[1259] | 1235 | specified \cmd{y} position (in world coordinates) between xmin and xmax
|
---|
| 1236 | (in relative coordinates, i.e. 0.0 is the left hand edge of the plot
|
---|
[1217] | 1237 | while 1.0 is the right side of the plot.}{
|
---|
[1259] | 1238 | ASAP>plotter.axhline(6.0,0.2,0.8)
|
---|
[1217] | 1239 | }
|
---|
| 1240 |
|
---|
| 1241 | \bigcommanddef{avhline(x, ymin, ymax)}{Draw a vertical line at the
|
---|
[1259] | 1242 | specified \cmd{x} position (in world coordinates) between \cmd{ymin}
|
---|
| 1243 | and \cmd{ymax} (in relative coordinates, i.e. 0.0 is the left hand edge
|
---|
[1217] | 1244 | of the plot while 1.0 is the right side of the plot).}{
|
---|
[1259] | 1245 | ASAP>plotter.axvline(-50.0,0.1,1.0)
|
---|
[1217] | 1246 | }
|
---|
| 1247 |
|
---|
| 1248 | \bigcommanddef{axhspan(ymin, ymax, \\ \hspace*{20mm}xmin,
|
---|
| 1249 | xmax)}{Overlay a transparent colour rectangle. \cmd{ymin} and
|
---|
[1259] | 1250 | \cmd{ymax} are given in world coordinates while \cmd{xmin} and
|
---|
[1217] | 1251 | \cmd{xmax} are given in relative coordinates}{
|
---|
[1259] | 1252 | ASAP>plotter.axhspan(2,4,0.25,0.75)
|
---|
[1217] | 1253 | }
|
---|
| 1254 |
|
---|
| 1255 | \bigcommanddef{axvspan(xmin, xmax, \\ \hspace*{20mm} ymin,
|
---|
| 1256 | ymax)}{Overlay a transparent colour rectangle. \cmd{ymin} and
|
---|
[1259] | 1257 | \cmd{ymax} are given in relative coordinates while \cmd{xmin} and
|
---|
[1217] | 1258 | \cmd{xmax} are given in world coordinates}{
|
---|
[1259] | 1259 | ASAP>plotter.axvspan(-50,60,0.2,0.5)
|
---|
[1217] | 1260 | }
|
---|
| 1261 |
|
---|
| 1262 | \bigcommanddef{text(x, y, str)}{Place the string \cmd{str} at the
|
---|
| 1263 | given \cmd{(x,y)} position in world coordinates.}{
|
---|
| 1264 | ASAP>plotter.text(-10,7,"CO")
|
---|
| 1265 | }
|
---|
| 1266 |
|
---|
| 1267 |
|
---|
| 1268 |
|
---|
| 1269 | These functions all take a set of \cmd{kwargs} commands. These can be
|
---|
| 1270 | used to set colour, linewidth fontsize etc. These are standard
|
---|
| 1271 | matplotlib settings. Common ones include:
|
---|
| 1272 |
|
---|
| 1273 | \begin{tabular}{ll}
|
---|
| 1274 | \tt color \\
|
---|
| 1275 | \tt linewidth \\
|
---|
| 1276 | \tt fontsize \\
|
---|
| 1277 | \tt fontname & Sans, Helvetica, Courier, Times etc\\
|
---|
| 1278 | \tt rotation & Text rotation (horizontal, vertical) \\
|
---|
| 1279 | \tt alpha & The alpha transparency on 0-1 scale\\
|
---|
| 1280 | \end{tabular}
|
---|
| 1281 |
|
---|
| 1282 | Examples:
|
---|
| 1283 | \begin{verbatim}
|
---|
[1259] | 1284 | ASAP>plotter.axhline(6.0,0.2,0.8, color='red', linewidth=3)
|
---|
| 1285 | ASAP>plotter.text(-10,7,"CO", fontsize=20)
|
---|
[1217] | 1286 | \end{verbatim}
|
---|
| 1287 |
|
---|
[1259] | 1288 | \section{Line Catalog}
|
---|
| 1289 |
|
---|
| 1290 | \index{Linecatalog}ASAP can load and manipulate line catlogs to retrieve rest frequencies
|
---|
| 1291 | for \cmd{set\_restfreqs} and for line identification in the
|
---|
| 1292 | plotter. No line catalogs are built into ASAP, the user must load a
|
---|
| 1293 | ASCII based table (which can optionally be saved in an internal
|
---|
| 1294 | format) either of the users own creation or a standard line catalog
|
---|
| 1295 | such as the JPL line catalog or Lovas. The ATNF asap ftp area as
|
---|
| 1296 | copies of the JPL and Lovas catalog in the appropriate format. All
|
---|
| 1297 | line catalogs are loaded into a ``linecatalog'' object.
|
---|
| 1298 |
|
---|
| 1299 | \subsection{Loading a Line Catalog}
|
---|
| 1300 |
|
---|
| 1301 | \index{Linecatalog|loading}The ASCII text line catalog must have at
|
---|
| 1302 | least 4 columns. The first four columns must contain (in order):
|
---|
| 1303 | Molecule name, frequency in MHz, frequency error and ``intensity''
|
---|
| 1304 | (any units). If the molecule name contains any spaces, they must be
|
---|
| 1305 | wrapped in quotes \verb+""+.
|
---|
| 1306 |
|
---|
| 1307 | A sample from the JPL line catalog:
|
---|
| 1308 |
|
---|
| 1309 | \begin{verbatim}
|
---|
| 1310 | H2D+ 3955.2551 228.8818 -7.1941
|
---|
| 1311 | H2D+ 12104.7712 177.1558 -6.0769
|
---|
| 1312 | H2D+ 45809.2731 118.3223 -3.9494
|
---|
| 1313 | CH 701.6811 .0441 -7.1641
|
---|
| 1314 | CH 724.7709 .0456 -7.3912
|
---|
| 1315 | CH 3263.7940 .1000 -6.3501
|
---|
| 1316 | CH 3335.4810 .1000 -6.0304
|
---|
| 1317 | \end{verbatim}
|
---|
| 1318 |
|
---|
| 1319 | To load a line catalog then save it in the internal format:
|
---|
| 1320 |
|
---|
| 1321 | \begin{verbatim}
|
---|
| 1322 | ASAP>jpl = linecatalog('jpl_pruned.txt')
|
---|
| 1323 | ASAP>jpl.save('jpl.tbl')
|
---|
| 1324 | \end{verbatim}
|
---|
| 1325 |
|
---|
| 1326 | Later the saved line catalog can reloaded:
|
---|
| 1327 |
|
---|
| 1328 | \begin{verbatim}
|
---|
| 1329 | ASAP>jpl = linecatalog('jpl.tbl')
|
---|
| 1330 | \end{verbatim}
|
---|
| 1331 |
|
---|
| 1332 | \subsection{Line selection}
|
---|
| 1333 |
|
---|
| 1334 | \index{Linecatalog|line selection}The linecatalog has a number of
|
---|
| 1335 | selection functions to select a range of lines from a larger catalog
|
---|
| 1336 | (the JPL catalog has $>$180000 lines for
|
---|
| 1337 | example). \cmd{set\_frequency\_limits} selects on frequency range,
|
---|
| 1338 | \cmd{set\_strength\_limits} selects on intensity while \cmd{set\_name}
|
---|
| 1339 | selects on molecule name (wild cards allowed).
|
---|
| 1340 |
|
---|
| 1341 | \begin{verbatim}
|
---|
| 1342 | ASAP>jpl = linecatalog('jpl.tbl')
|
---|
| 1343 | ASAP>jpl.set_frequency_limits(80,115,'GHz') # Lines for 3mm receiver
|
---|
| 1344 | ASAP>jpl.set_name('*OH') # Select all alcohols
|
---|
| 1345 | ASAP>jpl.set_name('OH') # Select only OH molecules
|
---|
| 1346 | ASAP>jpl.summary()
|
---|
| 1347 |
|
---|
| 1348 | ASAP>jpl.reset() # Selections are accumulative
|
---|
| 1349 | ASAP>jpl.set_frequency_limits(80,115,'GHz')
|
---|
| 1350 | ASAP>jpl.set_strength_limits(-2,10) # Select brightest lines
|
---|
| 1351 | ASAP>jpl.summary()
|
---|
| 1352 | \end{verbatim}
|
---|
| 1353 |
|
---|
| 1354 | \subsection{Using Linecatalog}
|
---|
| 1355 |
|
---|
| 1356 | The line catalogs can be used for line overlays on the plotter or with
|
---|
| 1357 | \cmd{set\_restfreq}.
|
---|
| 1358 |
|
---|
| 1359 | \subsubsection{Plotting linecatalog}
|
---|
| 1360 |
|
---|
| 1361 | \index{Linecatalog|plotting}
|
---|
| 1362 |
|
---|
| 1363 | The plotter \cmd{plot\_lines} function takes a line catalog as an
|
---|
| 1364 | argument and overlays the lines on the spectrum. {\em Currently this
|
---|
| 1365 | only works when plotting in units of frequency (Hz, GHz etc).} If a
|
---|
| 1366 | large line catalog has been loaded (e.g. JPL) it is highly recommended
|
---|
| 1367 | that you use the selection functions to narrow down the number of
|
---|
| 1368 | lines. By default the line catalog overlay is plotted assuming a line
|
---|
| 1369 | velocity of 0.0. This can be set using the \cmd{doppler} argument (in
|
---|
| 1370 | km/s). Each time \cmd{plot\_lines} is called the new lines are added
|
---|
| 1371 | to any existing line catalog annotations. These are all removed after
|
---|
| 1372 | the next call to \cmd{plotter.plot()}.
|
---|
| 1373 |
|
---|
| 1374 | \begin{verbatim}
|
---|
| 1375 | ASAP>jpl = linecatalog('jpl.tbl')
|
---|
| 1376 | ASAP>jpl.set_frequency_limits(23,24,'GHz')
|
---|
| 1377 | ASAP>data.set_unit('GHz') # Only works with freq axis currently
|
---|
| 1378 | ASAP>plotter.plot(data)
|
---|
| 1379 | ASAP>plotter.plot_lines(jpl)
|
---|
| 1380 |
|
---|
| 1381 | ASAP>plotter.plot() # Reset plotter
|
---|
| 1382 | ASAP>plotter.plot_lines(jpl,doppler=-10,location='Top') # On top with -10 km/s velocity
|
---|
| 1383 | \end{verbatim}
|
---|
| 1384 |
|
---|
| 1385 | \subsubsection{Setting Rest Frequencies}
|
---|
| 1386 |
|
---|
| 1387 | \index{Linecatalog|set_restfreq}
|
---|
| 1388 |
|
---|
[534] | 1389 | \section{Fitting}
|
---|
| 1390 |
|
---|
[794] | 1391 | \index{Fitting}Currently multicomponent Gaussian function is
|
---|
| 1392 | available. This is done by creating a fitting object, setting up the
|
---|
| 1393 | fit and actually fitting the data. Fitting can either be done on a
|
---|
[966] | 1394 | single scantable selection or on an entire scantable using the
|
---|
| 1395 | \cmd{auto\_fit} function. If single value fitting is used, and the
|
---|
| 1396 | current selection includes multiple spectra (beams, IFs, scans etc)
|
---|
[971] | 1397 | then the first spectrum in the scantable will be used for fitting.
|
---|
[534] | 1398 |
|
---|
| 1399 | \begin{verbatim}
|
---|
[1259] | 1400 | ASAP>f = fitter()
|
---|
| 1401 | ASAP>f.set_function(gauss=2) # Fit two Gaussians
|
---|
| 1402 | ASAP>f.set_scan(scans)
|
---|
| 1403 | ASAP>selection = selector()
|
---|
| 1404 | ASAP>selection.set_polarisations(1) # Fit the second polarisation
|
---|
| 1405 | ASAP>scans.set_selection(selection)
|
---|
| 1406 | ASAP>scans.set_unit('km/s') # Make fit in velocity units
|
---|
| 1407 | ASAP>f.fit(1) # Run the fit on the second row in the table
|
---|
| 1408 | ASAP>f.plot() # Show fit in a plot window
|
---|
| 1409 | ASAP>f.get_parameters() # Return the fit paramaters
|
---|
[534] | 1410 | \end{verbatim}
|
---|
| 1411 |
|
---|
| 1412 | This auto-guesses the initial values of the fit and works well for data
|
---|
| 1413 | without extra confusing features. Note that the fit is performed in
|
---|
| 1414 | whatever unit the abscissa is set to.
|
---|
| 1415 |
|
---|
| 1416 | If you want to confine the fitting to a smaller range (e.g. to avoid
|
---|
| 1417 | band edge effects or RFI you must set a mask.
|
---|
| 1418 |
|
---|
| 1419 | \begin{verbatim}
|
---|
[1259] | 1420 | ASAP>f = fitter()
|
---|
| 1421 | ASAP>f.set_function(gauss=2)
|
---|
| 1422 | ASAP>scans.set_unit('km/s') # Set the mask in channel units
|
---|
| 1423 | ASAP>msk = s.create_mask([1800,2200])
|
---|
| 1424 | ASAP>scans.set_unit('km/s') # Make fit in velocity units
|
---|
| 1425 | ASAP>f.set_scan(s,msk)
|
---|
| 1426 | ASAP>f.fit()
|
---|
| 1427 | ASAP>f.plot()
|
---|
| 1428 | ASAP>f.get_parameters()
|
---|
[534] | 1429 | \end{verbatim}
|
---|
| 1430 |
|
---|
[544] | 1431 | If you wish, the initial parameter guesses can be specified and
|
---|
| 1432 | specific parameters can be fixed:
|
---|
[534] | 1433 |
|
---|
| 1434 | \begin{verbatim}
|
---|
[1259] | 1435 | ASAP>f = fitter()
|
---|
| 1436 | ASAP>f.set_function(gauss=2)
|
---|
| 1437 | ASAP>f.set_scan(s,msk)
|
---|
| 1438 | ASAP>f.fit() # Fit using auto-estimates
|
---|
[738] | 1439 | # Set Peak, centre and fwhm for the second gaussian.
|
---|
[534] | 1440 | # Force the centre to be fixed
|
---|
[1259] | 1441 | ASAP>f.set_gauss_parameters(0.4,450,150,0,1,0,component=1)
|
---|
| 1442 | ASAP>f.fit() # Re-run the fit
|
---|
[534] | 1443 | \end{verbatim}
|
---|
| 1444 |
|
---|
| 1445 | The fitter \cmd{plot} function has a number of options to either view
|
---|
| 1446 | the fit residuals or the individual components (by default it plots
|
---|
| 1447 | the sum of the model components).
|
---|
| 1448 |
|
---|
| 1449 | Examples:
|
---|
| 1450 |
|
---|
| 1451 | \begin{verbatim}
|
---|
| 1452 | # Plot the residual
|
---|
[1259] | 1453 | ASAP>f.plot(residual=True)
|
---|
[534] | 1454 |
|
---|
| 1455 | # Plot the first 2 componentsa
|
---|
[1259] | 1456 | ASAP>f.plot(components=[0,1])
|
---|
[534] | 1457 |
|
---|
| 1458 | # Plot the first and third component plus the model sum
|
---|
[1259] | 1459 | ASAP>f.plot(components=[-1,0,2]) # -1 means the compoment sum
|
---|
[534] | 1460 | \end{verbatim}
|
---|
| 1461 |
|
---|
[544] | 1462 | \subsection{Fit saving}
|
---|
| 1463 |
|
---|
[794] | 1464 | \index{Fitter!Fit saving}One you are happy with your fit, it is
|
---|
| 1465 | possible to store it as part of the scantable.
|
---|
[544] | 1466 |
|
---|
| 1467 | \begin{verbatim}
|
---|
[1259] | 1468 | ASAP>f.store_fit()
|
---|
[544] | 1469 | \end{verbatim}
|
---|
| 1470 |
|
---|
| 1471 | This will be saved to disk with the data, if the ``ASAP'' file format
|
---|
| 1472 | is selected. Multiple fits to the same data can be stored in the
|
---|
[738] | 1473 | scantable.
|
---|
[544] | 1474 |
|
---|
| 1475 | The scantable function \cmd{get\_fit} can be used to retrieve the
|
---|
| 1476 | stored fits. Currently the fit parameters are just printed to the
|
---|
| 1477 | screen.
|
---|
| 1478 |
|
---|
| 1479 | \begin{verbatim}
|
---|
[1259] | 1480 | ASAP>scans.get_fit(4) # Print fits for row 4
|
---|
[544] | 1481 | \end{verbatim}
|
---|
| 1482 |
|
---|
[1259] | 1483 | A fit can also be exported to an ASCII file using the \cmd{store\_fit}
|
---|
| 1484 | function. Simply give the name of the output file requires as an
|
---|
| 1485 | argument.
|
---|
| 1486 |
|
---|
| 1487 | \begin{verbatim}
|
---|
| 1488 | ASAP>f.store_fit('myfit.txt')
|
---|
| 1489 | \end{verbatim}
|
---|
| 1490 |
|
---|
[534] | 1491 | \section{Polarisation}
|
---|
| 1492 |
|
---|
[794] | 1493 | \index{Polarisation}Currently ASAP only supports polarmetric analysis
|
---|
| 1494 | on linearly polarised feeds and the cross polarisation products
|
---|
[971] | 1495 | measured. Other cases will be added on an as needed basis.
|
---|
[534] | 1496 |
|
---|
[538] | 1497 | Conversions of linears to Stokes or Circular polarisations are done
|
---|
[966] | 1498 | ``on-the-fly''. Leakage cannot be corrected for nor are there routines
|
---|
| 1499 | to calibrate position angle offsets.
|
---|
[534] | 1500 |
|
---|
[538] | 1501 | \subsection{Simple Calibration}
|
---|
| 1502 |
|
---|
[794] | 1503 | \index{Polarisation!calibration}It is possible that there is a phase
|
---|
| 1504 | offset between polarisation which will effect the phase of the cross
|
---|
| 1505 | polarisation correlation, and so give rise to spurious
|
---|
| 1506 | polarisation. \cmd{rotate\_xyphase} can be used to correct for this
|
---|
| 1507 | error. At this point, the user must know how to determine the size of
|
---|
| 1508 | the phase offset themselves.
|
---|
[538] | 1509 |
|
---|
| 1510 | \begin{verbatim}
|
---|
[1259] | 1511 | ASAP>scans.rotate_xyphase(10.5) # Degrees
|
---|
[538] | 1512 | \end{verbatim}
|
---|
| 1513 |
|
---|
| 1514 | Note that if this function is run twice, the sum of the two values is
|
---|
[546] | 1515 | applied because it is done in-situ.
|
---|
[538] | 1516 |
|
---|
[546] | 1517 | A correction for the receiver parallactic angle may need to be made,
|
---|
[953] | 1518 | generally because of how it is mounted. Use \cmd{rotate\_linpolphase}
|
---|
| 1519 | to correct the position angle. Running this function twice results in
|
---|
| 1520 | the sum of the corrections being applied because it is applied
|
---|
| 1521 | in-situ.
|
---|
[538] | 1522 |
|
---|
| 1523 | \begin{verbatim}
|
---|
[1259] | 1524 | ASAP>scans.rotate_linpolphase(-45) # Degrees; correct for receiver mounting
|
---|
[953] | 1525 | \end{verbatim}
|
---|
[538] | 1526 |
|
---|
[953] | 1527 | If the sign of the complex correlation is wrong (this can happen
|
---|
| 1528 | depending on the correlator configuration), use \cmd{invert\_phase} to
|
---|
| 1529 | change take the complex conjugate of the complex correlation
|
---|
| 1530 | term. This is always performed in-situ.
|
---|
| 1531 |
|
---|
| 1532 | \begin{verbatim}
|
---|
[1259] | 1533 | ASAP>scans.invert_phase()
|
---|
[538] | 1534 | \end{verbatim}
|
---|
| 1535 |
|
---|
[953] | 1536 | Depending on how the correlator is configured, ``BA'' may be
|
---|
[1259] | 1537 | correlated instead of ``AB''. Use \cmd{swap\_linears} to correct for
|
---|
[953] | 1538 | this problem:
|
---|
| 1539 |
|
---|
| 1540 | \begin{verbatim}
|
---|
[1259] | 1541 | ASAP>scans.swap_linears()
|
---|
[953] | 1542 | \end{verbatim}
|
---|
| 1543 |
|
---|
[1011] | 1544 | \subsection{Conversion}
|
---|
| 1545 | \label{sec:polconv}
|
---|
| 1546 |
|
---|
[1064] | 1547 | Data can be permanently converted between linear and circular
|
---|
| 1548 | polarisations and stokes.
|
---|
| 1549 |
|
---|
[1011] | 1550 | \begin{verbatim}
|
---|
[1259] | 1551 | ASAP>stokescans = linearscans.convert_pol("stokes")
|
---|
[1011] | 1552 | \end{verbatim}
|
---|
| 1553 |
|
---|
| 1554 |
|
---|
[538] | 1555 | \subsection{Plotting}
|
---|
| 1556 | \label{sec:polplot}
|
---|
| 1557 |
|
---|
[953] | 1558 | \index{Polarisation!plotting}To plot Stokes values, a selector object
|
---|
| 1559 | must be created and the set\_polarisation function used to select the
|
---|
| 1560 | desired polarisation products.
|
---|
| 1561 |
|
---|
| 1562 | The values which can be plotted include a selection of [I,Q,U,V], [I,
|
---|
| 1563 | Plinear, Pangle, V], [RR, LL] or [XX, YY, Real(XY),
|
---|
[794] | 1564 | Imaginary(XY)]. (Plinear and Pangle are the percentage and position
|
---|
[1011] | 1565 | angle of linear polarisation).
|
---|
[538] | 1566 |
|
---|
| 1567 | Example:
|
---|
| 1568 |
|
---|
| 1569 | \begin{verbatim}
|
---|
[1259] | 1570 | ASAP>selection = selector()
|
---|
[970] | 1571 |
|
---|
[1259] | 1572 | ASAP>selection.set_polarisations(``I Q U V'')
|
---|
[953] | 1573 | ASAP plotter.set_selection(selection); # Select I, Q, U \& V
|
---|
| 1574 |
|
---|
[1259] | 1575 | ASAP>selection.set_polarisations(``I Q'')
|
---|
[953] | 1576 | ASAP plotter.set_selection(selection); # Select just I \& Q
|
---|
| 1577 |
|
---|
[1259] | 1578 | ASAP>selection.set_polarisations(``RR LL'')
|
---|
[953] | 1579 | ASAP plotter.set_selection(selection); # Select just RR \& LL
|
---|
| 1580 |
|
---|
[1259] | 1581 | ASAP>selection.set_polarisations(``XX YY'')
|
---|
[953] | 1582 | ASAP plotter.set_selection(selection); # Select linears
|
---|
| 1583 |
|
---|
[1259] | 1584 | ASAP>selection.set_polarisations(``I Plinear'')
|
---|
[966] | 1585 | ASAP plotter.set_selection(selection); # Fractional linear
|
---|
[953] | 1586 |
|
---|
[1259] | 1587 | ASAP>selection.set_polarisations(``Pangle'')
|
---|
[966] | 1588 | ASAP plotter.set_selection(selection); # Position angle
|
---|
| 1589 |
|
---|
[538] | 1590 | \end{verbatim}
|
---|
| 1591 |
|
---|
[970] | 1592 | Scan, beam and IF selection are also available in the selector object as
|
---|
[953] | 1593 | describe in section~\ref{sec:selection}.
|
---|
[538] | 1594 |
|
---|
| 1595 | \subsection{Saving}
|
---|
| 1596 |
|
---|
[794] | 1597 | \index{Polarisation!saving}When saving data using the \cmd{save}
|
---|
| 1598 | function, the \cmd{stokes} argument can be used to save the data as
|
---|
| 1599 | Stoke values when saving in FITS format.
|
---|
[538] | 1600 |
|
---|
| 1601 | Example:
|
---|
| 1602 |
|
---|
| 1603 | \begin{verbatim}
|
---|
[1259] | 1604 | ASAP>scans.save('myscan.sdfits', 'SDFITS', stokes=True)
|
---|
[538] | 1605 | \end{verbatim}
|
---|
| 1606 |
|
---|
[1217] | 1607 | \section{Specialised Processing}
|
---|
| 1608 |
|
---|
| 1609 | \subsection{Multibeam MX mode}
|
---|
| 1610 |
|
---|
| 1611 | MX mode is a specific observing approach with a multibeam where a
|
---|
| 1612 | single source is observed cycling through each beam. The scans when
|
---|
[1259] | 1613 | the beam is off source is used as a reference for the on-source
|
---|
[1217] | 1614 | scan. The function \cmd{mx\_quotient} is used to make a quotient
|
---|
| 1615 | spectrum from an MX cycle. This works averaging the ``off-source''
|
---|
| 1616 | scans for each beam (either a median average or mean) and using this
|
---|
| 1617 | as a reference scan in a normal quotient (for each beam). The final
|
---|
| 1618 | spectrum for each beam is returned on a new scantable containing
|
---|
| 1619 | single scan (it the scan numbers are re-labelled to be the same). Note
|
---|
| 1620 | that the current version of \cmd{mx\_quotient} only handles a single
|
---|
[1259] | 1621 | MX cycle, i.e. if each beam has observed the source multiple times you
|
---|
[1217] | 1622 | will need to use the selector object multiple times to select a single
|
---|
| 1623 | MX cycle, run \cmd{mx\_quotient} for each cycle then merge the
|
---|
| 1624 | resulting scan tables back together.
|
---|
| 1625 |
|
---|
| 1626 | Example:
|
---|
| 1627 |
|
---|
| 1628 | \begin{verbatim}
|
---|
[1259] | 1629 | ASAP>scans = scantable('mydata.rpf')
|
---|
| 1630 | ASAP>q = scans.mx_quotient()
|
---|
| 1631 | ASAP>plotter.plot(q)
|
---|
[1217] | 1632 | \end{verbatim}
|
---|
| 1633 |
|
---|
| 1634 | The function \cmd{average\_beam} averages multiple beam data
|
---|
| 1635 | together. This is need if MX mode has been used to make a long
|
---|
| 1636 | integration on a single source. E.g.
|
---|
| 1637 |
|
---|
| 1638 | \begin{verbatim}
|
---|
[1259] | 1639 | ASAP>av = q.average_beam()
|
---|
[1217] | 1640 | \end{verbatim}
|
---|
| 1641 |
|
---|
| 1642 | \subsection{Frequency Switching}
|
---|
| 1643 |
|
---|
| 1644 | {\em FILL ME IN}
|
---|
| 1645 |
|
---|
[1259] | 1646 | \subsection{Disk Based Processing}
|
---|
| 1647 | \index{Scantable|disk based}
|
---|
| 1648 |
|
---|
| 1649 | Normally scantables exisit entirely in memory during an ASAP
|
---|
| 1650 | session. This has the adtantage of speed, but causes limits on the
|
---|
| 1651 | size of the dataset which can be loaded. ASAP can use ``disk based''
|
---|
| 1652 | scan tables which
|
---|
| 1653 |
|
---|
| 1654 | {\bf NOTE: } Currently a bug in ipython means temporary files are not
|
---|
| 1655 | cleaned up properly when you exit ASAP. If you use disk based scan
|
---|
| 1656 | tables your directory will be left with 'tmp*' directories. These can
|
---|
| 1657 | be safely removed if ASAP is not running.
|
---|
| 1658 |
|
---|
[770] | 1659 | \section{Scantable Mathematics}
|
---|
| 1660 |
|
---|
[794] | 1661 | \index{Scantable!maths}It is possible to to simple mathematics
|
---|
| 1662 | directly on scantables from the command line using the \cmd{+, -, *,
|
---|
| 1663 | /} operators as well as their cousins \cmd{+=, -= *=, /=}. This works
|
---|
[971] | 1664 | between a scantable and a float. (Note that it does
|
---|
[794] | 1665 | not work for integers).
|
---|
[770] | 1666 |
|
---|
[971] | 1667 | {\em Currently mathematics between two scantables is not available }
|
---|
[966] | 1668 |
|
---|
[1259] | 1669 | % ASAP>sum = scan1+scan2
|
---|
[534] | 1670 | \begin{verbatim}
|
---|
[1259] | 1671 | ASAP>scan2 = scan1+2.0
|
---|
| 1672 | ASAP>scan *= 1.05
|
---|
[770] | 1673 | \end{verbatim}
|
---|
| 1674 |
|
---|
| 1675 | \section{Scripting}
|
---|
| 1676 |
|
---|
[1259] | 1677 | \index{Scripting}Because ASAP is based on python, it easy for the user
|
---|
[794] | 1678 | write their own scripts and functions to process data. This is highly
|
---|
| 1679 | recommended as most processing of user data could then be done in a
|
---|
| 1680 | couple of steps using a few simple user defined functions. A Python
|
---|
[1259] | 1681 | primer is beyond the scope of this userguide. See the ASAP home pages
|
---|
[794] | 1682 | for a scripting tutorial or the main python website for comprehensive
|
---|
| 1683 | documentation.
|
---|
[770] | 1684 |
|
---|
| 1685 | \hspace{1cm} http://www.atnf.csiro.au/computing/software/asap/tutorials
|
---|
[953] | 1686 |
|
---|
[770] | 1687 | \hspace{1cm} http://www.python.org/doc/Introduction.html
|
---|
| 1688 |
|
---|
| 1689 | \subsection{Running scripts}
|
---|
| 1690 |
|
---|
[1259] | 1691 | The ASAP global function \cmd{execfile} reads the named text file and
|
---|
[770] | 1692 | executes the contained python code. This file can either contain
|
---|
| 1693 | function definitions which will be used in subsequent processing or
|
---|
| 1694 | just a set of commands to process a specific dataset.
|
---|
| 1695 |
|
---|
| 1696 | \subsection{asapuserfuncs.py}
|
---|
| 1697 |
|
---|
| 1698 | The file $\sim$/.asap/asapuserfuncs.py is automatically read in when
|
---|
[1259] | 1699 | ASAP is started. The user can use this to define a set of user
|
---|
| 1700 | functions which are automatically available each time ASAP is
|
---|
[770] | 1701 | used. The \cmd{execfile} function can be called from within this file.
|
---|
| 1702 |
|
---|
| 1703 | \section{Worked examples}
|
---|
| 1704 |
|
---|
| 1705 | In the following section a few examples of end-to-end processing of
|
---|
[1259] | 1706 | some data in ASAP are given.
|
---|
[770] | 1707 |
|
---|
| 1708 | \subsection{Mopra}
|
---|
[794] | 1709 | \index{Mopra}
|
---|
[770] | 1710 |
|
---|
[794] | 1711 | The following example is of some dual polarisation, position switched
|
---|
[1259] | 1712 | data from Mopra. The source has been observed multiple times split
|
---|
| 1713 | into a number of separate RPFITS files. To make the processing easier,
|
---|
| 1714 | the first step is to \cmd{cat} the separate RPFITS files together and
|
---|
| 1715 | load as a whole (future versions of ASAP will make this unnecessary).
|
---|
[794] | 1716 |
|
---|
| 1717 |
|
---|
| 1718 | \begin{verbatim}
|
---|
[1011] | 1719 | # get a list of the individual rpfits files in the current directory
|
---|
| 1720 | myfiles = list_files()
|
---|
[794] | 1721 |
|
---|
| 1722 | # Load the data into a scantable
|
---|
[1011] | 1723 | data = scantable(myfiles)
|
---|
[794] | 1724 | print data
|
---|
| 1725 |
|
---|
| 1726 | # Form the quotient spectra
|
---|
| 1727 | q = data.auto_quotient()
|
---|
| 1728 | print q
|
---|
| 1729 |
|
---|
| 1730 | # Look at the spectra
|
---|
| 1731 | plotter.plot(q)
|
---|
| 1732 |
|
---|
[1011] | 1733 | # Set unit and reference frame
|
---|
[794] | 1734 | q.set_unit('km/s')
|
---|
| 1735 | q.set_freqframe('LSRK')
|
---|
| 1736 |
|
---|
[966] | 1737 | # Average all scans in time, aligning in velocity
|
---|
| 1738 | av = q.average_time(align=True)
|
---|
[794] | 1739 | plotter.plot(av)
|
---|
| 1740 |
|
---|
| 1741 | # Remove the baseline
|
---|
| 1742 | msk = av.create_mask([100,130],[160,200])
|
---|
| 1743 | av.poly_baseline(msk,2)
|
---|
| 1744 |
|
---|
| 1745 | # Average the two polarisations together
|
---|
| 1746 | iav = av.average_pol()
|
---|
| 1747 | print iav
|
---|
| 1748 | plotter.plot(iav)
|
---|
| 1749 |
|
---|
| 1750 | # Set a sensible velocity range on the plot
|
---|
| 1751 | plotter.set_range(85,200)
|
---|
| 1752 |
|
---|
| 1753 | # Smooth the data a little
|
---|
| 1754 | av.smooth('gauss',4)
|
---|
| 1755 | plotter.plot()
|
---|
| 1756 |
|
---|
| 1757 | # Fit a guassian to the emission
|
---|
| 1758 | f = fitter()
|
---|
| 1759 | f.set_function(gauss=1)
|
---|
| 1760 | f.set_scan(av)
|
---|
| 1761 | f.fit()
|
---|
| 1762 |
|
---|
| 1763 | # View the fit
|
---|
| 1764 | f.plot()
|
---|
| 1765 |
|
---|
| 1766 | # Get the fit parameters
|
---|
| 1767 | f.get_parameters()
|
---|
| 1768 |
|
---|
| 1769 | \end{verbatim}
|
---|
| 1770 |
|
---|
| 1771 |
|
---|
[770] | 1772 | \subsection{Parkes Polarimetry}
|
---|
| 1773 |
|
---|
[794] | 1774 | \index{Parkes}\index{Polarisation}The following example is processing
|
---|
| 1775 | of some Parkes polarmetric observations of OH masers at
|
---|
| 1776 | 1.6~GHz. Because digital filters where used in the backend, the
|
---|
| 1777 | baselines are stable enough not to require a quotient spectra. The
|
---|
| 1778 | 4~MHz bandwidth is wide enough to observe both the 1665 and 1667~MHz
|
---|
| 1779 | OH maser transitions. Each source was observed once for about 10
|
---|
[1259] | 1780 | minutes. Tsys information was not written to the RPFITS file (a
|
---|
[794] | 1781 | nominal 25K values was used), so the amplitudes need to be adjusted
|
---|
| 1782 | based on a separate log file. A simple user function is used to
|
---|
| 1783 | simplify this, contained in a file called mypol.py:
|
---|
[770] | 1784 |
|
---|
| 1785 | \begin{verbatim}
|
---|
| 1786 | def xyscale(data,xtsys=1.0,ytsys=1.0,nomtsys=25.0) :
|
---|
| 1787 |
|
---|
[966] | 1788 | selection = selector()
|
---|
[971] | 1789 | selection.set_polarisations(0)
|
---|
[966] | 1790 | data.set_selection(selection)
|
---|
| 1791 | data.scale(xtsys/nomtsys)
|
---|
[770] | 1792 |
|
---|
[971] | 1793 | selection.set_polarisations(1)
|
---|
[966] | 1794 | data.set_selection(selection)
|
---|
| 1795 | data.scale(ytsys/nomtsys)
|
---|
[770] | 1796 |
|
---|
[971] | 1797 | selection.set_polarisations(0)
|
---|
[966] | 1798 | data.set_selection(selection)
|
---|
| 1799 | data.scale((xtsys+ytsys)/(2*nomtsys))
|
---|
[770] | 1800 |
|
---|
[971] | 1801 | selection.set_polarisations(0)
|
---|
[966] | 1802 | data.set_selection(selection)
|
---|
| 1803 | data.scale((xtsys+ytsys)/(2*nomtsys))
|
---|
[770] | 1804 | \end{verbatim}
|
---|
| 1805 |
|
---|
[1259] | 1806 | The typical ASAP session would be
|
---|
[770] | 1807 |
|
---|
| 1808 | \begin{verbatim}
|
---|
[794] | 1809 |
|
---|
[770] | 1810 | # Remind ourself the name of the rpfits files
|
---|
[794] | 1811 | ls
|
---|
[770] | 1812 |
|
---|
| 1813 | # Load data from an rpfits file
|
---|
| 1814 | d1665 = scantable('2005-10-27_0154-P484.rpf')
|
---|
| 1815 |
|
---|
| 1816 | # Check what we have just loaded
|
---|
[1011] | 1817 | d1665.summary()
|
---|
[770] | 1818 |
|
---|
| 1819 | # View the data in velocity
|
---|
| 1820 | d1665.set_unit('km/s')
|
---|
| 1821 | d1665.set_freqframe('LSRK')
|
---|
| 1822 |
|
---|
| 1823 | # Correct for the known phase offset in the crosspol data
|
---|
| 1824 | d1665.rotate_xyphase(-4)
|
---|
| 1825 |
|
---|
[794] | 1826 | # Create a copy of the data and set the rest frequency to the 1667 MHz
|
---|
[770] | 1827 | # transition
|
---|
| 1828 | d1667 = d1665.copy()
|
---|
[966] | 1829 | d1667.set_restfreqs([1667.3590], 'MHz')
|
---|
| 1830 | d1667.summary()
|
---|
[770] | 1831 |
|
---|
| 1832 | # Copy out the scan we wish to process
|
---|
| 1833 | g351_5 = d1665.get_scan('351p160')
|
---|
| 1834 | g351_7 = d1667.get_scan('351p160')
|
---|
| 1835 |
|
---|
[966] | 1836 | # Baseline both
|
---|
| 1837 | msk = g351_5.create_mask([-30,-25],[-5,0])
|
---|
| 1838 | g351_5.poly_baseline(msk,order=1)
|
---|
| 1839 | msk = g351_7.create_mask([-30,-25],[-5,0])
|
---|
| 1840 | g351_7.poly_baseline(msk,order=1)
|
---|
[770] | 1841 |
|
---|
[966] | 1842 |
|
---|
| 1843 | # Plot the data. The plotter can only plot a single scantable
|
---|
| 1844 | # So we must merge the two tables first
|
---|
| 1845 |
|
---|
| 1846 | plotscans = merge(g351_5, g351_7)
|
---|
| 1847 |
|
---|
| 1848 | plotter.plot(plotscans) # Only shows one panel
|
---|
| 1849 |
|
---|
[770] | 1850 | # Tell the plotter to stack polarisation and panel scans
|
---|
| 1851 | plotter.set_mode('p','s')
|
---|
| 1852 |
|
---|
| 1853 | # Correct for the Tsys using our predefined function
|
---|
[971] | 1854 | execfile('mypol.py') # Read in the function xyscale
|
---|
[770] | 1855 | xyscale(g351_5,23.2,22.7) # Execute it on the data
|
---|
| 1856 | xyscale(g351_7,23.2,22.7)
|
---|
| 1857 |
|
---|
| 1858 | # Only plot the velocity range of interest
|
---|
| 1859 | plotter.set_range(-30,10)
|
---|
| 1860 |
|
---|
| 1861 | # Update the plot with the baselined data
|
---|
| 1862 | plotter.plot()
|
---|
| 1863 |
|
---|
| 1864 | # Look at the various polarisation products
|
---|
[966] | 1865 | selection = selector()
|
---|
| 1866 | selection.set_polarisations(``RR LL'')
|
---|
| 1867 | plotter.set_selection(selection)
|
---|
| 1868 | selection.set_polarisations(``I Plinear'')
|
---|
| 1869 | plotter.set_selection(selection)
|
---|
| 1870 | selection.set_polarisations(``I Q U V'')
|
---|
| 1871 | plotter.set_selection(selection)
|
---|
[770] | 1872 |
|
---|
| 1873 | # Save the plot as postscript
|
---|
[966] | 1874 | plotter.save('g351_stokes.ps')
|
---|
[770] | 1875 |
|
---|
| 1876 | # Save the process spectra
|
---|
[966] | 1877 | plotscans.save('g351.asap')
|
---|
[770] | 1878 |
|
---|
| 1879 | \end{verbatim}
|
---|
| 1880 |
|
---|
| 1881 | \subsection{Tidbinbilla}
|
---|
| 1882 |
|
---|
[794] | 1883 | \index{Tidbinbilla}The following example is processing of some
|
---|
| 1884 | Tidbinbilla observations of NH$_3$ at 12~mm. Tidbinbilla has (at the
|
---|
| 1885 | time of observations) a single polarisation, but can process two IFs
|
---|
| 1886 | simultaneously. In the example, the first half of the observation was
|
---|
| 1887 | observing the (1,1) and (2,2) transitions simultaneously). The second
|
---|
| 1888 | half observed only the (4,4) transition due to bandwidth
|
---|
| 1889 | limitations. The data is position switched, observing first an
|
---|
| 1890 | reference to the west, then the source twice and finally reference to
|
---|
| 1891 | the east.
|
---|
[770] | 1892 |
|
---|
| 1893 | \begin{verbatim}
|
---|
| 1894 |
|
---|
| 1895 | # Load the rpfits file and inspect
|
---|
| 1896 | d = scantable('2003-03-16_082048_t0002.rpf')
|
---|
| 1897 | print d
|
---|
| 1898 |
|
---|
| 1899 | # Make the quotient spectra
|
---|
| 1900 | q = d.auto_quotient()
|
---|
| 1901 | print q
|
---|
| 1902 |
|
---|
[966] | 1903 | del d
|
---|
| 1904 |
|
---|
[770] | 1905 | # Plot/select in velocity
|
---|
| 1906 | q.set_freqframe('LSRK')
|
---|
| 1907 | q.set_unit('km/s')
|
---|
| 1908 |
|
---|
[966] | 1909 | # Correct for gain/el effects
|
---|
| 1910 |
|
---|
| 1911 | q.recalc_azel() # Tid does not write the elevation
|
---|
| 1912 | q.gain_el()
|
---|
| 1913 | q.opacity(0.05)
|
---|
| 1914 |
|
---|
[770] | 1915 | # Seperate data from the (1,1)&(2,2) and (4,4) transitions
|
---|
[971] | 1916 | g1 = q.get_scan(range(6)) # scans 0..5
|
---|
| 1917 | g2 = q.get_scan(range(6,12)) # scans 6..11
|
---|
[770] | 1918 |
|
---|
[794] | 1919 | # Align data in velocity
|
---|
[966] | 1920 | g1.freq_align()
|
---|
| 1921 | g2.freq_align()
|
---|
[770] | 1922 |
|
---|
| 1923 | # Average individual scans
|
---|
| 1924 | a1 = g1.average_time()
|
---|
| 1925 | a2 = g2.average_time()
|
---|
| 1926 |
|
---|
[1011] | 1927 | # Rpfits file only contains a single rest frequency. Set both
|
---|
[966] | 1928 | a1.set_restfreqs([23694.4700e6,23722.6336e6])
|
---|
[770] | 1929 |
|
---|
[966] | 1930 | plotter.plot(a1)
|
---|
[1011] | 1931 | plotter.set_mode('i','t')
|
---|
[770] | 1932 |
|
---|
| 1933 | a1.auto_poly_baseline()
|
---|
| 1934 |
|
---|
| 1935 | plotter.plot()
|
---|
| 1936 |
|
---|
| 1937 | a1.smooth('gauss',5)
|
---|
| 1938 | plotter.plot()
|
---|
| 1939 |
|
---|
[966] | 1940 |
|
---|
[770] | 1941 | \end{verbatim}
|
---|
| 1942 |
|
---|
| 1943 | \newpage
|
---|
| 1944 |
|
---|
| 1945 | \section{Appendix}
|
---|
| 1946 |
|
---|
| 1947 | \subsection{Function Summary}
|
---|
| 1948 |
|
---|
[794] | 1949 | \index{Functions!summary}%
|
---|
[770] | 1950 | \begin{verbatim}
|
---|
[1217] | 1951 |
|
---|
[738] | 1952 | [The scan container]
|
---|
[534] | 1953 | scantable - a container for integrations/scans
|
---|
| 1954 | (can open asap/rpfits/sdfits and ms files)
|
---|
| 1955 | copy - returns a copy of a scan
|
---|
| 1956 | get_scan - gets a specific scan out of a scantable
|
---|
[1011] | 1957 | (by name or number)
|
---|
[1217] | 1958 | drop_scan - drops a specific scan out of a scantable
|
---|
| 1959 | (by number)
|
---|
[1011] | 1960 | set_selection - set a new subselection of the data
|
---|
| 1961 | get_selection - get the current selection object
|
---|
[534] | 1962 | summary - print info about the scantable contents
|
---|
| 1963 | stats - get specified statistic of the spectra in
|
---|
| 1964 | the scantable
|
---|
| 1965 | stddev - get the standard deviation of the spectra
|
---|
| 1966 | in the scantable
|
---|
| 1967 | get_tsys - get the TSys
|
---|
| 1968 | get_time - get the timestamps of the integrations
|
---|
[1011] | 1969 | get_sourcename - get the source names of the scans
|
---|
[794] | 1970 | get_azimuth - get the azimuth of the scans
|
---|
| 1971 | get_elevation - get the elevation of the scans
|
---|
| 1972 | get_parangle - get the parallactic angle of the scans
|
---|
[1011] | 1973 | get_unit - get the current unit
|
---|
[534] | 1974 | set_unit - set the abcissa unit to be used from this
|
---|
| 1975 | point on
|
---|
| 1976 | get_abcissa - get the abcissa values and name for a given
|
---|
| 1977 | row (time)
|
---|
| 1978 | set_freqframe - set the frame info for the Spectral Axis
|
---|
| 1979 | (e.g. 'LSRK')
|
---|
| 1980 | set_doppler - set the doppler to be used from this point on
|
---|
[1011] | 1981 | set_dirframe - set the frame for the direction on the sky
|
---|
[534] | 1982 | set_instrument - set the instrument name
|
---|
[1217] | 1983 | set_feedtype - set the feed type
|
---|
[534] | 1984 | get_fluxunit - get the brightness flux unit
|
---|
| 1985 | set_fluxunit - set the brightness flux unit
|
---|
| 1986 | create_mask - return an mask in the current unit
|
---|
| 1987 | for the given region. The specified regions
|
---|
| 1988 | are NOT masked
|
---|
| 1989 | get_restfreqs - get the current list of rest frequencies
|
---|
| 1990 | set_restfreqs - set a list of rest frequencies
|
---|
[1217] | 1991 | flag - flag selected channels in the data
|
---|
| 1992 | lag_flag - flag specified frequency in the data
|
---|
| 1993 | save - save the scantable to disk as either 'ASAP',
|
---|
| 1994 | 'SDFITS' or 'ASCII'
|
---|
[534] | 1995 | nbeam,nif,nchan,npol - the number of beams/IFs/Pols/Chans
|
---|
[1011] | 1996 | nscan - the number of scans in the scantable
|
---|
| 1997 | nrow - te number of spectra in the scantable
|
---|
[534] | 1998 | history - print the history of the scantable
|
---|
[544] | 1999 | get_fit - get a fit which has been stored witnh the data
|
---|
[738] | 2000 | average_time - return the (weighted) time average of a scan
|
---|
[534] | 2001 | or a list of scans
|
---|
| 2002 | average_pol - average the polarisations together.
|
---|
[1217] | 2003 | average_beam - average the beams together.
|
---|
[1011] | 2004 | convert_pol - convert to a different polarisation type
|
---|
[738] | 2005 | auto_quotient - return the on/off quotient with
|
---|
[1217] | 2006 | automatic detection of the on/off scans (closest
|
---|
| 2007 | in time off is selected)
|
---|
| 2008 | mx_quotient - Form a quotient using MX data (off beams)
|
---|
| 2009 | scale, *, / - return a scan scaled by a given factor
|
---|
| 2010 | add, +, - - return a scan with given value added
|
---|
[534] | 2011 | bin - return a scan with binned channels
|
---|
| 2012 | resample - return a scan with resampled channels
|
---|
| 2013 | smooth - return the spectrally smoothed scan
|
---|
| 2014 | poly_baseline - fit a polynomial baseline to all Beams/IFs/Pols
|
---|
[738] | 2015 | auto_poly_baseline - automatically fit a polynomial baseline
|
---|
[794] | 2016 | recalc_azel - recalculate azimuth and elevation based on
|
---|
| 2017 | the pointing
|
---|
[534] | 2018 | gain_el - apply gain-elevation correction
|
---|
| 2019 | opacity - apply opacity correction
|
---|
| 2020 | convert_flux - convert to and from Jy and Kelvin brightness
|
---|
| 2021 | units
|
---|
| 2022 | freq_align - align spectra in frequency frame
|
---|
[1217] | 2023 | invert_phase - Invert the phase of the cross-correlation
|
---|
| 2024 | swap_linears - Swap XX and YY
|
---|
[534] | 2025 | rotate_xyphase - rotate XY phase of cross correlation
|
---|
| 2026 | rotate_linpolphase - rotate the phase of the complex
|
---|
| 2027 | polarization O=Q+iU correlation
|
---|
[1011] | 2028 | freq_switch - perform frequency switching on the data
|
---|
| 2029 | stats - Determine the specified statistic, e.g. 'min'
|
---|
| 2030 | 'max', 'rms' etc.
|
---|
| 2031 | stddev - Determine the standard deviation of the current
|
---|
| 2032 | beam/if/pol
|
---|
[1217] | 2033 | [Selection]
|
---|
| 2034 | selector - a selection object to set a subset of a scantable
|
---|
| 2035 | set_scans - set (a list of) scans by index
|
---|
| 2036 | set_cycles - set (a list of) cycles by index
|
---|
| 2037 | set_beams - set (a list of) beamss by index
|
---|
| 2038 | set_ifs - set (a list of) ifs by index
|
---|
| 2039 | set_polarisations - set (a list of) polarisations by name
|
---|
| 2040 | or by index
|
---|
| 2041 | set_names - set a selection by name (wildcards allowed)
|
---|
| 2042 | set_tsys - set a selection by tsys thresholds
|
---|
| 2043 | reset - unset all selections
|
---|
| 2044 | + - merge to selections
|
---|
[1011] | 2045 |
|
---|
[534] | 2046 | [Math] Mainly functions which operate on more than one scantable
|
---|
| 2047 |
|
---|
[738] | 2048 | average_time - return the (weighted) time average
|
---|
[534] | 2049 | of a list of scans
|
---|
| 2050 | quotient - return the on/off quotient
|
---|
[544] | 2051 | simple_math - simple mathematical operations on two scantables,
|
---|
| 2052 | 'add', 'sub', 'mul', 'div'
|
---|
[1217] | 2053 | quotient - build quotient of the given on and off scans
|
---|
| 2054 | (matched pairs and 1 off/n on are valid)
|
---|
| 2055 | merge - merge a list of scantables
|
---|
| 2056 |
|
---|
| 2057 | [Line Catalog]
|
---|
| 2058 | linecatalog - a linecatalog wrapper, taking an ASCII or
|
---|
| 2059 | internal format table
|
---|
| 2060 | summary - print a summary of the current selection
|
---|
| 2061 | set_name - select a subset by name pattern, e.g. '*OH*'
|
---|
| 2062 | set_strength_limits - select a subset by line strength limits
|
---|
| 2063 | set_frequency_limits - select a subset by frequency limits
|
---|
| 2064 | reset - unset all selections
|
---|
| 2065 | save - save the current subset to a table (internal
|
---|
| 2066 | format)
|
---|
| 2067 | get_row - get the name and frequency from a specific
|
---|
| 2068 | row in the table
|
---|
[534] | 2069 | [Fitting]
|
---|
| 2070 | fitter
|
---|
| 2071 | auto_fit - return a scan where the function is
|
---|
| 2072 | applied to all Beams/IFs/Pols.
|
---|
| 2073 | commit - return a new scan where the fits have been
|
---|
| 2074 | commited.
|
---|
| 2075 | fit - execute the actual fitting process
|
---|
[1011] | 2076 | store_fit - store the fit parameters in the data (scantable)
|
---|
[534] | 2077 | get_chi2 - get the Chi^2
|
---|
| 2078 | set_scan - set the scantable to be fit
|
---|
| 2079 | set_function - set the fitting function
|
---|
| 2080 | set_parameters - set the parameters for the function(s), and
|
---|
| 2081 | set if they should be held fixed during fitting
|
---|
[544] | 2082 | set_gauss_parameters - same as above but specialised for individual
|
---|
| 2083 | gaussian components
|
---|
[534] | 2084 | get_parameters - get the fitted parameters
|
---|
| 2085 | plot - plot the resulting fit and/or components and
|
---|
| 2086 | residual
|
---|
| 2087 | [Plotter]
|
---|
| 2088 | asapplotter - a plotter for asap, default plotter is
|
---|
| 2089 | called 'plotter'
|
---|
[1011] | 2090 | plot - plot a scantable
|
---|
[1217] | 2091 | plot_lines - plot a linecatalog overlay
|
---|
[534] | 2092 | save - save the plot to a file ('png' ,'ps' or 'eps')
|
---|
| 2093 | set_mode - set the state of the plotter, i.e.
|
---|
| 2094 | what is to be plotted 'colour stacked'
|
---|
| 2095 | and what 'panelled'
|
---|
[1011] | 2096 | set_selection - only plot a selected part of the data
|
---|
| 2097 | set_range - set a 'zoom' window [xmin,xmax,ymin,ymax]
|
---|
[534] | 2098 | set_legend - specify user labels for the legend indeces
|
---|
| 2099 | set_title - specify user labels for the panel indeces
|
---|
[1011] | 2100 | set_abcissa - specify a user label for the abcissa
|
---|
[534] | 2101 | set_ordinate - specify a user label for the ordinate
|
---|
| 2102 | set_layout - specify the multi-panel layout (rows,cols)
|
---|
[1011] | 2103 | set_colors - specify a set of colours to use
|
---|
| 2104 | set_linestyles - specify a set of linestyles to use if only
|
---|
| 2105 | using one color
|
---|
[1217] | 2106 | set_font - set general font properties, e.g. 'family'
|
---|
| 2107 | set_histogram - plot in historam style
|
---|
[1011] | 2108 | set_mask - set a plotting mask for a specific polarization
|
---|
[1217] | 2109 | text - draw text annotations either in data or relative
|
---|
| 2110 | coordinates
|
---|
| 2111 | arrow - draw arrow annotations either in data or relative
|
---|
| 2112 | coordinates
|
---|
| 2113 | set_abcissa - specify a user label for the abcissa
|
---|
| 2114 | set_ordinate - specify a user label for the ordinate
|
---|
| 2115 | set_layout - specify the multi-panel layout (rows,cols)
|
---|
| 2116 | set_colors - specify a set of colours to use
|
---|
| 2117 | set_linestyles - specify a set of linestyles to use if only
|
---|
| 2118 | using one color
|
---|
| 2119 | set_font - set general font properties, e.g. 'family'
|
---|
| 2120 | set_histogram - plot in historam style
|
---|
| 2121 | set_mask - set a plotting mask for a specific polarization
|
---|
| 2122 | text - draw text annotations either in data or relative
|
---|
| 2123 | coordinates
|
---|
| 2124 | arrow - draw arrow annotations either in data or relative
|
---|
| 2125 | coordinates
|
---|
| 2126 | axhline,axvline - draw horizontal/vertical lines
|
---|
| 2127 | axhspan,axvspan - draw horizontal/vertical regions
|
---|
[738] | 2128 |
|
---|
[1217] | 2129 | xyplotter - matplotlib/pylab plotting functions
|
---|
| 2130 |
|
---|
[534] | 2131 | [Reading files]
|
---|
| 2132 | reader - access rpfits/sdfits files
|
---|
[1011] | 2133 | open - attach reader to a file
|
---|
| 2134 | close - detach reader from file
|
---|
[534] | 2135 | read - read in integrations
|
---|
| 2136 | summary - list info about all integrations
|
---|
| 2137 |
|
---|
| 2138 | [General]
|
---|
| 2139 | commands - this command
|
---|
| 2140 | print - print details about a variable
|
---|
| 2141 | list_scans - list all scantables created bt the user
|
---|
[1011] | 2142 | list_files - list all files readable by asap (default rpf)
|
---|
[534] | 2143 | del - delete the given variable from memory
|
---|
| 2144 | range - create a list of values, e.g.
|
---|
| 2145 | range(3) = [0,1,2], range(2,5) = [2,3,4]
|
---|
| 2146 | help - print help for one of the listed functions
|
---|
[538] | 2147 | execfile - execute an asap script, e.g. execfile('myscript')
|
---|
[544] | 2148 | list_rcparameters - print out a list of possible values to be
|
---|
[1217] | 2149 | put into .asaprc
|
---|
| 2150 | rc - set rc parameters from within asap
|
---|
[534] | 2151 | mask_and,mask_or,
|
---|
| 2152 | mask_not - boolean operations on masks created with
|
---|
| 2153 | scantable.create_mask
|
---|
| 2154 | \end{verbatim}
|
---|
| 2155 |
|
---|
| 2156 | \subsection{ASCII output format}
|
---|
| 2157 |
|
---|
| 2158 | \subsection{.asaprc settings}
|
---|
[794] | 2159 | \index{.asaprc}
|
---|
[971] | 2160 | \asaprc{verbose}{{\bf True}/False}{Print verbose output, good to disable in scripts}
|
---|
[770] | 2161 |
|
---|
| 2162 | \asaprc{insitu}{{\bf True}/False}{Apply operations on the input
|
---|
| 2163 | scantable or return new one}
|
---|
| 2164 |
|
---|
| 2165 | \asaprc{useplotter}{{\bf True}/False}{Preload a default plotter}
|
---|
| 2166 |
|
---|
| 2167 | \asaprc{plotter.gui}{{\bf True}/False}{Do we want a GUI or plot to a
|
---|
| 2168 | file}
|
---|
| 2169 |
|
---|
| 2170 | \asaprc{plotter.stacking}{{\bf Pol} Beam IF Scan Time}{Default mode for
|
---|
| 2171 | colour stacking}
|
---|
| 2172 |
|
---|
| 2173 | \asaprc{plotter.panelling}{Pol Beam IF {\bf Scan} Time}{Default mode
|
---|
| 2174 | for panelling}
|
---|
| 2175 |
|
---|
| 2176 | \asaprc{plotter.ganged}{{\bf True}/False}{Push panels together, to
|
---|
| 2177 | share axislabels}
|
---|
| 2178 |
|
---|
| 2179 | \asaprc{plotter.decimate}{True/{\bf False}}{Decimate the number of
|
---|
| 2180 | points plotted by a factor of nchan/1024}
|
---|
| 2181 |
|
---|
[1217] | 2182 | \asaprc{plotter.histogram}{True/{\bf False}}{Plot spectrum using
|
---|
| 2183 | histogram rather than lines.}
|
---|
[770] | 2184 |
|
---|
[1217] | 2185 | {\em MALTE TO FIX}
|
---|
| 2186 |
|
---|
| 2187 | \asaprc{plotter.colours}{}{Set default colours for plotting}
|
---|
| 2188 |
|
---|
| 2189 | \asaprc{plotter.colours}{}{Set default line styles}
|
---|
| 2190 |
|
---|
| 2191 | \asaprc{plotter.papersze}{{\bf A4}}{}
|
---|
| 2192 |
|
---|
[770] | 2193 | % scantable
|
---|
| 2194 | \asaprc{scantable.save}{{\bf ASAP} SDFITS FITS ASCII MS2}{Default output
|
---|
[794] | 2195 | format when saving}
|
---|
[770] | 2196 |
|
---|
| 2197 | \asaprc{scantable.autoaverage}{{\bf True}/False}{Auto averaging on
|
---|
| 2198 | read}
|
---|
| 2199 |
|
---|
| 2200 | \asaprc{scantable.freqframe}{{\bf LSRK} TOPO BARY etc}{default
|
---|
| 2201 | frequency frame to set when function scantable.set\_freqframe is
|
---|
[971] | 2202 | called or the data is imported}
|
---|
[770] | 2203 |
|
---|
[1217] | 2204 | \asaprc{scantable.verbosesummary}{True/{\bf False}}{Control the level
|
---|
| 2205 | of information printed by summary}
|
---|
| 2206 |
|
---|
| 2207 | \asaprc{scantable.storage}{{\bf memory}/disk}{Storage of scantables in
|
---|
| 2208 | memory of via based disk tables}
|
---|
| 2209 |
|
---|
[953] | 2210 | \subsection{Installation}
|
---|
| 2211 |
|
---|
| 2212 | \index{Installation}ASAP depends on a number of third-party libraries which you must
|
---|
| 2213 | have installed before attempting to build ASAP. These are:
|
---|
| 2214 |
|
---|
| 2215 | \begin{itemize}
|
---|
| 2216 | \item AIPS++
|
---|
| 2217 | \item Boost
|
---|
| 2218 | \item Matplotlib
|
---|
| 2219 | \item python/ipython
|
---|
| 2220 | \end{itemize}
|
---|
| 2221 |
|
---|
| 2222 | Debian Linux is currently supported and we intend also
|
---|
| 2223 | to support other popular Linux flavours, Solaris and Mac.
|
---|
| 2224 |
|
---|
| 2225 | Of the dependencies, AIPS++ is the most complex to install.
|
---|
| 2226 |
|
---|
[794] | 2227 | \printindex
|
---|
| 2228 |
|
---|
[534] | 2229 | \end{document}
|
---|
[770] | 2230 |
|
---|