- Timestamp:
- 12/09/05 13:24:44 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Release12/doc/cookbook.tex
r774 r790 3 3 \usepackage{calc} 4 4 \usepackage[dvips]{graphicx} 5 \usepackage{makeidx} 5 6 6 7 % Adjust the page size … … 22 23 \begin{minipage}[t]{\textwidth-75mm}#3\end{minipage} 23 24 } 25 26 \makeindex 27 24 28 25 29 \begin{document} … … 50 54 \end{itemize} 51 55 52 To start asap log onto one of these Linux hosts and enter56 \index{Running}To start asap log onto one of these Linux hosts and enter 53 57 54 58 \begin{verbatim} … … 62 66 \section{Interface} 63 67 64 ASAP is written in C++ and python. The user interface uses the68 \index{Interface}ASAP is written in C++ and python. The user interface uses the 65 69 ``ipython'' interactive shell, which is a simple interactive interface 66 70 to python. The user does not need to understand python to use this, … … 75 79 76 80 \subsection{Objects} 77 81 \index{objects} 78 82 The ASAP interface is based around a number of ``objects'' which the 79 83 user deals with. Objects range from the data which have been read from … … 98 102 \subsection{Member Functions (functions)} 99 103 100 Following the object oriented approach, objects have associated 101 ``member functions'' which can either be used to modify the data in 102 some way or change global properties of the object. In this document 103 member functions will be referred to simply as functions. From the 104 command line, the user can execute these functions using the syntax: 104 \index{Functions!member}Following the object oriented approach, 105 objects have associated ``member functions'' which can either be used 106 to modify the data in some way or change global properties of the 107 object. In this document member functions will be referred to simply 108 as functions. From the command line, the user can execute these 109 functions using the syntax: 105 110 \begin{verbatim} 106 111 ASAP> out = object.function(arguments) … … 126 131 \subsection{Global Functions} 127 132 128 It does not make sense to implement some functions as member133 \index{Functions!global}It does not make sense to implement some functions as member 129 134 functions, typically functions which operate on more than one 130 135 scantable (e.g. time averaging of many scans). These functions will … … 133 138 \subsection{Interactive environment} 134 139 135 ipython has a number of useful interactive features and a few things 136 to be aware of for the new user.140 \index{ipython!environment}ipython has a number of useful interactive 141 features and a few things to be aware of for the new user. 137 142 138 143 \subsubsection{String completion} 139 144 140 Tab completion is enabled for all function names. If you type the 141 first few letters of a function name, then type {\tt <TAB>} the 142 function name will be auto completed if it is un-ambiguous, or a list 143 of possibilities will be given. Auto-completion works for the user 144 object names as well as function names. It does not work for 145 filenames, nor for function arguments. 145 \index{ipython!string completion}Tab completion is enabled for all 146 function names. If you type the first few letters of a function name, 147 then type {\tt <TAB>} the function name will be auto completed if it 148 is un-ambiguous, or a list of possibilities will be 149 given. Auto-completion works for the user object names as well as 150 function names. It does not work for filenames, nor for function 151 arguments. 146 152 147 153 Example … … 158 164 \subsubsection{Leading Spaces} 159 165 160 Python uses leading space to mark blocks of code. This means that it 161 you start a command line with a space, the command generally will 162 fail with an syntax error.166 \index{ipython!leading space}Python uses leading space to mark blocks 167 of code. This means that it you start a command line with a space, the 168 command generally will fail with an syntax error. 163 169 164 170 \subsubsection{Variable Names} 165 171 166 During normal data processing, the user will have to create named 167 variables to hold spectra etc. These must conform to the normal python 168 syntax, specifically they cannot contain ``special'' characters such 169 as \@ \$ etc and cannot start with a number (but can contain numbers). 170 Variable (and function) names are case sensitive. 172 \index{ipython!variable names}During normal data processing, the user 173 will have to create named variables to hold spectra etc. These must 174 conform to the normal python syntax, specifically they cannot contain 175 ``special'' characters such as \@ \$ etc and cannot start with a 176 number (but can contain numbers). Variable (and function) names are 177 case sensitive. 171 178 172 179 \subsubsection{Unix Interaction} 173 180 174 Basic unix shell commands (\cmd{pwd}, \cmd{ls}, \cmd{cd} etc) can be 175 issued from within ASAP. This allows the user to do things like look 176 at files in the current directory. The shell command ``\cmd{cd}'' 177 works within ASAP, allowing the user to change between data 178 directories. Unix programs cannot be run this way, but the shell 179 escape ``$!$'' can be used to run arbitrary programs. E.g. 181 \index{ipython!unix interaction}Basic unix shell commands (\cmd{pwd}, 182 \cmd{ls}, \cmd{cd} etc) can be issued from within ASAP. This allows 183 the user to do things like look at files in the current directory. The 184 shell command ``\cmd{cd}'' works within ASAP, allowing the user to 185 change between data directories. Unix programs cannot be run this way, 186 but the shell escape ``$!$'' can be used to run arbitrary 187 programs. E.g. 180 188 181 189 \begin{verbatim} … … 187 195 \subsection{Help} 188 196 189 ASAP has built in help for all functions. To get a list of functions type: 197 \index{Help}ASAP has built in help for all functions. To get a list of 198 functions type: 190 199 191 200 \begin{verbatim} … … 218 227 \subsection{Customisation - .asaprc} 219 228 220 ASAP use an \cmd{.asaprc} file to control the user's preference of 221 default values for various functions arguments. This includes the 222 defaults for arguments such as \cmd{insitu}, scantable \cmd{freqframe} 223 and the plotters \cmd{set\_mode} values. The help on individual 224 functions says which arguments can be set default values from the 225 \cmd{.asaprc} file. To get a sample contents for the \cmd{.asaprc} 226 file use then command \cmd{list\_rcparameters}.229 \index{.asaprc}ASAP use an \cmd{.asaprc} file to control the user's 230 preference of default values for various functions arguments. This 231 includes the defaults for arguments such as \cmd{insitu}, scantable 232 \cmd{freqframe} and the plotters \cmd{set\_mode} values. The help on 233 individual functions says which arguments can be set default values 234 from the \cmd{.asaprc} file. To get a sample contents for the 235 \cmd{.asaprc} file use then command \cmd{list\_rcparameters}. 227 236 228 237 Common values include: … … 245 254 246 255 \section{Scantables} 247 256 \index{Scantables} 248 257 \subsection {Description} 249 258 250 259 \subsubsection {Basic Structure} 251 260 252 ASAP data handling works on objects called scantables. A scantable 253 holds your data, and also provides functions to operate 254 upon it.261 \index{Scantable!structure}ASAP data handling works on objects called 262 scantables. A scantable holds your data, and also provides functions 263 to operate upon it. 255 264 256 265 The building block of a scantable is an integration, which is a single … … 274 283 \subsubsection {Contents} 275 284 276 A scantable has header information and data (a scantable is actually an AIPS++ 277 Table and it is stored in Memory when you are manipulating it with ASAP. 278 You can store it to disk and then browse it with the AIPS++ 279 Table browser if you know how to do that !). 285 \index{Scantable!contents}A scantable has header information and data 286 (a scantable is actually an AIPS++ Table and it is stored in Memory 287 when you are manipulating it with ASAP. You can store it to disk and 288 then browse it with the AIPS++ Table browser if you know how to do 289 that !). 280 290 281 291 The data are stored in columns (the length of a column is the number of … … 297 307 \subsection{Management} 298 308 299 During processing it is possible to create a large number of scan 300 tables. These all consume memory, so it is best to periodically remove 301 unneeded scan tables. Use \cmd{list\_scans} to print a list of all 302 scantables and \cmd{del} to remove unneeded ones.309 \index{Scantable!management}During processing it is possible to create 310 a large number of scan tables. These all consume memory, so it is best 311 to periodically remove unneeded scan tables. Use \cmd{list\_scans} to 312 print a list of all scantables and \cmd{del} to remove unneeded ones. 303 313 304 314 Example: … … 350 360 \subsection{State} 351 361 352 Each scantable contains "state"; these are properties applying to all 353 of the data in the scantable.362 \index{Scantable!state}Each scantable contains "state"; these are 363 properties applying to all of the data in the scantable. 354 364 355 365 Examples are the selection of beam, IF and polarisation, spectral unit … … 391 401 \subsubsection{Rest Frequency} 392 402 393 ASAP reads the line rest frequency from the RPFITS file when reading 394 the data. The values stored in the RPFITS file are not always correct 395 and so there is a function \cmd{set\_restfreq} to set the rest frequencies. 403 \index{Scantable!rest frequency}ASAP reads the line rest frequency 404 from the RPFITS file when reading the data. The values stored in the 405 RPFITS file are not always correct and so there is a function 406 \cmd{set\_restfreq} to set the rest frequencies. 396 407 397 408 For each integration, there is a rest-frequency per IF (the rest … … 437 448 \subsection{Data Selection} 438 449 439 Data selection is currently fairly limited. This will be improved in 440 the future.450 \index{Scantable!data selection}Data selection is currently fairly limited. This 451 will be improved in the future. 441 452 442 453 443 454 \subsubsection{Cursor} 444 455 445 Generally the user will want to run functions on all rows in a 446 scantable. This allows very fast reduction of data. There are situations 447 when functions should only operate on specific elements of the spectra. This 448 is handled by the scantable cursor, which allows the user to select a 449 single beam, IF and polarisation combination. 456 \index{Scantable!cursor}Generally the user will want to run functions 457 on all rows in a scantable. This allows very fast reduction of 458 data. There are situations when functions should only operate on 459 specific elements of the spectra. This is handled by the scantable 460 cursor, which allows the user to select a single beam, IF and 461 polarisation combination. 450 462 451 463 Example : … … 458 470 \subsubsection{Row number} 459 471 460 Most functions work on all rows of a scan table. Exceptions are the 461 fitter and plotter. If you wish to only operate on a selected set of 462 scantable rows, use the \cmd{get\_scan} function to copy the rows into 463 a new scantable.472 \index{Scantable!row selection}Most functions work on all rows of a 473 scan table. Exceptions are the fitter and plotter. If you wish to only 474 operate on a selected set of scantable rows, use the \cmd{get\_scan} 475 function to copy the rows into a new scantable. 464 476 465 477 \subsubsection{Allaxes} 466 478 467 Many functions have an \cmd{allaxes} option which controls whether the 468 function will operate on all elements within a scantable row, or just 469 those selected with the current cursor. The default is taken from the 470 users {\tt .asaprc} file. 479 \index{allaxes}\index{Scantable!allaxes}Many functions have an 480 \cmd{allaxes} option which controls whether the function will operate 481 on all elements within a scantable row, or just those selected with 482 the current cursor. The default is taken from the users {\tt .asaprc} 483 file. 471 484 472 485 \subsubsection{Masks} 473 486 474 Many tasks (fitting, baseline subtraction, statistics etc) should only 475 be run on range of channels. Depending on the current ``unit'' setting 476 this range is set directly as channels, velocity or frequency 477 ranges. Internally these are converted into a simple boolean mask for 478 each channel of the abscissa. This means that if the unit setting is 479 later changed, previously created mask are still valid. (This is not 480 true for functions which change the shape or shift the frequency axis). 481 You create masks with the function \cmd{create\_mask} and this specified 487 \index{Masks}\index{Scantable!masks}Many tasks (fitting, baseline 488 subtraction, statistics etc) should only be run on range of 489 channels. Depending on the current ``unit'' setting this range is set 490 directly as channels, velocity or frequency ranges. Internally these 491 are converted into a simple boolean mask for each channel of the 492 abscissa. This means that if the unit setting is later changed, 493 previously created mask are still valid. (This is not true for 494 functions which change the shape or shift the frequency axis). You 495 create masks with the function \cmd{create\_mask} and this specified 482 496 the channels to be included in the selection. 483 497 … … 535 549 \section{Data Input} 536 550 537 Data can be loaded in one of two ways; using the reader object or via551 \index{Reading data}Data can be loaded in one of two ways; using the reader object or via 538 552 the scantable constructor. The scantable method is simpler but the 539 553 reader allow the user more control on what is read. … … 541 555 \subsection{Scantable constructor} 542 556 543 This loads all of the data from filename into the scantable object scans 544 and averages all the data within a scan (i.e. the resulting scantable 557 \index{Scantable constructor}\index{Scantable!constructor}This loads 558 all of the data from filename into the scantable object scans and 559 averages all the data within a scan (i.e. the resulting scantable 545 560 will have one row per scan). The recognised input file formats are 546 561 RPFITS, SDFITS (singledish fits), ASAP's scantable format and aips++ 547 562 MeasurementSet2 format. 548 563 549 550 564 Example usage: 551 565 … … 560 574 \subsection{Reader object} 561 575 562 For more control when reading data into ASAP, the reader object should 563 be used. This has the option of only reading in a range of integrations 564 and does not perform any scan averaging of the data, allowing analysis 565 of the individual integrations. Note that due to limitation of the 566 RPFITS library, only one reader object can be open at one time reading 567 RPFITS files. To read multiple RPFITS files, the old reader must be 568 destroyed before the new file is opened. However, multiple readers can 569 be created and attached to SDFITS files. 576 \index{Reader object}\index{Scantable!reader object}For more control 577 when reading data into ASAP, the reader object should be used. This 578 has the option of only reading in a range of integrations and does not 579 perform any scan averaging of the data, allowing analysis of the 580 individual integrations. Note that due to limitation of the RPFITS 581 library, only one reader object can be open at one time reading RPFITS 582 files. To read multiple RPFITS files, the old reader must be 583 destroyed before the new file is opened. However, multiple readers 584 can be created and attached to SDFITS files. 570 585 571 586 … … 591 606 %How and when? 592 607 \subsection{Auto quotient} 593 Quotients can be computed ``automatically''. This requires the data to 594 have matching source/reference pairs or one reference for multiple595 sources. Auto quotient assumes reference scans have a trailing ``\_R'' 596 in the source name for data from Parkes and Mopra, and a trailing 597 ``e'' or ``w'' for data fro, Tidbinbilla.608 \index{Auto quotient}Quotients can be computed ``automatically''. This 609 requires the data to have matching source/reference pairs or one 610 reference for multiple sources. Auto quotient assumes reference scans 611 have a trailing ``\_R'' in the source name for data from Parkes and 612 Mopra, and a trailing ``e'' or ``w'' for data fro, Tidbinbilla. 598 613 599 614 \begin{verbatim} … … 605 620 \subsection{Separate reference and source observations} 606 621 607 Most data from ATNF observatories distinguishes on and off source data 608 using the file name. This makes it easy to create two scantables with 609 the source and reference data. As long as there was exactly one610 reference observation for each on source observation for following 611 method will work.622 \index{Quotient spectra}Most data from ATNF observatories 623 distinguishes on and off source data using the file name. This makes 624 it easy to create two scantables with the source and reference 625 data. As long as there was exactly one reference observation for each 626 on source observation for following method will work. 612 627 613 628 For Mopra and Parkes data: … … 644 659 \subsection{Time average separate scans} 645 660 646 If you have observed the source with multiple source/reference cycles you 647 will want to scan-average the quotient spectra together. 661 \index{Time average}If you have observed the source with multiple 662 source/reference cycles you will want to scan-average the quotient 663 spectra together. 648 664 649 665 \begin{verbatim} … … 673 689 \end{verbatim} 674 690 691 Note that, if needed, you should run \cmd{freq\_align}, \cmd{gain\_el} 692 and \cmd{opacity} before you average the data in time (\S 693 \ref{sec:gainel} \& \ref{sec:freqalign}). 694 675 695 \subsection{Baseline fitting} 676 696 677 To make a baseline fit, you must first create a mask of channels to 678 use in the baseline fit.697 \index{Baseline fitting}To make a baseline fit, you must first create 698 a mask of channels to use in the baseline fit. 679 699 680 700 \begin{verbatim} … … 688 708 \subsubsection{Auto-baselining} 689 709 690 The function \cmd{auto\_poly\_baseline} can be used to automatically710 \index{Auto-baseline}The function \cmd{auto\_poly\_baseline} can be used to automatically 691 711 baseline your data without having to specify channel ranges for the 692 712 line free data. It automatically figures out the line-free emission … … 724 744 \subsection{Average the polarisations} 725 745 726 If you are just interested in the highest SNR for total intensity you746 \index{average\_pol}If you are just interested in the highest SNR for total intensity you 727 747 will want to average the parallel polarisations together. 728 748 … … 733 753 \subsection{Calibration} 734 754 735 For most uses, calibration happens transparently as the input data755 \index{Calibration}For most uses, calibration happens transparently as the input data 736 756 contains the Tsys measurements taken during observations. The nominal 737 757 ``Tsys'' values may be in Kelvin or Jansky. The user may wish to … … 741 761 \subsubsection{Brightness Units} 742 762 743 RPFITS files do not contain any information as to whether the telescope 744 calibration was in units of Kelvin or Janskys. On reading the data a 745 default value is set depending on the telescope and frequency of 746 observation. If this default is incorrect (you can see it in the 747 listing from the \cmd{summary} function) the user can either override 748 this value on reading the data or later. E.g: 763 \index{Brightness Units}RPFITS files do not contain any information as 764 to whether the telescope calibration was in units of Kelvin or 765 Janskys. On reading the data a default value is set depending on the 766 telescope and frequency of observation. If this default is incorrect 767 (you can see it in the listing from the \cmd{summary} function) the 768 user can either override this value on reading the data or later. 769 E.g: 749 770 750 771 \begin{verbatim} … … 757 778 \subsubsection{Tsys scaling} 758 779 759 Sometime the nominal Tsys measurement at the telescope is wrong due to 760 an incorrect noise diode calibration. This can easily be corrected for 761 with the scale function. By default, \cmd{scale} only scans the 762 spectra and not the corresponding Tsys.780 \index{Tsys scaling}Sometime the nominal Tsys measurement at the 781 telescope is wrong due to an incorrect noise diode calibration. This 782 can easily be corrected for with the scale function. By default, 783 \cmd{scale} only scans the spectra and not the corresponding Tsys. 763 784 764 785 \begin{verbatim} … … 768 789 \subsubsection{Unit Conversion} 769 790 770 To convert measurements in Kelvin to Jy (and vice versa) the global 771 function \cmd{convert\_flux} is needed. This converts and scales the data 772 from K to Jy or vice-versa depending on what the current brightness unit is 773 set to. The function knows the basic parameters for some frequencies 774 and telescopes, but the user may need to supply the aperture 775 efficiency, telescope diameter or the Jy/K factor. 791 \index{Unit conversion}To convert measurements in Kelvin to Jy (and 792 vice versa) the global function \cmd{convert\_flux} is needed. This 793 converts and scales the data from K to Jy or vice-versa depending on 794 what the current brightness unit is set to. The function knows the 795 basic parameters for some frequencies and telescopes, but the user may 796 need to supply the aperture efficiency, telescope diameter or the Jy/K 797 factor. 776 798 777 799 \begin{verbatim} … … 783 805 784 806 \subsubsection{Gain-Elevation and Opacity Corrections} 785 786 As higher frequencies (particularly $>$20~GHz) it is important to make 787 corrections for atmospheric opacity and gain-elevation effects. 807 \label{sec:gainel} 808 809 \index{Gain-elevation}As higher frequencies (particularly $>$20~GHz) 810 it is important to make corrections for atmospheric opacity and 811 gain-elevation effects. 788 812 789 813 Note that currently the elevation is not written correctly into … … 795 819 \end{verbatim} 796 820 797 798 821 Gain-elevation curves for some telescopes and frequencies are known to 799 ASAP (currently only for Tidbinbilla at 20~GHz). In these cases making800 gain-corrections is simple. If the gain curve for your data is not 801 known, the user can supply either a gain polynomial or text file822 ASAP (currently only for Tidbinbilla at 20~GHz). In these cases 823 making gain-corrections is simple. If the gain curve for your data is 824 not known, the user can supply either a gain polynomial or text file 802 825 tabulating gain factors at a range of elevations (see \cmd{help 803 826 scantable.gain\_el}). … … 810 833 \end{verbatim} 811 834 812 Opacity corrections can be made with the global function 813 \cmd{opacity}. This should work on all telescopes as long as a 814 measurement of the opacity factor was made during the observation.835 \index{Opacity}Opacity corrections can be made with the global 836 function \cmd{opacity}. This should work on all telescopes as long as 837 a measurement of the opacity factor was made during the observation. 815 838 816 839 \begin{verbatim} … … 823 846 824 847 \subsection{Frequency Frame Alignment} 825 826 When time averaging a series of scans together, it is possible that 827 the velocity scales are not exactly aligned. This may be for many 828 reasons such as not Doppler tracking the observations, errors in the 829 Doppler tracking etc. This mostly affects very long integrations or 830 integrations averaged together from different days. Before averaging 831 such data together, they should be frequency aligned using 832 \cmd{freq\_align}. 848 \label{sec:freqalign} 849 850 \index{Frequency alignment}\index{Velicity alignment}When time 851 averaging a series of scans together, it is possible that the velocity 852 scales are not exactly aligned. This may be for many reasons such as 853 not Doppler tracking the observations, errors in the Doppler tracking 854 etc. This mostly affects very long integrations or integrations 855 averaged together from different days. Before averaging such data 856 together, they should be frequency aligned using \cmd{freq\_align}. 833 857 834 858 E.g.: … … 868 892 \section{Scantable manipulation} 869 893 870 While it is very useful to have many independent sources within one 871 scantable, it is often inconvenient for data processing. The 872 \cmd{get\_scan} function can be used to create a new scantable with a 873 selection of scans from a scantable. The selection can either be on 874 the source name, with simple wildcard matching or set of scan ids. 894 \index{Scantable!manipulation}While it is very useful to have many 895 independent sources within one scantable, it is often inconvenient for 896 data processing. The \cmd{get\_scan} function can be used to create a 897 new scantable with a selection of scans from a scantable. The 898 selection can either be on the source name, with simple wildcard 899 matching or set of scan ids. 875 900 876 901 For example: … … 908 933 \section{Data Output} 909 934 910 ASAP can save scantables in a variety of formats, suitable for reading 911 into other packages. The formats are: 935 \index{Scantable!save}\index{Saving data}ASAP can save scantables in a 936 variety of formats, suitable for reading into other packages. The 937 formats are: 912 938 913 939 \begin{itemize} … … 950 976 \section{Plotter} 951 977 952 Scantable spectra can be plotted at any time. An asapplotter object is978 \index{Plotter}Scantable spectra can be plotted at any time. An asapplotter object is 953 979 used for plotting, meaning multiple plot windows can be active at the 954 980 same time. On start up a default asapplotter object is created called … … 993 1019 \label{sec:plotter_cursor} 994 1020 995 The plotter can plot up to 25 panels and stacked spectra per 996 panel. If you have data larger than this (or for your own sanity) you 997 need to select a subset of this data. This is particularly true for 998 multibeam or multi IF data. The plotter \cmd{set\_cursor} function is 999 used to select a subset of the data. The arguments \cmd{row}, 1000 \cmd{beam} and \cmd{IF} all accept a vector of indices corresponding 1001 to row, beam or IF selection. Only the selected data will be plotted. 1002 To select on polarisation, see section~\ref{sec:polplot}. 1021 \index{Plotter!selection}The plotter can plot up to 25 panels and 1022 stacked spectra per panel. If you have data larger than this (or for 1023 your own sanity) you need to select a subset of this data. This is 1024 particularly true for multibeam or multi IF data. The plotter 1025 \cmd{set\_cursor} function is used to select a subset of the data. The 1026 arguments \cmd{row}, \cmd{beam} and \cmd{IF} all accept a vector of 1027 indices corresponding to row, beam or IF selection. Only the selected 1028 data will be plotted. To select on polarisation, see 1029 section~\ref{sec:polplot}. 1003 1030 1004 1031 Examples: … … 1023 1050 \subsection{Plot Control} 1024 1051 1025 The plotter window has a row of buttons on the lower left. These can 1026 be used to control the plotter (mostly for zooming the individual 1027 plots). From left to right:1052 \index{Plotter!control}The plotter window has a row of buttons on the 1053 lower left. These can be used to control the plotter (mostly for 1054 zooming the individual plots). From left to right: 1028 1055 1029 1056 \begin{itemize} … … 1047 1074 \item[Save] (floppy disk). Save the plot as a postscript or .png file 1048 1075 1076 You can also type ``g'' in the plot window to toggle on and off grid 1077 lines. Typing 'l' turns on and off logarithmic Y-axis. 1078 1049 1079 \end{itemize} 1050 1080 … … 1079 1109 \section{Fitting} 1080 1110 1081 Currently multicomponent Gaussian function is available. This is done 1082 by creating a fitting object, setting up the fit and actually fitting 1083 the data. Fitting can either be done on a single scantable row/cursor 1084 selection or on an entire scantable using the \cmd{auto\_fit} function. 1111 \index{Fitting}Currently multicomponent Gaussian function is 1112 available. This is done by creating a fitting object, setting up the 1113 fit and actually fitting the data. Fitting can either be done on a 1114 single scantable row/cursor selection or on an entire scantable using 1115 the \cmd{auto\_fit} function. 1085 1116 1086 1117 \begin{verbatim} … … 1147 1178 \subsection{Fit saving} 1148 1179 1149 One you are happy with your fit, it is possible to store it as part of 1150 the scantable.1180 \index{Fitter!Fit saving}One you are happy with your fit, it is 1181 possible to store it as part of the scantable. 1151 1182 1152 1183 \begin{verbatim} … … 1168 1199 \section{Polarisation} 1169 1200 1170 Currently ASAP only supports polarmetric analysis on linearly 1171 polarised feeds and the cross polarisation products measured. Other 1172 cases will be added on an as needed basic.1201 \index{Polarisation}Currently ASAP only supports polarmetric analysis 1202 on linearly polarised feeds and the cross polarisation products 1203 measured. Other cases will be added on an as needed basic. 1173 1204 1174 1205 Conversions of linears to Stokes or Circular polarisations are done … … 1184 1215 for transparent polarimetric calibration.} 1185 1216 1186 It is possible that there is a phase offset between polarisation which 1187 will effect the phase of the cross polarisation correlation, and so give 1188 rise to spurious polarisation. \cmd{rotate\_xyphase} can be used to 1189 correct for this error. At this point, the user must know how to 1190 determine the size of the phase offset themselves. 1217 \index{Polarisation!calibration}It is possible that there is a phase 1218 offset between polarisation which will effect the phase of the cross 1219 polarisation correlation, and so give rise to spurious 1220 polarisation. \cmd{rotate\_xyphase} can be used to correct for this 1221 error. At this point, the user must know how to determine the size of 1222 the phase offset themselves. 1191 1223 1192 1224 \begin{verbatim} … … 1213 1245 \label{sec:polplot} 1214 1246 1215 To plot Stokes values, the plotter \cmd{set\_cursor} function should 1216 be called first using the \cmd{pol} argument. The values which can be 1217 plotted include a selection of [I,Q,U,V], [I, Plinear, Pangle, V], 1218 [RR, LL] or [XX, YY, Real(XY), Imaginary(XY)]. (Plinear and Pangle are 1219 the percentage and position angle of linear polarisation). Conversion 1220 to circular polarisations are currently not available. 1247 \index{Polarisation!plotting}To plot Stokes values, the plotter 1248 \cmd{set\_cursor} function should be called first using the \cmd{pol} 1249 argument. The values which can be plotted include a selection of 1250 [I,Q,U,V], [I, Plinear, Pangle, V], [RR, LL] or [XX, YY, Real(XY), 1251 Imaginary(XY)]. (Plinear and Pangle are the percentage and position 1252 angle of linear polarisation). Conversion to circular polarisations 1253 are currently not available. 1221 1254 1222 1255 Example: … … 1234 1267 \subsection{Saving} 1235 1268 1236 When saving data using the \cmd{save} function, the \cmd{stokes}1237 argument can be used to save the data as Stoke values when saving in 1238 FITS format.1269 \index{Polarisation!saving}When saving data using the \cmd{save} 1270 function, the \cmd{stokes} argument can be used to save the data as 1271 Stoke values when saving in FITS format. 1239 1272 1240 1273 Example: … … 1247 1280 \section{Scantable Mathematics} 1248 1281 1249 It is possible to to simple mathematics directly on scantables from 1250 the command line using the \cmd{+, -, *, /} operators as well as their 1251 cousins \cmd{+=, -= *=, /=}. This works between two scantables or a 1252 scantable and a float. (Note that it does not work for integers). 1282 \index{Scantable!maths}It is possible to to simple mathematics 1283 directly on scantables from the command line using the \cmd{+, -, *, 1284 /} operators as well as their cousins \cmd{+=, -= *=, /=}. This works 1285 between two scantables or a scantable and a float. (Note that it does 1286 not work for integers). 1253 1287 1254 1288 \begin{verbatim} … … 1260 1294 \section{Scripting} 1261 1295 1262 Because asap is based on python, it easy for the user write their own 1263 scripts and functions to process data. This is highly recommended as 1264 most processing of user data could then be done in a couple of steps 1265 using a few simple user defined functions. A Python primer is beyond 1266 the scope of this userguide. See the asap home pages for a scripting 1267 tutorial or the main python website for comprehensive documentation. 1296 \index{Scripting}Because asap is based on python, it easy for the user 1297 write their own scripts and functions to process data. This is highly 1298 recommended as most processing of user data could then be done in a 1299 couple of steps using a few simple user defined functions. A Python 1300 primer is beyond the scope of this userguide. See the asap home pages 1301 for a scripting tutorial or the main python website for comprehensive 1302 documentation. 1268 1303 1269 1304 \hspace{1cm} http://www.atnf.csiro.au/computing/software/asap/tutorials … … 1290 1325 1291 1326 \subsection{Mopra} 1327 \index{Mopra} 1328 1329 The following example is of some dual polarisation, position switched 1330 data from Mopra. The source has been observed mulitple times split 1331 into a number of seperate rpfits files. To make the processing easier, 1332 the first step is to \cmd{cat} the seeprate rpfits files together and 1333 load as a whole (future versions of asap will make this unnecessary). 1334 1335 1336 \begin{verbatim} 1337 # Concatenate the individual rpfits files together before loading 1338 !cat 2005-06*.rpf > data.rpf 1339 1340 # Load the data into a scantable 1341 data = scantable('data.rpf') 1342 print data 1343 1344 # Form the quotient spectra 1345 q = data.auto_quotient() 1346 print q 1347 1348 # Look at the spectra 1349 plotter.plot(q) 1350 1351 # Velocity align the data before averaging 1352 q.set_unit('km/s') 1353 q.set_freqframe('LSRK') 1354 q.freq_align() 1355 1356 # Average all scans in time 1357 av = q.average_time() 1358 plotter.plot(av) 1359 1360 # Remove the baseline 1361 msk = av.create_mask([100,130],[160,200]) 1362 av.poly_baseline(msk,2) 1363 1364 # Average the two polarisations together 1365 iav = av.average_pol() 1366 print iav 1367 plotter.plot(iav) 1368 1369 # Set a sensible velocity range on the plot 1370 plotter.set_range(85,200) 1371 1372 # Smooth the data a little 1373 av.smooth('gauss',4) 1374 plotter.plot() 1375 1376 # Fit a guassian to the emission 1377 f = fitter() 1378 f.set_function(gauss=1) 1379 f.set_scan(av) 1380 f.fit() 1381 1382 # View the fit 1383 f.plot() 1384 1385 # Get the fit parameters 1386 f.get_parameters() 1387 1388 \end{verbatim} 1389 1292 1390 1293 1391 \subsection{Parkes Polarimetry} 1294 1392 1295 The following example is processing of some Parkes polarmetric 1296 observations of OH masers at 1.6~GHz. Because digital filters where 1297 used in the backend, the baselines are stable enough not to require a 1298 quotient spectra. The 4~MHz bandwidth is wide enough to observe both 1299 the 1665 and 1667~MHz OH maser transitions. Each source was observed 1300 once for about 10 minutes. Tsys information was not written to the 1301 rpfits file (a nominal 25K values was used), so the amplitudes need 1302 to be adjusted based on a separate log file. A simple user function is 1303 used to simplify this, contained in a file called mypol.py: 1393 \index{Parkes}\index{Polarisation}The following example is processing 1394 of some Parkes polarmetric observations of OH masers at 1395 1.6~GHz. Because digital filters where used in the backend, the 1396 baselines are stable enough not to require a quotient spectra. The 1397 4~MHz bandwidth is wide enough to observe both the 1665 and 1667~MHz 1398 OH maser transitions. Each source was observed once for about 10 1399 minutes. Tsys information was not written to the rpfits file (a 1400 nominal 25K values was used), so the amplitudes need to be adjusted 1401 based on a separate log file. A simple user function is used to 1402 simplify this, contained in a file called mypol.py: 1304 1403 1305 1404 \begin{verbatim} … … 1388 1487 \subsection{Tidbinbilla} 1389 1488 1390 The following example is processing of some Tidbinbilla observations 1391 of NH$_3$ at 12~mm. Tidbinbilla has (at the time of observations) a 1392 single polarisation, but can process two IFs simultaneously. In the 1393 example, the first half of the observation was observing the (1,1) and 1394 (2,2) transitions simultaneously). The second half observed only the 1395 (4,4) transition due to bandwidth limitations. The data is position 1396 switched, observing first an reference to the west, then the source 1397 twice and finally reference to the east. 1489 \index{Tidbinbilla}The following example is processing of some 1490 Tidbinbilla observations of NH$_3$ at 12~mm. Tidbinbilla has (at the 1491 time of observations) a single polarisation, but can process two IFs 1492 simultaneously. In the example, the first half of the observation was 1493 observing the (1,1) and (2,2) transitions simultaneously). The second 1494 half observed only the (4,4) transition due to bandwidth 1495 limitations. The data is position switched, observing first an 1496 reference to the west, then the source twice and finally reference to 1497 the east. 1398 1498 1399 1499 \begin{verbatim} … … 1447 1547 \subsection{Function Summary} 1448 1548 1549 \index{Functions!summary}% 1449 1550 \begin{verbatim} 1450 1551 [The scan container] … … 1463 1564 get_tsys - get the TSys 1464 1565 get_time - get the timestamps of the integrations 1566 get_azimuth - get the azimuth of the scans 1567 get_elevation - get the elevation of the scans 1568 get_parangle - get the parallactic angle of the scans 1465 1569 get_unit - get the currnt unit 1466 1570 set_unit - set the abcissa unit to be used from this … … 1588 1692 \subsection{Installation} 1589 1693 1590 ASAP depends on a number of third-party libraries which you must1694 \index{Installation}ASAP depends on a number of third-party libraries which you must 1591 1695 have installed before attempting to build ASAP. These are: 1592 1696 … … 1606 1710 1607 1711 \subsection{.asaprc settings} 1608 1712 \index{.asaprc} 1609 1713 \asaprc{verbose}{{\bf True}/False}{Print verbose output} 1610 1714 … … 1654 1758 of information printed by summary} 1655 1759 1760 \printindex 1761 1656 1762 \end{document} 1657 1763
Note:
See TracChangeset
for help on using the changeset viewer.