Changeset 794 for trunk


Ignore:
Timestamp:
12/09/05 14:50:59 (19 years ago)
Author:
mar637
Message:

update from Release12

Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/cookbook.tex

    r770 r794  
    33\usepackage{calc}
    44\usepackage[dvips]{graphicx}
     5\usepackage{makeidx}
    56
    67% Adjust the page size
     
    2223  \begin{minipage}[t]{\textwidth-75mm}#3\end{minipage}
    2324}
     25
     26\makeindex
     27
    2428
    2529\begin{document}
     
    5054\end{itemize}
    5155
    52 To start asap log onto one of these Linux hosts and enter
     56\index{Running}To start asap log onto one of these Linux hosts and enter
    5357
    5458\begin{verbatim}
     
    6266\section{Interface}
    6367
    64 ASAP is written in C++ and python. The user interface uses the
     68\index{Interface}ASAP is written in C++ and python. The user interface uses the
    6569``ipython'' interactive shell, which is a simple interactive interface
    6670to python. The user does not need to understand python to use this,
     
    7579
    7680\subsection{Objects}
    77 
     81\index{objects}
    7882The ASAP interface is based around a number of ``objects'' which the
    7983user deals with. Objects range from the data which have been read from
     
    98102\subsection{Member Functions (functions)}
    99103
    100 Following the object oriented approach, objects have associated
    101 ``member functions'' which can either be used to modify the data in
    102 some way or change global properties of the object. In this document
    103 member functions will be referred to simply as functions. From the
    104 command line, the user can execute these functions using the syntax:
     104\index{Functions!member}Following the object oriented approach,
     105objects have associated ``member functions'' which can either be used
     106to modify the data in some way or change global properties of the
     107object. In this document member functions will be referred to simply
     108as functions. From the command line, the user can execute these
     109functions using the syntax:
    105110\begin{verbatim}
    106111  ASAP> out = object.function(arguments)
     
    126131\subsection{Global Functions}
    127132
    128 It does not make sense to implement some functions as member
     133\index{Functions!global}It does not make sense to implement some functions as member
    129134functions, typically functions which operate on more than one
    130135scantable (e.g. time averaging of many scans). These functions will
     
    133138\subsection{Interactive environment}
    134139
    135 ipython has a number of useful interactive features and a few things
    136 to be aware of for the new user.
     140\index{ipython!environment}ipython has a number of useful interactive
     141features and a few things to be aware of for the new user.
    137142
    138143\subsubsection{String completion}
    139144
    140 Tab completion is enabled for all function names. If you type the
    141 first few letters of a function name, then type {\tt <TAB>} the
    142 function name will be auto completed if it is un-ambiguous, or a list
    143 of possibilities will be given. Auto-completion works for the user
    144 object names as well as function names. It does not work for
    145 filenames, nor for function arguments.
     145\index{ipython!string completion}Tab completion is enabled for all
     146function names. If you type the first few letters of a function name,
     147then type {\tt <TAB>} the function name will be auto completed if it
     148is un-ambiguous, or a list of possibilities will be
     149given. Auto-completion works for the user object names as well as
     150function names. It does not work for filenames, nor for function
     151arguments.
    146152
    147153Example
     
    153159scans.set_fluxunit    scans.set_restfreqs   scans.setif
    154160  ASAP> scans.set_in<TAB>
    155   ASAP> scans.set_instrument
     161  ASAP> scans.set_instrument()
    156162\end{verbatim}
    157163
    158164\subsubsection{Leading Spaces}
    159165
    160 Python uses leading space to mark blocks of code. This means that it
    161 you start a command line with a space, the command generally will
    162 fail with an syntax error.
     166\index{ipython!leading space}Python uses leading space to mark blocks
     167of code. This means that it you start a command line with a space, the
     168command generally will fail with an syntax error.
    163169
    164170\subsubsection{Variable Names}
    165171
    166 During normal data processing, the user will have to create named
    167 variables to hold spectra etc. These must conform to the normal python
    168 syntax, specifically they cannot contain ``special'' characters such
    169 as \@ \$ etc and cannot start with a number (but can contain numbers).
    170 Variable (and function) names are case sensitive.
     172\index{ipython!variable names}During normal data processing, the user
     173will have to create named variables to hold spectra etc. These must
     174conform to the normal python syntax, specifically they cannot contain
     175``special'' characters such as \@ \$ etc and cannot start with a
     176number (but can contain numbers).  Variable (and function) names are
     177case sensitive.
    171178
    172179\subsubsection{Unix Interaction}
    173180
    174 Basic unix shell commands (\cmd{pwd}, \cmd{ls}, \cmd{cd} etc) can be
    175 issued from within ASAP. This allows the user to do things like look
    176 at files in the current directory. The shell command ``\cmd{cd}''
    177 works within ASAP, allowing the user to change between data
    178 directories. Unix programs cannot be run this way, but the shell
    179 escape ``$!$'' can be used to run arbitrary programs. E.g.
     181\index{ipython!unix interaction}Basic unix shell commands (\cmd{pwd},
     182\cmd{ls}, \cmd{cd} etc) can be issued from within ASAP. This allows
     183the user to do things like look at files in the current directory. The
     184shell command ``\cmd{cd}'' works within ASAP, allowing the user to
     185change between data directories. Unix programs cannot be run this way,
     186but the shell escape ``$!$'' can be used to run arbitrary
     187programs. E.g.
    180188
    181189\begin{verbatim}
     
    187195\subsection{Help}
    188196
    189 ASAP has built in help for all functions. To get a list of functions type:
    190 
    191 \begin{verbatim}
    192   ASAP> commands
     197\index{Help}ASAP has built in help for all functions. To get a list of
     198functions type:
     199
     200\begin{verbatim}
     201  ASAP> commands()
    193202\end{verbatim}
    194203
     
    218227\subsection{Customisation - .asaprc}
    219228
    220 ASAP use an \cmd{.asaprc} file to control the user's preference of
    221 default values for various functions arguments. This includes the
    222 defaults for arguments such as \cmd{insitu}, scantable \cmd{freqframe}
    223 and the plotters \cmd{set\_mode} values. The help on individual
    224 functions says which arguments can be set default values from the
    225 \cmd{.asaprc} file. To get a sample contents for the \cmd{.asaprc}
    226 file use then command \cmd{list\_rcparameters}.
     229\index{.asaprc}ASAP use an \cmd{.asaprc} file to control the user's
     230preference of default values for various functions arguments. This
     231includes the defaults for arguments such as \cmd{insitu}, scantable
     232\cmd{freqframe} and the plotters \cmd{set\_mode} values. The help on
     233individual functions says which arguments can be set default values
     234from the \cmd{.asaprc} file. To get a sample contents for the
     235\cmd{.asaprc} file use then command \cmd{list\_rcparameters}.
    227236
    228237Common values include:
     
    245254
    246255\section{Scantables}
    247 
     256\index{Scantables}
    248257\subsection {Description}
    249258
    250259\subsubsection {Basic Structure}
    251260
    252 ASAP data handling works on objects called scantables.  A scantable
    253 holds your data, and also provides functions to operate
    254 upon it.
     261\index{Scantable!structure}ASAP data handling works on objects called
     262scantables.  A scantable holds your data, and also provides functions
     263to operate upon it.
    255264
    256265The building block of a scantable is an integration, which is a single
     
    274283\subsubsection {Contents}
    275284
    276 A scantable has header information and data (a scantable is actually an AIPS++
    277 Table and it is stored in Memory when you are manipulating it with ASAP.
    278 You can store it to disk and then browse it with the AIPS++
    279 Table browser if you know how to do that !).
     285\index{Scantable!contents}A scantable has header information and data
     286(a scantable is actually an AIPS++ Table and it is stored in Memory
     287when you are manipulating it with ASAP.  You can store it to disk and
     288then browse it with the AIPS++ Table browser if you know how to do
     289that !).
    280290
    281291The data are stored in columns (the length of a column is the number of
     
    297307\subsection{Management}
    298308
    299 During processing it is possible to create a large number of scan
    300 tables. These all consume memory, so it is best to periodically remove
    301 unneeded scan tables. Use \cmd{list\_scans} to print a list of all
    302 scantables and \cmd{del} to remove unneeded ones.
     309\index{Scantable!management}During processing it is possible to create
     310a large number of scan tables. These all consume memory, so it is best
     311to periodically remove unneeded scan tables. Use \cmd{list\_scans} to
     312print a list of all scantables and \cmd{del} to remove unneeded ones.
    303313
    304314Example:
    305315
    306316\begin{verbatim}
    307   ASAP> list_scans
     317  ASAP> list_scans()
    308318  The user created scantables are:
    309319  ['s', 'scans', 'av', 's2', 'ss']
     
    350360\subsection{State}
    351361
    352 Each scantable contains "state"; these are properties  applying to all
    353 of the data in the scantable.
     362\index{Scantable!state}Each scantable contains "state"; these are
     363properties applying to all of the data in the scantable.
    354364
    355365Examples are the selection of beam, IF and polarisation,  spectral unit
     
    391401\subsubsection{Rest Frequency}
    392402
    393 ASAP reads the line rest frequency from the RPFITS file when reading
    394 the data. The values stored in the RPFITS file are not always correct
    395 and so there is a function \cmd{set\_restfreq} to set the rest frequencies.
     403\index{Scantable!rest frequency}ASAP reads the line rest frequency
     404from the RPFITS file when reading the data. The values stored in the
     405RPFITS file are not always correct and so there is a function
     406\cmd{set\_restfreq} to set the rest frequencies.
    396407
    397408For each integration, there is a rest-frequency per IF (the rest
     
    437448\subsection{Data Selection}
    438449
    439 Data selection is currently fairly limited. This will be improved in
    440 the future.
     450\index{Scantable!data selection}Data selection is currently fairly limited. This
     451will be improved in the future.
    441452
    442453
    443454\subsubsection{Cursor}
    444455
    445 Generally the user will want to run functions on all rows in a
    446 scantable. This allows very fast reduction of data. There are situations
    447 when functions should only operate on specific elements of the spectra. This
    448 is handled by the scantable cursor, which allows the user to select a
    449 single beam, IF and polarisation combination.
     456\index{Scantable!cursor}Generally the user will want to run functions
     457on all rows in a scantable. This allows very fast reduction of
     458data. There are situations when functions should only operate on
     459specific elements of the spectra. This is handled by the scantable
     460cursor, which allows the user to select a single beam, IF and
     461polarisation combination.
    450462
    451463Example :
     
    458470\subsubsection{Row number}
    459471
    460 Most functions work on all rows of a scan table. Exceptions are the
    461 fitter and plotter. If you wish to only operate on a selected set of
    462 scantable rows, use the \cmd{get\_scan} function to copy the rows into
    463 a new scantable.
     472\index{Scantable!row selection}Most functions work on all rows of a
     473scan table. Exceptions are the fitter and plotter. If you wish to only
     474operate on a selected set of scantable rows, use the \cmd{get\_scan}
     475function to copy the rows into a new scantable.
    464476
    465477\subsubsection{Allaxes}
    466478
    467 Many functions have an \cmd{allaxes} option which controls whether the
    468 function will operate on all elements within a scantable row, or just
    469 those selected with the current cursor. The default is taken from the
    470 users {\tt .asaprc} file.
     479\index{allaxes}\index{Scantable!allaxes}Many functions have an
     480\cmd{allaxes} option which controls whether the function will operate
     481on all elements within a scantable row, or just those selected with
     482the current cursor. The default is taken from the users {\tt .asaprc}
     483file.
    471484
    472485\subsubsection{Masks}
    473486
    474 Many tasks (fitting, baseline subtraction, statistics etc) should only
    475 be run on range of channels. Depending on the current ``unit'' setting
    476 this range is set directly as channels, velocity or frequency
    477 ranges. Internally these are converted into a simple boolean mask for
    478 each channel of the abscissa. This means that if the unit setting is
    479 later changed, previously created mask are still valid. (This is not
    480 true for functions which change the shape or shift the frequency axis).
    481 You create masks with the function \cmd{create\_mask} and this specified
     487\index{Masks}\index{Scantable!masks}Many tasks (fitting, baseline
     488subtraction, statistics etc) should only be run on range of
     489channels. Depending on the current ``unit'' setting this range is set
     490directly as channels, velocity or frequency ranges. Internally these
     491are converted into a simple boolean mask for each channel of the
     492abscissa. This means that if the unit setting is later changed,
     493previously created mask are still valid. (This is not true for
     494functions which change the shape or shift the frequency axis).  You
     495create masks with the function \cmd{create\_mask} and this specified
    482496the channels to be included in the selection.
    483497
     
    535549\section{Data Input}
    536550
    537 Data can be loaded in one of two ways; using the reader object or via
     551\index{Reading data}Data can be loaded in one of two ways; using the reader object or via
    538552the scantable constructor. The scantable method is simpler but the
    539553reader allow the user more control on what is read.
     
    541555\subsection{Scantable constructor}
    542556
    543 This loads all of the data from filename into the scantable object scans
    544 and averages all the data within a scan (i.e.  the resulting scantable
     557\index{Scantable constructor}\index{Scantable!constructor}This loads
     558all of the data from filename into the scantable object scans and
     559averages all the data within a scan (i.e.  the resulting scantable
    545560will have one row per scan).  The recognised input file formats are
    546561RPFITS, SDFITS (singledish fits), ASAP's scantable format and aips++
    547562MeasurementSet2 format.
    548563
    549 
    550564Example usage:
    551565
     
    560574\subsection{Reader object}
    561575
    562 For more control when reading data into ASAP, the reader object should
    563 be used.  This has the option of only reading in a range of integrations
    564 and does not perform any scan averaging of the data, allowing analysis
    565 of the individual integrations.  Note that due to limitation of the
    566 RPFITS library, only one reader object can be open at one time reading
    567 RPFITS files.  To read multiple RPFITS files, the old reader must be
    568 destroyed before the new file is opened.  However, multiple readers can
    569 be created and attached to SDFITS files.
     576\index{Reader object}\index{Scantable!reader object}For more control
     577when reading data into ASAP, the reader object should be used.  This
     578has the option of only reading in a range of integrations and does not
     579perform any scan averaging of the data, allowing analysis of the
     580individual integrations.  Note that due to limitation of the RPFITS
     581library, only one reader object can be open at one time reading RPFITS
     582files.  To read multiple RPFITS files, the old reader must be
     583destroyed before the new file is opened.  However, multiple readers
     584can be created and attached to SDFITS files.
    570585
    571586
     
    574589\begin{verbatim}
    575590  ASAP> r = reader('2003-03-16_082048_t0002.rpf')
    576   ASAP> r.summary
     591  ASAP> r.summary()
    577592  ASAP> scan = r.read()
    578593  ASAP> s = r.read(range(100)) # To read in the first 100 integrations
     
    591606%How and when?
    592607\subsection{Auto quotient}
    593 Quotients can be computed ``automatically''. This requires the data to
    594 have matching source/reference pairs or one reference for multiple
    595 sources. Auto quotient assumes reference scans have a trailing ``\_R''
    596 in the source name for data from Parkes and Mopra, and a trailing
    597 ``e'' or ``w'' for data fro, Tidbinbilla.
     608\index{Auto quotient}Quotients can be computed ``automatically''. This
     609requires the data to have matching source/reference pairs or one
     610reference for multiple sources. Auto quotient assumes reference scans
     611have a trailing ``\_R'' in the source name for data from Parkes and
     612Mopra, and a trailing ``e'' or ``w'' for data fro, Tidbinbilla.
    598613
    599614\begin{verbatim}
     
    605620\subsection{Separate reference and source observations}
    606621
    607 Most data from ATNF observatories distinguishes on and off source data
    608 using the file name. This makes it easy to create two scantables with
    609 the source and reference data. As long as there was exactly one
    610 reference observation for each on source observation for following
    611 method will work.
     622\index{Quotient spectra}Most data from ATNF observatories
     623distinguishes on and off source data using the file name. This makes
     624it easy to create two scantables with the source and reference
     625data. As long as there was exactly one reference observation for each
     626on source observation for following method will work.
    612627
    613628For Mopra and Parkes data:
     
    644659\subsection{Time average separate scans}
    645660
    646 If you have observed the source with multiple source/reference cycles you
    647 will want to scan-average the quotient spectra together.
     661\index{Time average}If you have observed the source with multiple
     662source/reference cycles you will want to scan-average the quotient
     663spectra together.
    648664
    649665\begin{verbatim}
     
    673689\end{verbatim}
    674690
     691Note that, if needed, you should run \cmd{freq\_align}, \cmd{gain\_el}
     692and \cmd{opacity} before you average the data in time (\S
     693\ref{sec:gainel} \& \ref{sec:freqalign}).
     694
    675695\subsection{Baseline fitting}
    676696
    677 To make a baseline fit, you must first create a mask of channels to
    678 use in the baseline fit.
     697\index{Baseline fitting}To make a baseline fit, you must first create
     698a mask of channels to use in the baseline fit.
    679699
    680700\begin{verbatim}
     
    688708\subsubsection{Auto-baselining}
    689709
    690 The function \cmd{auto\_poly\_baseline} can be used to automatically
     710\index{Auto-baseline}The function \cmd{auto\_poly\_baseline} can be used to automatically
    691711baseline your data without having to specify channel ranges for the
    692712line free data. It automatically figures out the line-free emission
     
    724744\subsection{Average the polarisations}
    725745
    726 If you are just interested in the highest SNR for total intensity you
     746\index{average\_pol}If you are just interested in the highest SNR for total intensity you
    727747will want to average the parallel polarisations together.
    728748
     
    733753\subsection{Calibration}
    734754
    735 For most uses, calibration happens transparently as the input data
     755\index{Calibration}For most uses, calibration happens transparently as the input data
    736756contains the Tsys measurements taken during observations. The nominal
    737757``Tsys'' values may be in Kelvin or Jansky. The user may wish to
     
    741761\subsubsection{Brightness Units}
    742762
    743 RPFITS files do not contain any information as to whether the telescope
    744 calibration was in units of Kelvin or Janskys.  On reading the data a
    745 default value is set depending on the telescope and frequency of
    746 observation.  If this default is incorrect (you can see it in the
    747 listing from the \cmd{summary} function) the user can either override
    748 this value on reading the data or later.  E.g:
     763\index{Brightness Units}RPFITS files do not contain any information as
     764to whether the telescope calibration was in units of Kelvin or
     765Janskys.  On reading the data a default value is set depending on the
     766telescope and frequency of observation.  If this default is incorrect
     767(you can see it in the listing from the \cmd{summary} function) the
     768user can either override this value on reading the data or later.
     769E.g:
    749770
    750771\begin{verbatim}
     
    757778\subsubsection{Tsys scaling}
    758779
    759 Sometime the nominal Tsys measurement at the telescope is wrong due to
    760 an incorrect noise diode calibration. This can easily be corrected for
    761 with the scale function. By default, \cmd{scale} only scans the
    762 spectra and not the corresponding Tsys.
     780\index{Tsys scaling}Sometime the nominal Tsys measurement at the
     781telescope is wrong due to an incorrect noise diode calibration. This
     782can easily be corrected for with the scale function. By default,
     783\cmd{scale} only scans the spectra and not the corresponding Tsys.
    763784
    764785\begin{verbatim}
     
    768789\subsubsection{Unit Conversion}
    769790
    770 To convert measurements in Kelvin to Jy (and vice versa) the global
    771 function \cmd{convert\_flux} is needed. This converts and scales the data
    772 from K to Jy or vice-versa depending on what the current brightness unit is
    773 set to. The function knows the basic parameters for some frequencies
    774 and telescopes, but the user may need to supply the aperture
    775 efficiency, telescope diameter or the Jy/K factor.
    776 
    777 \begin{verbatim}
    778   ASAP> scans.convert_flux                 # If efficency known
     791\index{Unit conversion}To convert measurements in Kelvin to Jy (and
     792vice versa) the global function \cmd{convert\_flux} is needed. This
     793converts and scales the data from K to Jy or vice-versa depending on
     794what the current brightness unit is set to. The function knows the
     795basic parameters for some frequencies and telescopes, but the user may
     796need to supply the aperture efficiency, telescope diameter or the Jy/K
     797factor.
     798
     799\begin{verbatim}
     800  ASAP> scans.convert_flux()               # If efficency known
    779801  ASAP> scans.convert_flux(eta=0.48)       # If telescope diameter known
    780802  ASAP> scans.convert_flux(eta=0.48,d=35)  # Unknown telescope
     
    783805
    784806\subsubsection{Gain-Elevation and Opacity Corrections}
    785 
    786 As higher frequencies (particularly $>$20~GHz) it is important to make
    787 corrections for atmospheric opacity and gain-elevation effects.
    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)
     810it is important to make corrections for atmospheric opacity and
     811gain-elevation effects.
     812
     813Note that currently the elevation is not written correctly into
    790814Tidbinbilla rpfits files. This means that gain-elevation and opacity
    791 corrections will not work until a work around is implemented.}
     815corrections 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}
    792820
    793821Gain-elevation curves for some telescopes and frequencies are known to
    794 ASAP (currently only for Tidbinbilla at 20~GHz).  In these cases making
    795 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 file
     822ASAP (currently only for Tidbinbilla at 20~GHz).  In these cases
     823making gain-corrections is simple.  If the gain curve for your data is
     824not known, the user can supply either a gain polynomial or text file
    797825tabulating gain factors at a range of elevations (see \cmd{help
    798826scantable.gain\_el}).
     
    805833\end{verbatim}
    806834
    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
     836function \cmd{opacity}. This should work on all telescopes as long as
     837a measurement of the opacity factor was made during the observation.
    810838
    811839\begin{verbatim}
     
    818846
    819847\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
     851averaging a series of scans together, it is possible that the velocity
     852scales are not exactly aligned.  This may be for many reasons such as
     853not Doppler tracking the observations, errors in the Doppler tracking
     854etc.  This mostly affects very long integrations or integrations
     855averaged together from different days.  Before averaging such data
     856together, they should be frequency aligned using \cmd{freq\_align}.
    828857
    829858E.g.:
     
    863892\section{Scantable manipulation}
    864893
    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
     895independent sources within one scantable, it is often inconvenient for
     896data processing. The \cmd{get\_scan} function can be used to create a
     897new scantable with a selection of scans from a scantable. The
     898selection can either be on the source name, with simple wildcard
     899matching or set of scan ids.
    870900
    871901For example:
     
    898928
    899929\begin{verbatim}
    900   ASAP> ss = scans.copy
     930  ASAP> ss = scans.copy()
    901931\end{verbatim}
    902932
    903933\section{Data Output}
    904934
    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
     936variety of formats, suitable for reading into other packages. The
     937formats are:
    907938
    908939\begin{itemize}
     
    945976\section{Plotter}
    946977
    947 Scantable spectra can be plotted at any time. An asapplotter object is
     978\index{Plotter}Scantable spectra can be plotted at any time. An asapplotter object is
    948979used for plotting, meaning multiple plot windows can be active at the
    949980same time. On start up a default asapplotter object is created called
     
    9881019\label{sec:plotter_cursor}
    9891020
    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
     1022stacked spectra per panel. If you have data larger than this (or for
     1023your own sanity) you need to select a subset of this data. This is
     1024particularly true for multibeam or multi IF data. The plotter
     1025\cmd{set\_cursor} function is used to select a subset of the data. The
     1026arguments \cmd{row}, \cmd{beam} and \cmd{IF} all accept a vector of
     1027indices corresponding to row, beam or IF selection. Only the selected
     1028data will be plotted.  To select on polarisation, see
     1029section~\ref{sec:polplot}.
    9981030
    9991031Examples:
     
    10181050\subsection{Plot Control}
    10191051
    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
     1053lower left. These can be used to control the plotter (mostly for
     1054zooming the individual plots). From left to right:
    10231055
    10241056\begin{itemize}
     
    10421074\item[Save] (floppy disk). Save the plot as a postscript or .png file
    10431075
     1076You can also type ``g'' in the plot window to toggle on and off grid
     1077lines. Typing 'l' turns on and off logarithmic Y-axis.
     1078
    10441079\end{itemize}
    10451080
     
    10741109\section{Fitting}
    10751110
    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
     1112available. This is done by creating a fitting object, setting up the
     1113fit and actually fitting the data. Fitting can either be done on a
     1114single scantable row/cursor selection or on an entire scantable using
     1115the \cmd{auto\_fit} function.
    10801116
    10811117\begin{verbatim}
     
    11421178\subsection{Fit saving}
    11431179
    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
     1181possible to store it as part of the scantable.
    11461182
    11471183\begin{verbatim}
     
    11631199\section{Polarisation}
    11641200
    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
     1202on linearly polarised feeds and the cross polarisation products
     1203measured. Other cases will be added on an as needed basic.
    11681204
    11691205Conversions of linears to Stokes or Circular polarisations are done
     
    11791215for transparent polarimetric calibration.}
    11801216
    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
     1218offset between polarisation which will effect the phase of the cross
     1219polarisation correlation, and so give rise to spurious
     1220polarisation. \cmd{rotate\_xyphase} can be used to correct for this
     1221error. At this point, the user must know how to determine the size of
     1222the phase offset themselves.
    11861223
    11871224\begin{verbatim}
     
    12081245\label{sec:polplot}
    12091246
    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}
     1249argument. The values which can be plotted include a selection of
     1250[I,Q,U,V], [I, Plinear, Pangle, V], [RR, LL] or [XX, YY, Real(XY),
     1251Imaginary(XY)]. (Plinear and Pangle are the percentage and position
     1252angle of linear polarisation). Conversion to circular polarisations
     1253are currently not available.
    12161254
    12171255Example:
     
    12291267\subsection{Saving}
    12301268
    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}
     1270function, the \cmd{stokes} argument can be used to save the data as
     1271Stoke values when saving in FITS format.
    12341272
    12351273Example:
     
    12421280\section{Scantable Mathematics}
    12431281
    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
     1283directly on scantables from the command line using the \cmd{+, -, *,
     1284/} operators as well as their cousins \cmd{+=, -= *=, /=}. This works
     1285between two scantables or a scantable and a float. (Note that it does
     1286not work for integers).
    12481287
    12491288\begin{verbatim}
     
    12551294\section{Scripting}
    12561295
    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
     1297write their own scripts and functions to process data. This is highly
     1298recommended as most processing of user data could then be done in a
     1299couple of steps using a few simple user defined functions. A Python
     1300primer is beyond the scope of this userguide. See the asap home pages
     1301for a scripting tutorial or the main python website for comprehensive
     1302documentation.
    12631303
    12641304\hspace{1cm} http://www.atnf.csiro.au/computing/software/asap/tutorials
     
    12821322
    12831323In the following section a few examples of end-to-end processing of
    1284 some data in asap are given. 
     1324some data in asap are given.
    12851325
    12861326\subsection{Mopra}
     1327\index{Mopra}
     1328
     1329The following example is of some dual polarisation, position switched
     1330data from Mopra. The source has been observed mulitple times split
     1331into a number of seperate rpfits files. To make the processing easier,
     1332the first step is to \cmd{cat} the seeprate rpfits files together and
     1333load as a whole (future versions of asap will make this unnecessary).
     1334
     1335
     1336\begin{verbatim}
     1337# Concatenate the individual rpfits files together before loading
     1338!cat 2005-06*.rpf > data.rpf
     1339
     1340# Load the data into a scantable
     1341data = scantable('data.rpf')
     1342print data
     1343
     1344# Form the quotient spectra
     1345q = data.auto_quotient()
     1346print q
     1347
     1348# Look at the spectra
     1349plotter.plot(q)
     1350
     1351# Velocity align the data before averaging
     1352q.set_unit('km/s')
     1353q.set_freqframe('LSRK')
     1354q.freq_align()
     1355
     1356# Average all scans in time
     1357av = q.average_time()
     1358plotter.plot(av)
     1359
     1360# Remove the baseline
     1361msk = av.create_mask([100,130],[160,200])
     1362av.poly_baseline(msk,2)
     1363
     1364# Average the two polarisations together
     1365iav = av.average_pol()
     1366print iav
     1367plotter.plot(iav)
     1368
     1369# Set a sensible velocity range on the plot
     1370plotter.set_range(85,200)
     1371
     1372# Smooth the data a little
     1373av.smooth('gauss',4)
     1374plotter.plot()
     1375
     1376# Fit a guassian to the emission
     1377f = fitter()
     1378f.set_function(gauss=1)
     1379f.set_scan(av)
     1380f.fit()
     1381
     1382# View the fit
     1383f.plot()
     1384
     1385# Get the fit parameters
     1386f.get_parameters()
     1387
     1388\end{verbatim}
     1389
    12871390
    12881391\subsection{Parkes Polarimetry}
    12891392
    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
     1394of some Parkes polarmetric observations of OH masers at
     13951.6~GHz. Because digital filters where used in the backend, the
     1396baselines are stable enough not to require a quotient spectra. The
     13974~MHz bandwidth is wide enough to observe both the 1665 and 1667~MHz
     1398OH maser transitions. Each source was observed once for about 10
     1399minutes. Tsys information was not written to the rpfits file (a
     1400nominal 25K values was used), so the amplitudes need to be adjusted
     1401based on a separate log file. A simple user function is used to
     1402simplify this, contained in a file called mypol.py:
    12991403
    13001404\begin{verbatim}
     
    13171421
    13181422\begin{verbatim}
    1319  
     1423
    13201424# Remind ourself the name of the rpfits files
    1321 ls 
     1425ls
    13221426
    13231427# Load data from an rpfits file
     
    13341438d1665.rotate_xyphase(-4)
    13351439
    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
    13371441# transition
    13381442d1667 = d1665.copy()
     
    13831487\subsection{Tidbinbilla}
    13841488
    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
     1490Tidbinbilla observations of NH$_3$ at 12~mm. Tidbinbilla has (at the
     1491time of observations) a single polarisation, but can process two IFs
     1492simultaneously. In the example, the first half of the observation was
     1493observing the (1,1) and (2,2) transitions simultaneously). The second
     1494half observed only the (4,4) transition due to bandwidth
     1495limitations. The data is position switched, observing first an
     1496reference to the west, then the source twice and finally reference to
     1497the east.
    13931498
    13941499\begin{verbatim}
     
    14101515g2 = q.get_scan(range(6,12))  # Rows 6..11
    14111516
    1412 # Align data in velocity 
     1517# Align data in velocity
    14131518g1.freq_align(perif=True)
    14141519g2.freq_align(perif=True)
     
    14421547\subsection{Function Summary}
    14431548
     1549\index{Functions!summary}%
    14441550\begin{verbatim}
    14451551    [The scan container]
     
    14581564            get_tsys        - get the TSys
    14591565            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
    14601569            get_unit        - get the currnt unit
    14611570            set_unit        - set the abcissa unit to be used from this
     
    14971606            poly_baseline   - fit a polynomial baseline to all Beams/IFs/Pols
    14981607            auto_poly_baseline - automatically fit a polynomial baseline
     1608            recalc_azel     - recalculate azimuth and elevation based on
     1609                              the pointing
    14991610            gain_el         - apply gain-elevation correction
    15001611            opacity         - apply opacity correction
     
    15811692\subsection{Installation}
    15821693
    1583 ASAP depends on a number of third-party libraries which you must
     1694\index{Installation}ASAP depends on a number of third-party libraries which you must
    15841695have installed before attempting to build ASAP. These are:
    15851696
     
    15991710
    16001711\subsection{.asaprc settings}
    1601 
     1712\index{.asaprc}
    16021713\asaprc{verbose}{{\bf True}/False}{Print verbose output}
    16031714
     
    16301741% scantable
    16311742\asaprc{scantable.save}{{\bf ASAP} SDFITS FITS ASCII MS2}{Default output
    1632 format when saving} 
     1743format when saving}
    16331744
    16341745\asaprc{scantable.autoaverage}{{\bf True}/False}{Auto averaging on
     
    16471758of information printed by summary}
    16481759
     1760\printindex
     1761
    16491762\end{document}
    16501763
  • trunk/doc/release-checklist.txt

    r566 r794  
    992) installed docs by hand - no make targets yet
    1010   - 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
    1619   - add refman doc
    1720   - cd /usr/local/lib/python2.3/site-packages
     
    2124
    22253) cvs branching for release
    23    - cvs -R tag Release-1
    24    - cvs rtag -r Release-1 -b Release-1-fixes asap
     26   - cvs -R tag ReleaseNNN
     27   - cvs rtag -r ReleaseNNN -b ReleaseNNN-fixes asap
    2528
    26294) Check that asap is rdisted (/nfs/DEBIANlocal) to the sites
  • trunk/python/__init__.py

    r780 r794  
    298298            get_time        - get the timestamps of the integrations
    299299            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
    300303            get_unit        - get the currnt unit
    301304            set_unit        - set the abcissa unit to be used from this
  • trunk/python/asapfitter.py

    r723 r794  
    432432        print_log()
    433433
    434     def auto_fit(self, insitu=None):
     434    def auto_fit(self, insitu=None, allaxes=True):
    435435        """
    436436        Return a scan where the function is applied to all rows for
     
    454454        rows = range(scan.nrow())
    455455        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
    472485        scan.set_cursor(sel[0],sel[1],sel[2])
    473486        print_log()
  • trunk/python/asapplotter.py

    r762 r794  
    148148        else:
    149149            self._plotter.set_panels()
     150        allxlim=[]
    150151        rows = self._cursor["t"]
    151152        rows = rows[:n]
     
    228229                if self._minmaxx is not None:
    229230                    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]])
    231234            self._plotter.set_axes('xlabel',xlab)
    232235            self._plotter.set_axes('ylabel',ylab)
    233236            self._plotter.set_axes('title',tlab)
     237
    234238        return
    235239
     
    269273            colvals = eval(cdict2.get(colmode))
    270274            rowsel = self._cursor["t"][0]
     275            allxlim=[]
    271276            for j in colvals:
    272277                polmode = "raw"
     
    331336                if self._minmaxx is not None:
    332337                    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]])
    335341            self._plotter.set_axes('xlabel',xlab)
    336342            self._plotter.set_axes('ylabel',ylab)
     
    377383            eval(cdict.get(self._panelling))
    378384
     385            allxlim=[]
    379386            colvals = eval(cdict2.get(colmode))
    380387            for j in colvals:
     
    404411                    eval(cdict.get(colmode))
    405412                    i = savei
    406                 if self._panelling == "p":
    407                     eval(cdict.get(self._panelling))
     413                #if self._panelling == "p":
     414                eval(cdict.get(self._panelling))
    408415                x = None
    409416                y = None
     
    470477                if self._minmaxx is not None:
    471478                    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]])
    473482
    474483            self._plotter.set_axes('xlabel',xlab)
  • trunk/python/scantable.py

    r780 r794  
    226226                    raise IOError(msg)
    227227        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)
    229233        else:
    230234            return info
     
    429433    def get_sourcename(self, row=-1):
    430434        """
    431         Get a list source anmes for the observations.
     435        Get a list source names for the observations.
    432436        Return a string for each integration in the scantable.
    433437        Parameters:
     
    442446            if  0 <= row < self.nrow():
    443447                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)
    444496
    445497    def set_unit(self, unit='channel'):
     
    717769    def history(self):
    718770        hist = list(self._gethistory())
    719         print "-"*80
     771        out = "-"*80
    720772        for h in hist:
    721773            if h.startswith("---"):
    722                 print h
     774                out += "\n"+h
    723775            else:
    724776                items = h.split("##")
     
    726778                func = items[1]
    727779                items = items[2:]
    728                 print date
    729                 print "Function: %s\n  Parameters:" % (func)
     780                out += "\n"+date+"\n"
     781                out += "Function: %s\n  Parameters:" % (func)
    730782                for i in items:
    731783                    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)
    734791        return
    735792
     
    10551112            return
    10561113
    1057     def poly_baseline(self, mask=None, order=0, insitu=None):
     1114    def poly_baseline(self, mask=None, order=0, insitu=None, allaxes=None):
    10581115        """
    10591116        Return a scan which has been baselined (all rows) by a polynomial.
    10601117        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)
    10671127        Example:
    10681128            # return a scan baselined by a third order polynomial,
     
    10701130            bscan = scan.poly_baseline(order=3)
    10711131        """
     1132        if allaxes is None: allaxes = rcParams['scantable.allaxes']
    10721133        if insitu is None: insitu = rcParams['insitu']
    10731134        varlist = vars()
     
    10791140        f.set_scan(self, mask)
    10801141        f.set_function(poly=order)
    1081         sf = f.auto_fit(insitu)
     1142        sf = f.auto_fit(insitu,allaxes)
    10821143        if insitu:
    10831144            self._add_history("poly_baseline", varlist)
     
    12911352            refs = self.get_scan("*[_ewR]")
    12921353            if isinstance(srcs,scantable) and isinstance(refs,scantable):
     1354                from asap import asaplog
    12931355                ns,nr = srcs.nrow(),refs.nrow()
     1356                msg = "Found %i Off and %i On scans" % (ns,nr)
     1357                asaplog.push(msg)
    12941358                if nr > ns:
     1359                    asaplog("Found more Off integrations than On scans - dropping excess Offs.")
    12951360                    refs = refs.get_scan(range(ns))
    12961361                print_log()
  • trunk/src/Makefile

    r717 r794  
    11TARGET   := /tmp/_asap.so
     2
     3
     4# the casa environment AIPSPATH has to be defined
     5CASAROOT  := $(word 1, $(AIPSPATH))
     6CASAARCH  := $(word 2, $(AIPSPATH))
     7CASAINC   := -I$(CASAROOT)/code/include -I$(CASAROOT)/code/casa
     8CASALIB   := $(CASAROOT)/$(CASAARCH)/lib
     9
     10
     11# the compiler
    212ifndef CXX
    313   CXX      := g++
    414endif
     15
     16# compiler flags
    517CXXFLAGS := -O3 -fPIC
    6 CXXFLAGS += -ansi
    7 CXXFLAGS += -pedantic -Wno-long-long
     18CXXFLAGS += -ansi -pedantic -Wno-long-long
    819CXXOPTS := -DAIPS_NO_TEMPLATE_SRC
    920
    10 CFITSIOROOT := /usr/local If aips++ is build with LFS you need to have
     21# darwin specific flags
     22ifeq "$(CASAARCH)" "darwin"
     23   CXXFLAGS := -O2 -DAIPS_DARWIN
     24   CXXFLAGS += -ansi -pedantic -Wno-long-long -Wno-long-double
     25endif
     26
     27
     28# cfitsio
     29CFITSIOROOT := /usr/local
     30# If aips++ is build with LFS you need to have
    1131# libcfitsio with lfs support
    12 CFITSIOLIB := /usr/local/lib/libcfitsio_lfs.a
    13 #CFITSIOINC := -I$(CFITSIOROOT)/include/cfitsio
     32CFITSIOINC := -I$(CFITSIOROOT)/include
     33CFITSIOLIB := $(CFITSIOROOT)/lib/libcfitsio_lfs.a
    1434#CFITSIOLIB := -L$(CFITSIOROOT) -lcfitsio
    1535
    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
     37RPFITSROOT := /usr/local
     38RPFITSLIB := $(RPFITSROOT)/lib/librpfits.a
    2239
    2340# This assumes all casa libs are static only (*.a)
    2441# if not than there might by symbol resolution errors.
    2542CASAPPLIB := $(CASALIB)/version.o \
    26              -L$(CASALIB) -static \
     43             -L$(CASALIB) \
    2744             -latnf -limages -lms -lcomponents -lcoordinates \
    2845             -llattices -lfits -lmeasures -lmeasures_f \
    2946             -ltables -lscimath -lscimath_f -lcasa  \
    3047             $(CASALIB)/libwcs.a \
    31               -lrpfits $(CFITSIOLIB) -dy -llapack -lblas -lg2c
     48             $(RPFITSLIB) $(CFITSIOLIB) -lg2c -lstdc++
    3249
     50# darwin specific CASA flags
     51ifeq "$(CASAARCH)" "darwin"
     52   CASAPPLIB += -framework vecLib
     53else
     54   CASAPPLIB += -llapack -lblas
     55endif
     56
     57# the linker
    3358LD        := $(CXX)
     59
    3460LDFLAGS   := -shared -Wl$(TARGET) -s
     61ifeq "$(CASAARCH)" "darwin"
     62   LDFLAGS   := -dynamiclib -single_module
     63endif
    3564
     65# python only 2.3 has been tested
    3666PYVERSION := 2.3
    3767PYTHONROOT := /usr
     
    3969PYTHONLIB := -L$(PYTHONROOT)/lib -lpython$(PYVERSION)
    4070
    41 
     71# has to be build with same g++ version as casa
    4272BOOSTROOT := /usr
    4373BOOSTLIB  := -L$(BOOSTROOT)/lib -lboost_python
     
    4575
    4676
     77# DO NOT MODIFY AFTER THIS
    4778INCDIRS   := -I. $(CASAINC) $(BOOSTINC) $(PYTHONINC) $(CFITSIOINC)
    4879LIBS      := $(PYTHONLIB)  $(BOOSTLIB) $(CASAPPLIB)
  • trunk/src/SDMemTable.cc

    r780 r794  
    244244  srcnCol_.get(whichRow, name);
    245245  return name;
     246}
     247
     248float SDMemTable::getElevation(Int whichRow) const
     249{
     250  float elevation;
     251  elCol_.get(whichRow, elevation);
     252  return elevation;
     253}
     254
     255float SDMemTable::getAzimuth(Int whichRow) const
     256{
     257  float azimuth;
     258  azCol_.get(whichRow, azimuth);
     259  return azimuth;
     260}
     261
     262float SDMemTable::getParAngle(Int whichRow) const
     263{
     264  float parangle;
     265  paraCol_.get(whichRow, parangle);
     266  return parangle;
    246267}
    247268
  • trunk/src/SDMemTable.h

    r777 r794  
    147147
    148148  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
    149154  double getInterval(casa::Int whichRow=0) const;
    150155
  • trunk/src/SDMemTableWrapper.h

    r777 r794  
    136136  std::string getSourceName(int whichRow=0) {
    137137    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);
    138148  }
    139149
  • trunk/src/SDTemplates.cc

    r701 r794  
    3434#include <casa/namespace.h>
    3535#include <casa/Exceptions/Error.cc>
    36 #include <casa/Exceptions/Error2.cc>
     36//#include <casa/Exceptions/Error2.cc>
    3737#include <casa/Utilities/CountedPtr.cc>
    38 #include <casa/Utilities/CountedPtr2.cc>
     38//#include <casa/Utilities/CountedPtr2.cc>
    3939
    4040namespace asap {
     
    5353#include <casa/Arrays/Array.cc>
    5454#include <casa/Arrays/Vector.h>
    55 #include <casa/Arrays/Vector2.cc>
    56 #include <casa/Arrays/Vector.cc>
    57 #include <casa/Utilities/PtrHolder.cc>
    5855#include <casa/Utilities/BinarySearch.cc>
    5956#include <coordinates/Coordinates/FrequencyAligner.cc>
    6057#include <lattices/Lattices/Lattice.h>
    6158#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>
    6659#include <scimath/Mathematics/InterpolateArray1D.cc>
    6760#include <tables/Tables/BaseMappedArrayEngine.cc>
     
    6962template void convertArray<Bool, uChar>(Array<Bool> &, Array<uChar> const &);
    7063template 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
    7565template Array<Float>& operator/=<Float>(Array<Float>&, MaskedArray<Float> const&);
    7666template MaskedArray<Float> const& operator*=<Float>(MaskedArray<Float> const&, Float const&);
     
    9080template Float sumsquares<Float>(MaskedArray<Float> const&);
    9181template Float avdev<Float>(MaskedArray<Float> const&);
    92 template class CompiledFunction<AutoDiff<Float> >;
    93 template class CompiledParam<AutoDiff<Float> >;
    9482
    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> >&);
    10783template void LatticeUtilities::bin(MaskedArray<float>&, MaskedArray<float> const&, uInt, uInt);
    108 template class PtrHolder<Lattice<Float> >;
     84
    10985template 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
    11287template class BaseMappedArrayEngine<Float, Float>;
    11388
  • trunk/src/python_SDMemTable.cc

    r777 r794  
    9393    .def("_getsourcename", &SDMemTableWrapper::getSourceName,
    9494         (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) )
    95101    .def("_gettime", &SDMemTableWrapper::getTime,
    96102         (boost::python::arg("whichRow")=0) )
  • trunk/test/tid.py

    r752 r794  
    2121q.set_freqframe('LSRK')
    2222
    23 # Align frequencies - Tid doppler tracks, so this isn't really necessary
     23# Align frequencies
    2424
    2525q.freq_align(perif=True)
    26 q.set_unit('km/s')
     26
     27# Recalculate the az/el
     28
     29q.recalc_azel()
     30
     31# Correct for gain curve and opacity
     32q.gain_el()
     33q.opacity(0.075)
    2734
    2835# Average in time
    2936av = average_time(q)
     37
     38# Baseline
     39msk=av.create_mask([-70,-50],[40,60])
     40av.poly_baseline(msk,1)
     41
     42plotter.set_mode('i')
     43plotter.plot(av)
     44plotter.save('output/tid.png')
    3045
    3146# Do some random processing, just to test these functions
     
    3449av.add(0.05)
    3550
    36 # Baseline
    37 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 correctly
    45 av.gain_el()
    46 av.opacity(0.075)
    47 
    4851print "Tid test finished successfully"
  • trunk/web/commands.html

    r762 r794  
    6161            get_time        - get the timestamps of the integrations
    6262            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
    6366            get_unit        - get the currnt unit
    6467            set_unit        - set the abcissa unit to be used from this
     
    103106            poly_baseline   - fit a polynomial baseline to all Beams/IFs/Pols
    104107            auto_poly_baseline - automatically fit a polynomial baseline
     108            recalc_azel     - recalculate azimuth and elevation based on
     109                              the pointing
    105110            gain_el         - apply gain-elevation correction
    106111            opacity         - apply opacity correction
  • trunk/web/index.html

    r770 r794  
    4747
    4848<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.
     49ASAP 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.
    5050
    5151<h2>Screenshots</h2>
     
    5656<pre style="color: blue">
    5757Loading ASAP...
    58 Welcome to ASAP v1.2 (2005/11/24) - the ATNF Spectral Analysis Package
     58Welcome to ASAP v1.2.1 (2005/12/06) - the ATNF Spectral Analysis Package
    5959
    6060Please report any bugs to:
Note: See TracChangeset for help on using the changeset viewer.