- Timestamp:
- 12/09/05 14:50:59 (19 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/cookbook.tex
r770 r794 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 … … 153 159 scans.set_fluxunit scans.set_restfreqs scans.setif 154 160 ASAP> scans.set_in<TAB> 155 ASAP> scans.set_instrument 161 ASAP> scans.set_instrument() 156 162 \end{verbatim} 157 163 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: 190 191 \begin{verbatim} 192 ASAP> commands 197 \index{Help}ASAP has built in help for all functions. To get a list of 198 functions type: 199 200 \begin{verbatim} 201 ASAP> commands() 193 202 \end{verbatim} 194 203 … … 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: 305 315 306 316 \begin{verbatim} 307 ASAP> list_scans 317 ASAP> list_scans() 308 318 The user created scantables are: 309 319 ['s', 'scans', 'av', 's2', 'ss'] … … 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 … … 574 589 \begin{verbatim} 575 590 ASAP> r = reader('2003-03-16_082048_t0002.rpf') 576 ASAP> r.summary 591 ASAP> r.summary() 577 592 ASAP> scan = r.read() 578 593 ASAP> s = r.read(range(100)) # To read in the first 100 integrations … … 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. 776 777 \begin{verbatim} 778 ASAP> scans.convert_flux # If efficency known 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. 798 799 \begin{verbatim} 800 ASAP> scans.convert_flux() # If efficency known 779 801 ASAP> scans.convert_flux(eta=0.48) # If telescope diameter known 780 802 ASAP> scans.convert_flux(eta=0.48,d=35) # Unknown telescope … … 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. 788 789 {\em Note that currently the elevation is not written correctly into 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. 812 813 Note that currently the elevation is not written correctly into 790 814 Tidbinbilla rpfits files. This means that gain-elevation and opacity 791 corrections will not work until a work around is implemented.} 815 corrections will not work unless these get recalculated. 816 817 \begin{verbatim} 818 ASAP> scans.recalc_azel() # recalculate az/el based on pointing 819 \end{verbatim} 792 820 793 821 Gain-elevation curves for some telescopes and frequencies are known to 794 ASAP (currently only for Tidbinbilla at 20~GHz). In these cases making795 gain-corrections is simple. If the gain curve for your data is not 796 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 797 825 tabulating gain factors at a range of elevations (see \cmd{help 798 826 scantable.gain\_el}). … … 805 833 \end{verbatim} 806 834 807 Opacity corrections can be made with the global function 808 \cmd{opacity}. This should work on all telescopes as long as a 809 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. 810 838 811 839 \begin{verbatim} … … 818 846 819 847 \subsection{Frequency Frame Alignment} 820 821 When time averaging a series of scans together, it is possible that 822 the velocity scales are not exactly aligned. This may be for many 823 reasons such as not Doppler tracking the observations, errors in the 824 Doppler tracking etc. This mostly affects very long integrations or 825 integrations averaged together from different days. Before averaging 826 such data together, they should be frequency aligned using 827 \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}. 828 857 829 858 E.g.: … … 863 892 \section{Scantable manipulation} 864 893 865 While it is very useful to have many independent sources within one 866 scantable, it is often inconvenient for data processing. The 867 \cmd{get\_scan} function can be used to create a new scantable with a 868 selection of scans from a scantable. The selection can either be on 869 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. 870 900 871 901 For example: … … 898 928 899 929 \begin{verbatim} 900 ASAP> ss = scans.copy 930 ASAP> ss = scans.copy() 901 931 \end{verbatim} 902 932 903 933 \section{Data Output} 904 934 905 ASAP can save scantables in a variety of formats, suitable for reading 906 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: 907 938 908 939 \begin{itemize} … … 945 976 \section{Plotter} 946 977 947 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 948 979 used for plotting, meaning multiple plot windows can be active at the 949 980 same time. On start up a default asapplotter object is created called … … 988 1019 \label{sec:plotter_cursor} 989 1020 990 The plotter can plot up to 25 panels and stacked spectra per 991 panel. If you have data larger than this (or for your own sanity) you 992 need to select a subset of this data. This is particularly true for 993 multibeam or multi IF data. The plotter \cmd{set\_cursor} function is 994 used to select a subset of the data. The arguments \cmd{row}, 995 \cmd{beam} and \cmd{IF} all accept a vector of indices corresponding 996 to row, beam or IF selection. Only the selected data will be plotted. 997 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}. 998 1030 999 1031 Examples: … … 1018 1050 \subsection{Plot Control} 1019 1051 1020 The plotter window has a row of buttons on the lower left. These can 1021 be used to control the plotter (mostly for zooming the individual 1022 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: 1023 1055 1024 1056 \begin{itemize} … … 1042 1074 \item[Save] (floppy disk). Save the plot as a postscript or .png file 1043 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 1044 1079 \end{itemize} 1045 1080 … … 1074 1109 \section{Fitting} 1075 1110 1076 Currently multicomponent Gaussian function is available. This is done 1077 by creating a fitting object, setting up the fit and actually fitting 1078 the data. Fitting can either be done on a single scantable row/cursor 1079 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. 1080 1116 1081 1117 \begin{verbatim} … … 1142 1178 \subsection{Fit saving} 1143 1179 1144 One you are happy with your fit, it is possible to store it as part of 1145 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. 1146 1182 1147 1183 \begin{verbatim} … … 1163 1199 \section{Polarisation} 1164 1200 1165 Currently ASAP only supports polarmetric analysis on linearly 1166 polarised feeds and the cross polarisation products measured. Other 1167 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. 1168 1204 1169 1205 Conversions of linears to Stokes or Circular polarisations are done … … 1179 1215 for transparent polarimetric calibration.} 1180 1216 1181 It is possible that there is a phase offset between polarisation which 1182 will effect the phase of the cross polarisation correlation, and so give 1183 rise to spurious polarisation. \cmd{rotate\_xyphase} can be used to 1184 correct for this error. At this point, the user must know how to 1185 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. 1186 1223 1187 1224 \begin{verbatim} … … 1208 1245 \label{sec:polplot} 1209 1246 1210 To plot Stokes values, the plotter \cmd{set\_cursor} function should 1211 be called first using the \cmd{pol} argument. The values which can be 1212 plotted include a selection of [I,Q,U,V], [I, Plinear, Pangle, V], 1213 [RR, LL] or [XX, YY, Real(XY), Imaginary(XY)]. (Plinear and Pangle are 1214 the percentage and position angle of linear polarisation). Conversion 1215 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. 1216 1254 1217 1255 Example: … … 1229 1267 \subsection{Saving} 1230 1268 1231 When saving data using the \cmd{save} function, the \cmd{stokes}1232 argument can be used to save the data as Stoke values when saving in 1233 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. 1234 1272 1235 1273 Example: … … 1242 1280 \section{Scantable Mathematics} 1243 1281 1244 It is possible to to simple mathematics directly on scantables from 1245 the command line using the \cmd{+, -, *, /} operators as well as their 1246 cousins \cmd{+=, -= *=, /=}. This works between two scantables or a 1247 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). 1248 1287 1249 1288 \begin{verbatim} … … 1255 1294 \section{Scripting} 1256 1295 1257 Because asap is based on python, it easy for the user write their own 1258 scripts and functions to process data. This is highly recommended as 1259 most processing of user data could then be done in a couple of steps 1260 using a few simple user defined functions. A Python primer is beyond 1261 the scope of this userguide. See the asap home pages for a scripting 1262 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. 1263 1303 1264 1304 \hspace{1cm} http://www.atnf.csiro.au/computing/software/asap/tutorials … … 1282 1322 1283 1323 In the following section a few examples of end-to-end processing of 1284 some data in asap are given. 1324 some data in asap are given. 1285 1325 1286 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 1287 1390 1288 1391 \subsection{Parkes Polarimetry} 1289 1392 1290 The following example is processing of some Parkes polarmetric 1291 observations of OH masers at 1.6~GHz. Because digital filters where 1292 used in the backend, the baselines are stable enough not to require a 1293 quotient spectra. The 4~MHz bandwidth is wide enough to observe both 1294 the 1665 and 1667~MHz OH maser transitions. Each source was observed 1295 once for about 10 minutes. Tsys information was not written to the 1296 rpfits file (a nominal 25K values was used), so the amplitudes need 1297 to be adjusted based on a separate log file. A simple user function is 1298 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: 1299 1403 1300 1404 \begin{verbatim} … … 1317 1421 1318 1422 \begin{verbatim} 1319 1423 1320 1424 # Remind ourself the name of the rpfits files 1321 ls 1425 ls 1322 1426 1323 1427 # Load data from an rpfits file … … 1334 1438 d1665.rotate_xyphase(-4) 1335 1439 1336 # Create a copy of the data and set the rest frequency to the 1667 MHz 1440 # Create a copy of the data and set the rest frequency to the 1667 MHz 1337 1441 # transition 1338 1442 d1667 = d1665.copy() … … 1383 1487 \subsection{Tidbinbilla} 1384 1488 1385 The following example is processing of some Tidbinbilla observations 1386 of NH$_3$ at 12~mm. Tidbinbilla has (at the time of observations) a 1387 single polarisation, but can process two IFs simultaneously. In the 1388 example, the first half of the observation was observing the (1,1) and 1389 (2,2) transitions simultaneously). The second half observed only the 1390 (4,4) transition due to bandwidth limitations. The data is position 1391 switched, observing first an reference to the west, then the source 1392 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. 1393 1498 1394 1499 \begin{verbatim} … … 1410 1515 g2 = q.get_scan(range(6,12)) # Rows 6..11 1411 1516 1412 # Align data in velocity 1517 # Align data in velocity 1413 1518 g1.freq_align(perif=True) 1414 1519 g2.freq_align(perif=True) … … 1442 1547 \subsection{Function Summary} 1443 1548 1549 \index{Functions!summary}% 1444 1550 \begin{verbatim} 1445 1551 [The scan container] … … 1458 1564 get_tsys - get the TSys 1459 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 1460 1569 get_unit - get the currnt unit 1461 1570 set_unit - set the abcissa unit to be used from this … … 1497 1606 poly_baseline - fit a polynomial baseline to all Beams/IFs/Pols 1498 1607 auto_poly_baseline - automatically fit a polynomial baseline 1608 recalc_azel - recalculate azimuth and elevation based on 1609 the pointing 1499 1610 gain_el - apply gain-elevation correction 1500 1611 opacity - apply opacity correction … … 1581 1692 \subsection{Installation} 1582 1693 1583 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 1584 1695 have installed before attempting to build ASAP. These are: 1585 1696 … … 1599 1710 1600 1711 \subsection{.asaprc settings} 1601 1712 \index{.asaprc} 1602 1713 \asaprc{verbose}{{\bf True}/False}{Print verbose output} 1603 1714 … … 1630 1741 % scantable 1631 1742 \asaprc{scantable.save}{{\bf ASAP} SDFITS FITS ASCII MS2}{Default output 1632 format when saving} 1743 format when saving} 1633 1744 1634 1745 \asaprc{scantable.autoaverage}{{\bf True}/False}{Auto averaging on … … 1647 1758 of information printed by summary} 1648 1759 1760 \printindex 1761 1649 1762 \end{document} 1650 1763 -
trunk/doc/release-checklist.txt
r566 r794 9 9 2) installed docs by hand - no make targets yet 10 10 - cd doc 11 - latex cookbook.tex 12 - latex2html cookbook.tex 13 - dvipdf cookbook.tex 14 - cp -r cookbook /nfs/wwwatdocs/computing/software/asap 15 - manually edit index.html and add cookbook 11 - ln -s cookbook.tex userguide.tex 12 - latex userguide 13 - makeindex userguide.idx 14 - latex userguide 15 - latex2html -local_icons userguide.tex 16 - dvipdf userguide.dvi 17 - cp -r userguide /nfs/wwwatdocs/computing/software/asap 18 - manually edit index.html and add userguide 16 19 - add refman doc 17 20 - cd /usr/local/lib/python2.3/site-packages … … 21 24 22 25 3) cvs branching for release 23 - cvs -R tag Release -124 - cvs rtag -r Release -1 -b Release-1-fixes asap26 - cvs -R tag ReleaseNNN 27 - cvs rtag -r ReleaseNNN -b ReleaseNNN-fixes asap 25 28 26 29 4) Check that asap is rdisted (/nfs/DEBIANlocal) to the sites -
trunk/python/__init__.py
r780 r794 298 298 get_time - get the timestamps of the integrations 299 299 get_sourcename - get the source names of the scans 300 get_azimuth - get the azimuth of the scans 301 get_elevation - get the elevation of the scans 302 get_parangle - get the parallactic angle of the scans 300 303 get_unit - get the currnt unit 301 304 set_unit - set the abcissa unit to be used from this -
trunk/python/asapfitter.py
r723 r794 432 432 print_log() 433 433 434 def auto_fit(self, insitu=None ):434 def auto_fit(self, insitu=None, allaxes=True): 435 435 """ 436 436 Return a scan where the function is applied to all rows for … … 454 454 rows = range(scan.nrow()) 455 455 from asap import asaplog 456 for i in range(scan.nbeam()): 457 scan.setbeam(i) 458 for j in range(scan.nif()): 459 scan.setif(j) 460 for k in range(scan.npol()): 461 scan.setpol(k) 462 asaplog.push("Fitting:") 463 out = 'Beam[%d], IF[%d], Pol[%d]' % (i,j,k) 464 asaplog.push(out) 465 for iRow in rows: 466 self.x = scan._getabcissa(iRow) 467 self.y = scan._getspectrum(iRow) 468 self.data = None 469 self.fit() 470 x = self.get_parameters() 471 scan._setspectrum(self.fitter.getresidual(),iRow) 456 if allaxes: 457 for i in range(scan.nbeam()): 458 scan.setbeam(i) 459 for j in range(scan.nif()): 460 scan.setif(j) 461 for k in range(scan.npol()): 462 scan.setpol(k) 463 asaplog.push("Fitting:") 464 out = 'Beam[%d], IF[%d], Pol[%d]' % (i,j,k) 465 asaplog.push(out) 466 for iRow in rows: 467 self.x = scan._getabcissa(iRow) 468 self.y = scan._getspectrum(iRow) 469 self.data = None 470 self.fit() 471 x = self.get_parameters() 472 scan._setspectrum(self.fitter.getresidual(),iRow) 473 else: 474 asaplog.push("Fitting:") 475 out = 'Beam[%d], IF[%d], Pol[%d]' % sel 476 asaplog.push(out) 477 for iRow in rows: 478 self.x = scan._getabcissa(iRow) 479 self.y = scan._getspectrum(iRow) 480 self.data = None 481 self.fit() 482 x = self.get_parameters() 483 scan._setspectrum(self.fitter.getresidual(),iRow) 484 472 485 scan.set_cursor(sel[0],sel[1],sel[2]) 473 486 print_log() -
trunk/python/asapplotter.py
r762 r794 148 148 else: 149 149 self._plotter.set_panels() 150 allxlim=[] 150 151 rows = self._cursor["t"] 151 152 rows = rows[:n] … … 228 229 if self._minmaxx is not None: 229 230 xlim = self._minmaxx 230 self._plotter.axes.set_xlim(xlim) 231 allxlim += xlim 232 allxlim.sort() 233 self._plotter.axes.set_xlim([allxlim[0],allxlim[-1]]) 231 234 self._plotter.set_axes('xlabel',xlab) 232 235 self._plotter.set_axes('ylabel',ylab) 233 236 self._plotter.set_axes('title',tlab) 237 234 238 return 235 239 … … 269 273 colvals = eval(cdict2.get(colmode)) 270 274 rowsel = self._cursor["t"][0] 275 allxlim=[] 271 276 for j in colvals: 272 277 polmode = "raw" … … 331 336 if self._minmaxx is not None: 332 337 xlim = self._minmaxx 333 self._plotter.axes.set_xlim(xlim) 334 338 allxlim += xlim 339 allxlim.sort() 340 self._plotter.axes.set_xlim([allxlim[0],allxlim[-1]]) 335 341 self._plotter.set_axes('xlabel',xlab) 336 342 self._plotter.set_axes('ylabel',ylab) … … 377 383 eval(cdict.get(self._panelling)) 378 384 385 allxlim=[] 379 386 colvals = eval(cdict2.get(colmode)) 380 387 for j in colvals: … … 404 411 eval(cdict.get(colmode)) 405 412 i = savei 406 if self._panelling == "p":407 413 #if self._panelling == "p": 414 eval(cdict.get(self._panelling)) 408 415 x = None 409 416 y = None … … 470 477 if self._minmaxx is not None: 471 478 xlim = self._minmaxx 472 self._plotter.axes.set_xlim(xlim) 479 allxlim += xlim 480 allxlim.sort() 481 self._plotter.axes.set_xlim([allxlim[0],allxlim[-1]]) 473 482 474 483 self._plotter.set_axes('xlabel',xlab) -
trunk/python/scantable.py
r780 r794 226 226 raise IOError(msg) 227 227 if rcParams['verbose']: 228 print info 228 try: 229 from IPython.genutils import page as pager 230 except ImportError: 231 from pydoc import pager 232 pager(info) 229 233 else: 230 234 return info … … 429 433 def get_sourcename(self, row=-1): 430 434 """ 431 Get a list source anmes for the observations.435 Get a list source names for the observations. 432 436 Return a string for each integration in the scantable. 433 437 Parameters: … … 442 446 if 0 <= row < self.nrow(): 443 447 return self._getsourcename(row) 448 449 def get_elevation(self, row=-1): 450 """ 451 Get a list of elevations for the observations. 452 Return a float for each integration in the scantable. 453 Parameters: 454 row: row no of integration. Default -1 return all rows 455 Example: 456 none 457 """ 458 out = [] 459 if row == -1: 460 return [self._getelevation(i) for i in range(self.nrow())] 461 else: 462 if 0 <= row < self.nrow(): 463 return self._getelevation(row) 464 465 def get_azimuth(self, row=-1): 466 """ 467 Get a list of azimuths for the observations. 468 Return a float for each integration in the scantable. 469 Parameters: 470 row: row no of integration. Default -1 return all rows 471 Example: 472 none 473 """ 474 out = [] 475 if row == -1: 476 return [self._getazimuth(i) for i in range(self.nrow())] 477 else: 478 if 0 <= row < self.nrow(): 479 return self._getazimuth(row) 480 481 def get_parangle(self, row=-1): 482 """ 483 Get a list of parallactic angles for the observations. 484 Return a float for each integration in the scantable. 485 Parameters: 486 row: row no of integration. Default -1 return all rows 487 Example: 488 none 489 """ 490 out = [] 491 if row == -1: 492 return [self._getparangle(i) for i in range(self.nrow())] 493 else: 494 if 0 <= row < self.nrow(): 495 return self._getparangle(row) 444 496 445 497 def set_unit(self, unit='channel'): … … 717 769 def history(self): 718 770 hist = list(self._gethistory()) 719 print"-"*80771 out = "-"*80 720 772 for h in hist: 721 773 if h.startswith("---"): 722 printh774 out += "\n"+h 723 775 else: 724 776 items = h.split("##") … … 726 778 func = items[1] 727 779 items = items[2:] 728 print date729 print"Function: %s\n Parameters:" % (func)780 out += "\n"+date+"\n" 781 out += "Function: %s\n Parameters:" % (func) 730 782 for i in items: 731 783 s = i.split("=") 732 print " %s = %s" % (s[0],s[1]) 733 print "-"*80 784 out += "\n %s = %s" % (s[0],s[1]) 785 out += "\n"+"-"*80 786 try: 787 from IPython.genutils import page as pager 788 except ImportError: 789 from pydoc import pager 790 pager(out) 734 791 return 735 792 … … 1055 1112 return 1056 1113 1057 def poly_baseline(self, mask=None, order=0, insitu=None ):1114 def poly_baseline(self, mask=None, order=0, insitu=None, allaxes=None): 1058 1115 """ 1059 1116 Return a scan which has been baselined (all rows) by a polynomial. 1060 1117 Parameters: 1061 scan: a scantable 1062 mask: an optional mask 1063 order: the order of the polynomial (default is 0) 1064 insitu: if False a new scantable is returned. 1065 Otherwise, the scaling is done in-situ 1066 The default is taken from .asaprc (False) 1118 scan: a scantable 1119 mask: an optional mask 1120 order: the order of the polynomial (default is 0) 1121 insitu: if False a new scantable is returned. 1122 Otherwise, the scaling is done in-situ 1123 The default is taken from .asaprc (False) 1124 allaxes: If True (default) apply to all spectra. Otherwise 1125 apply only to the selected (beam/pol/if)spectra only 1126 The default is taken from .asaprc (True if none) 1067 1127 Example: 1068 1128 # return a scan baselined by a third order polynomial, … … 1070 1130 bscan = scan.poly_baseline(order=3) 1071 1131 """ 1132 if allaxes is None: allaxes = rcParams['scantable.allaxes'] 1072 1133 if insitu is None: insitu = rcParams['insitu'] 1073 1134 varlist = vars() … … 1079 1140 f.set_scan(self, mask) 1080 1141 f.set_function(poly=order) 1081 sf = f.auto_fit(insitu )1142 sf = f.auto_fit(insitu,allaxes) 1082 1143 if insitu: 1083 1144 self._add_history("poly_baseline", varlist) … … 1291 1352 refs = self.get_scan("*[_ewR]") 1292 1353 if isinstance(srcs,scantable) and isinstance(refs,scantable): 1354 from asap import asaplog 1293 1355 ns,nr = srcs.nrow(),refs.nrow() 1356 msg = "Found %i Off and %i On scans" % (ns,nr) 1357 asaplog.push(msg) 1294 1358 if nr > ns: 1359 asaplog("Found more Off integrations than On scans - dropping excess Offs.") 1295 1360 refs = refs.get_scan(range(ns)) 1296 1361 print_log() -
trunk/src/Makefile
r717 r794 1 1 TARGET := /tmp/_asap.so 2 3 4 # the casa environment AIPSPATH has to be defined 5 CASAROOT := $(word 1, $(AIPSPATH)) 6 CASAARCH := $(word 2, $(AIPSPATH)) 7 CASAINC := -I$(CASAROOT)/code/include -I$(CASAROOT)/code/casa 8 CASALIB := $(CASAROOT)/$(CASAARCH)/lib 9 10 11 # the compiler 2 12 ifndef CXX 3 13 CXX := g++ 4 14 endif 15 16 # compiler flags 5 17 CXXFLAGS := -O3 -fPIC 6 CXXFLAGS += -ansi 7 CXXFLAGS += -pedantic -Wno-long-long 18 CXXFLAGS += -ansi -pedantic -Wno-long-long 8 19 CXXOPTS := -DAIPS_NO_TEMPLATE_SRC 9 20 10 CFITSIOROOT := /usr/local If aips++ is build with LFS you need to have 21 # darwin specific flags 22 ifeq "$(CASAARCH)" "darwin" 23 CXXFLAGS := -O2 -DAIPS_DARWIN 24 CXXFLAGS += -ansi -pedantic -Wno-long-long -Wno-long-double 25 endif 26 27 28 # cfitsio 29 CFITSIOROOT := /usr/local 30 # If aips++ is build with LFS you need to have 11 31 # libcfitsio with lfs support 12 CFITSIO LIB := /usr/local/lib/libcfitsio_lfs.a13 #CFITSIOINC := -I$(CFITSIOROOT)/include/cfitsio 32 CFITSIOINC := -I$(CFITSIOROOT)/include 33 CFITSIOLIB := $(CFITSIOROOT)/lib/libcfitsio_lfs.a 14 34 #CFITSIOLIB := -L$(CFITSIOROOT) -lcfitsio 15 35 16 17 CASAROOT := $(word 1, $(AIPSPATH)) 18 CASAARCH := $(word 2, $(AIPSPATH)) 19 CASAINC := -I$(CASAROOT)/code/include -I$(CASAROOT)/code/casa/wcslib 20 CASALIB := $(CASAROOT)/$(CASAARCH)/lib 21 36 #rpfits 37 RPFITSROOT := /usr/local 38 RPFITSLIB := $(RPFITSROOT)/lib/librpfits.a 22 39 23 40 # This assumes all casa libs are static only (*.a) 24 41 # if not than there might by symbol resolution errors. 25 42 CASAPPLIB := $(CASALIB)/version.o \ 26 -L$(CASALIB) -static\43 -L$(CASALIB) \ 27 44 -latnf -limages -lms -lcomponents -lcoordinates \ 28 45 -llattices -lfits -lmeasures -lmeasures_f \ 29 46 -ltables -lscimath -lscimath_f -lcasa \ 30 47 $(CASALIB)/libwcs.a \ 31 -lrpfits $(CFITSIOLIB) -dy -llapack -lblas -lg2c48 $(RPFITSLIB) $(CFITSIOLIB) -lg2c -lstdc++ 32 49 50 # darwin specific CASA flags 51 ifeq "$(CASAARCH)" "darwin" 52 CASAPPLIB += -framework vecLib 53 else 54 CASAPPLIB += -llapack -lblas 55 endif 56 57 # the linker 33 58 LD := $(CXX) 59 34 60 LDFLAGS := -shared -Wl$(TARGET) -s 61 ifeq "$(CASAARCH)" "darwin" 62 LDFLAGS := -dynamiclib -single_module 63 endif 35 64 65 # python only 2.3 has been tested 36 66 PYVERSION := 2.3 37 67 PYTHONROOT := /usr … … 39 69 PYTHONLIB := -L$(PYTHONROOT)/lib -lpython$(PYVERSION) 40 70 41 71 # has to be build with same g++ version as casa 42 72 BOOSTROOT := /usr 43 73 BOOSTLIB := -L$(BOOSTROOT)/lib -lboost_python … … 45 75 46 76 77 # DO NOT MODIFY AFTER THIS 47 78 INCDIRS := -I. $(CASAINC) $(BOOSTINC) $(PYTHONINC) $(CFITSIOINC) 48 79 LIBS := $(PYTHONLIB) $(BOOSTLIB) $(CASAPPLIB) -
trunk/src/SDMemTable.cc
r780 r794 244 244 srcnCol_.get(whichRow, name); 245 245 return name; 246 } 247 248 float SDMemTable::getElevation(Int whichRow) const 249 { 250 float elevation; 251 elCol_.get(whichRow, elevation); 252 return elevation; 253 } 254 255 float SDMemTable::getAzimuth(Int whichRow) const 256 { 257 float azimuth; 258 azCol_.get(whichRow, azimuth); 259 return azimuth; 260 } 261 262 float SDMemTable::getParAngle(Int whichRow) const 263 { 264 float parangle; 265 paraCol_.get(whichRow, parangle); 266 return parangle; 246 267 } 247 268 -
trunk/src/SDMemTable.h
r777 r794 147 147 148 148 std::string getSourceName(casa::Int whichRow=0) const; 149 150 float getElevation(casa::Int whichRow=0) const; 151 float getAzimuth(casa::Int whichRow=0) const; 152 float getParAngle(casa::Int whichRow=0) const; 153 149 154 double getInterval(casa::Int whichRow=0) const; 150 155 -
trunk/src/SDMemTableWrapper.h
r777 r794 136 136 std::string getSourceName(int whichRow=0) { 137 137 return table_->getSourceName(whichRow); 138 } 139 140 float getElevation(int whichRow=0) { 141 return table_->getElevation(whichRow); 142 } 143 float getAzimuth(int whichRow=0) { 144 return table_->getAzimuth(whichRow); 145 } 146 float getParAngle(int whichRow=0) { 147 return table_->getParAngle(whichRow); 138 148 } 139 149 -
trunk/src/SDTemplates.cc
r701 r794 34 34 #include <casa/namespace.h> 35 35 #include <casa/Exceptions/Error.cc> 36 #include <casa/Exceptions/Error2.cc>36 //#include <casa/Exceptions/Error2.cc> 37 37 #include <casa/Utilities/CountedPtr.cc> 38 #include <casa/Utilities/CountedPtr2.cc>38 //#include <casa/Utilities/CountedPtr2.cc> 39 39 40 40 namespace asap { … … 53 53 #include <casa/Arrays/Array.cc> 54 54 #include <casa/Arrays/Vector.h> 55 #include <casa/Arrays/Vector2.cc>56 #include <casa/Arrays/Vector.cc>57 #include <casa/Utilities/PtrHolder.cc>58 55 #include <casa/Utilities/BinarySearch.cc> 59 56 #include <coordinates/Coordinates/FrequencyAligner.cc> 60 57 #include <lattices/Lattices/Lattice.h> 61 58 #include <lattices/Lattices/LatticeUtilities.cc> 62 #include <scimath/Functionals/CompiledFunction.cc>63 #include <scimath/Functionals/CompiledParam.cc>64 #include <scimath/Mathematics/AutoDiff.h>65 #include <scimath/Mathematics/AutoDiffMath.h>66 59 #include <scimath/Mathematics/InterpolateArray1D.cc> 67 60 #include <tables/Tables/BaseMappedArrayEngine.cc> … … 69 62 template void convertArray<Bool, uChar>(Array<Bool> &, Array<uChar> const &); 70 63 template void convertArray<uChar, Bool>(Array<uChar> &, Array<Bool> const &); 71 template LogicalArray operator!=<Float>(Array<Float> const &, Float const &); 72 template LogicalArray operator==<Float>(Array<Float> const &, Float const &); 73 template LogicalArray operator><Float>(Array<Float> const &, Float const &); 74 template LogicalArray operator>=<Float>(Array<Float> const &, Float const &); 64 75 65 template Array<Float>& operator/=<Float>(Array<Float>&, MaskedArray<Float> const&); 76 66 template MaskedArray<Float> const& operator*=<Float>(MaskedArray<Float> const&, Float const&); … … 90 80 template Float sumsquares<Float>(MaskedArray<Float> const&); 91 81 template Float avdev<Float>(MaskedArray<Float> const&); 92 template class CompiledFunction<AutoDiff<Float> >;93 template class CompiledParam<AutoDiff<Float> >;94 82 95 template class Vector<Vector<Int> >;96 template class Vector<Vector<Bool> >;97 template class Vector<Vector<String> >;98 template Vector<Bool>::Vector(const vector<bool> &);99 template Vector<Int>::Vector(const vector<int> &);100 template Vector<Float>::Vector(const vector<float> &);101 template Vector<Double>::Vector(const vector<double> &);102 template void Array<float>::tovector(vector<float> &) const;103 template void Array<Bool>::tovector(vector<bool> &) const;104 template void Array<Double>::tovector(vector<double> &) const;105 template void Array<Int>::tovector(vector<int> &) const;106 template void Array<std::complex<float> >::reference(const Array<std::complex<float> >&);107 83 template void LatticeUtilities::bin(MaskedArray<float>&, MaskedArray<float> const&, uInt, uInt); 108 template class PtrHolder<Lattice<Float> >; 84 109 85 template class FrequencyAligner<Float>; 110 template class InterpolateArray1D<Double, Float>; 111 template Int binarySearchBrackets<Vector<Double>,Double>(Bool &, Vector<Double> const &, Double const &, uInt, Int); 86 112 87 template class BaseMappedArrayEngine<Float, Float>; 113 88 -
trunk/src/python_SDMemTable.cc
r777 r794 93 93 .def("_getsourcename", &SDMemTableWrapper::getSourceName, 94 94 (boost::python::arg("whichRow")=0) ) 95 .def("_getelevation", &SDMemTableWrapper::getElevation, 96 (boost::python::arg("whichRow")=0) ) 97 .def("_getazimuth", &SDMemTableWrapper::getAzimuth, 98 (boost::python::arg("whichRow")=0) ) 99 .def("_getparangle", &SDMemTableWrapper::getParAngle, 100 (boost::python::arg("whichRow")=0) ) 95 101 .def("_gettime", &SDMemTableWrapper::getTime, 96 102 (boost::python::arg("whichRow")=0) ) -
trunk/test/tid.py
r752 r794 21 21 q.set_freqframe('LSRK') 22 22 23 # Align frequencies - Tid doppler tracks, so this isn't really necessary23 # Align frequencies 24 24 25 25 q.freq_align(perif=True) 26 q.set_unit('km/s') 26 27 # Recalculate the az/el 28 29 q.recalc_azel() 30 31 # Correct for gain curve and opacity 32 q.gain_el() 33 q.opacity(0.075) 27 34 28 35 # Average in time 29 36 av = average_time(q) 37 38 # Baseline 39 msk=av.create_mask([-70,-50],[40,60]) 40 av.poly_baseline(msk,1) 41 42 plotter.set_mode('i') 43 plotter.plot(av) 44 plotter.save('output/tid.png') 30 45 31 46 # Do some random processing, just to test these functions … … 34 49 av.add(0.05) 35 50 36 # Baseline37 msk=av.create_mask([-70,-50],[40,60])38 av.poly_baseline(msk,1)39 40 plotter.plot(av)41 plotter.set_mode('i')42 plotter.save('output/tid.png')43 44 # These are currently broken as Tid does not set the elevation correctly45 av.gain_el()46 av.opacity(0.075)47 48 51 print "Tid test finished successfully" -
trunk/web/commands.html
r762 r794 61 61 get_time - get the timestamps of the integrations 62 62 get_sourcename - get the source names of the scans 63 get_azimuth - get the azimuth of the scans 64 get_elevation - get the elevation of the scans 65 get_parangle - get the parallactic angle of the scans 63 66 get_unit - get the currnt unit 64 67 set_unit - set the abcissa unit to be used from this … … 103 106 poly_baseline - fit a polynomial baseline to all Beams/IFs/Pols 104 107 auto_poly_baseline - automatically fit a polynomial baseline 108 recalc_azel - recalculate azimuth and elevation based on 109 the pointing 105 110 gain_el - apply gain-elevation correction 106 111 opacity - apply opacity correction -
trunk/web/index.html
r770 r794 47 47 48 48 <h2>Current Release</h2> 49 ASAP latest stable version 1.2 was released on November, 30<sup>th</sup> 2005. It can be obtained in the <a href="#download">Download</a> section.49 ASAP latest stable version 1.2.1 was released on December, 6<sup>th</sup> 2005. It can be obtained in the <a href="#download">Download</a> section. 50 50 51 51 <h2>Screenshots</h2> … … 56 56 <pre style="color: blue"> 57 57 Loading ASAP... 58 Welcome to ASAP v1.2 (2005/11/24) - the ATNF Spectral Analysis Package58 Welcome to ASAP v1.2.1 (2005/12/06) - the ATNF Spectral Analysis Package 59 59 60 60 Please report any bugs to:
Note:
See TracChangeset
for help on using the changeset viewer.