Changeset 971


Ignore:
Timestamp:
04/03/06 11:07:03 (19 years ago)
Author:
mar637
Message:

proof read chris' lat version. added some info.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/userguide.tex

    r970 r971  
    6262
    6363This starts the ASAP. To quit, you need to type \verb+^+-d
    64 (control-d).
     64(control-d) or type \cmd{\%Exit}.
    6565
    6666\section{Interface}
     
    9393  \item[\cmd{fitter}] A tool used to fit functions to the spectral data
    9494  \item[\cmd{reader}] A tool which can be used to read data from disks
    95     into a scantable object.
     95    into a scantable object (advanced use).
    9696\end{itemize}
    9797
     
    126126  ASAP> av = scans.average_time(mask=msk,weight='tsys')
    127127  ASAP> av = scans.average_time(msk,tsys)
    128   ASAP> scans.polybaseline(mask=msk, order=0, insitu=True)
    129   ASAP> scans.polybaseline(msk,0,True)
    130   ASAP> scans.polybaseline(mask, insitu=True)
     128  ASAP> scans.poly_baseline(mask=msk, order=0, insitu=True)
     129  ASAP> scans.poly_baseline(msk,0,True)
     130  ASAP> scans.poly_baseline(mask, insitu=True)
    131131\end{verbatim}
    132132
     
    157157  ASAP> scans = scantable('MyData.rpf')
    158158  ASAP> scans.se<TAB>
    159 scans.set_cursor      scans.set_freqframe   scans.set_unit        scans.setpol
    160 scans.set_doppler     scans.set_instrument  scans.setbeam
    161 scans.set_fluxunit    scans.set_restfreqs   scans.setif
    162159  ASAP> scans.set_in<TAB>
     160scans.set_cursor      scans.set_freqframe   scans.set_selection
     161scans.set_doppler     scans.set_instrument  scans.set_unit
     162scans.set_fluxunit    scans.set_restfreqs
     163
    163164  ASAP> scans.set_instrument()
    164165\end{verbatim}
     
    209210
    210211\begin{verbatim}
    211   ASAP> help scantable.get_scan
     212  ASAP> help scantable.get_scan # or help(scantable.get_scan)
    212213  ASAP> help scantable.stats
    213214  ASAP> help plotter.plot
     
    269270
    270271The building block of a scantable is an integration, which is a single
    271 row of a scantable. Each row contains spectra for each beam, IF and
     272row of a scantable. Each row contains just one spectrum for each beam, IF and
    272273polarisation. For example Parkes multibeam data would contain many
    273274beams, one IF and 2-4 polarisations, while the new Mopra 8-GHz
    274275filterbank will eventually produce one beam, many IFs, and 2-4
    275 polarisations.
    276 
    277 A collection of sequential integrations (rows) for one source is termed
    278 a scan (and each scan has a unique numeric identifier, the ScanID). A
     276polarisations. All of the combinations of Beams/IFs an Polarisations are
     277contained in seperate rows. These rows are grouped in cycles - same time stamp.
     278
     279A collection of cyclesfor one source is termed
     280a scan (and each scan has a unique numeric identifier, the ScanNo). A
    279281scantable is then a collection  of one or more scans. If you have
    280 scan-averaged your data in time, then each scan would  hold just one
    281 (averaged) integration.
     282scan-averaged your data in time, i.e. you have averegaed all cycles within
     283a scan, then each scan would hold just one (averaged) integration.
    282284
    283285Many of the functions which work on scantables can either return a
     
    303305of the frequency information and possibly how to manipulate it.
    304306
    305 These columns are called FreqID and RestFreqID.  They contain indices, for
    306 each IF, pointing into tables with all of the frequency information for that
    307 integration.   More on these below when we discuss the \cmd{summary} function
    308 in the next subsection.
     307These columns are called FreqID and MoleculeID.  They contain indices, for
     308each IF, pointing into tables with all of the frequency and rest-frequency
     309information for that integration. More on these below when we discuss
     310the \cmd{summary} function in the next subsection.
    309311
    310312There are of course many other columns which contain the actual spectra,
    311 the flags, the Tsys, the source names and so on, but those are a little
    312 more transparently handled.
     313the flags, the Tsys, the source names and so on.
    313314
    314315There is also a function \cmd{summary} to list a summary of the scantable.
     
    320321  ASAP> scans = scantable('MyData.rpf')
    321322  ASAP> scans.summary()                # Brief listing
    322   ASAP> scans.summary(verbose=True)    # Include frequency information
    323323
    324324  # Equivalent to brief summary function call
     
    326326\end{verbatim}
    327327
    328 Most of what the \cmd{summary} function  prints out is obvious. However,
    329 it also prints out the FreqIDs and RestFreqIDs to which we alluded above.
    330 These are the last column of the listing.
    331 
    332 The summary function gives you a scan-based summary.  So it lists all of
    333 the FreqIDs and RestFreqIDs that it encountered for each scan.  If you'd
    334 like to see what each FreqID actually means, then set the verbose
    335 argument to True and the frequency table will be listed at the end.
    336 FreqID of 3 say, refers to the fourth row of the frequency table (ASAP
    337 is 0-relative). The list of rest frequencies, to which the RestFreqIDs
    338 refer, is always listed.
     328The summary function gives you a scan-based summary, presenting the
     329scantable as a cascading view od Beams and IFs.
    339330
    340331\subsection{Data Selection}
     
    344335IF, beam, polarisation, scan number as well as values such as
    345336Tsys. Advanced users can also make use of the AIPS++ TAQL language to
    346 create selections based on almost any of the standard header values.
     337create selections based on almost any of the values recorded.
    347338
    348339Selection is based on a \cmd{selector} object. This object is created
     
    369360\item[\cmd{set\_polarisation}] Select but polarisation index or
    370361name. If polarisation names are given, the data will be on-the-fly
    371 converted (for example from linears to Stokes). Not all conversions
    372 are currently supported.
     362converted (for example from linears to Stokes).
    373363\item[\cmd{set\_query}] Set query directly. For power users only!
    374364\item[\cmd{set\_tsys}] Select data based on Tsys. Also example of user
     
    418408(e.g. LSRK), Doppler (e.g. OPTICAL) and unit (e.g. km/s) on-the-fly.
    419409This is important, for example, when you are displaying the data or
    420 fitting to it.
     410fitting to it. The reference frame is set on file read to the value
     411set in the user \cmd{.asaprc} file.
    421412
    422413For units, the user has the choice of frequency, velocity or channel.
     
    573564\section{Data Input}
    574565
    575 \index{Reading data}Data can be loaded in one of two ways; using the reader object or via
    576 the scantable constructor. The scantable method is simpler but the
    577 reader allow the user more control on what is read.
     566\index{Reading data}Data can be loaded in one of two ways; using the
     567reader object or via the scantable constructor. The scantable method
     568is simpler but the reader allows the user more control on what is read.
    578569
    579570\subsection{Scantable constructor}
     
    615606  ASAP> r.summary()
    616607  ASAP> scan = r.read()
    617   ASAP> s = r.read(range(100)) # To read in the first 100 integrations
    618608  ASAP> del r
    619609\end{verbatim}
     
    635625\begin{verbatim}
    636626  ASAP> q = s.auto_quotient()
     627\end{verbatim}
     628
     629By default the quotient spectra is calculated
     630to preserve continuum emission. If you wish to remove the continuum
     631contribution, use the \cmd{preserve} argument:
     632
     633\begin{verbatim}
     634 ASAP> q = s.auto_quotient(preserve=True)
    637635\end{verbatim}
    638636
     
    670668%rows in scantable \cmd{s}. Scantable \cmd{r} must have either 1 row
    671669%(which is applied to all rows in \cmd{s}) or both scantables must have
    672 %the same number of rows. By default the quotient spectra is calculated
    673 %to preserve continuum emission. If you wish to remove the continuum
    674 %contribution, use the \cmd{preserve} argument:
    675 %
    676 %\begin{verbatim}
    677 %  ASAP> q = s.quotient(r, preserve=True)
    678 %\end{verbatim}
     670%the same number of rows.
    679671
    680672\subsection{Time average separate scans}
     
    729721\begin{verbatim}
    730722 ASAP> msk = scans.create_mask([100,400],[600,900])
    731  ASAP> scans.poly_baseline(msk, 1)
     723 ASAP> scans.poly_baseline(msk, order=1)
    732724\end{verbatim}
    733725
     
    766758  # Only fit a given region around the line
    767759  ASAP> scans.set_unit('km/s')
    768   ASAP> msk = scans.create_mask((-60,-20))
     760  ASAP> msk = scans.create_mask([-60,-20])
    769761  ASAP> scans.auto_poly_baseline(mask=msk,order=3,threshold=3)
    770762
     
    799791
    800792\begin{verbatim}
    801   ASAP> scans = scantable(('2004-11-23_1841-P484.rpf', unit='Jy')
     793  ASAP> scans = scantable('2004-11-23_1841-P484.rpf', unit='Jy')
    802794  # Or in two steps
    803   ASAP> scans = scantable(('2004-11-23_1841-P484.rpf')
     795  ASAP> scans = scantable('2004-11-23_1841-P484.rpf')
    804796  ASAP> scans.set_fluxunit('Jy)
    805797\end{verbatim}
     
    989981  ASAP> scans.save('myscans') # Save in default format
    990982  ASAP> scans.save('myscans', 'FITS') # Save as FITS for exporting into CLASS
    991 
    992   ASAP> scans.save('myscans', stokes=True) # Convert raw polarisations into Stokes
    993983  ASAP> scans.save('myscans', overwrite=True) # Overwrite an existing file
    994984\end{verbatim}
     
    10441034your own sanity) you need to select a subset of this data. This is
    10451035particularly true for multibeam or multi IF data. The selector object
    1046 should be used for this purpose. Selection can either be applide to
     1036should be used for this purpose. Selection can either be applied to
    10471037the scantable or directly to the plotter, the end result is the same.
     1038You don't have to reset the scantable slection though, if you set
     1039the selection on the plotter.
    10481040
    10491041Examples:
     
    11301122\begin{verbatim}
    11311123  ASAP> plotter.save('myplot.ps')
     1124  ASAP> plotter.save('myplot.png', dpi=80)
    11321125\end{verbatim}
    11331126
     
    11401133\cmd{auto\_fit} function. If single value fitting is used, and the
    11411134current selection includes multiple spectra (beams, IFs, scans etc)
    1142 then the first spectra in the scantable will be used for fitting.
     1135then the first spectrum in the scantable will be used for fitting.
    11431136
    11441137\begin{verbatim}
     
    11471140 ASAP> f.set_scan(scans)
    11481141 ASAP> selection = selector()
    1149  ASAP> selection.set_polarisation(1) # Fit the second polarisation
     1142 ASAP> selection.set_polarisations(1) # Fit the second polarisation
    11501143 ASAP> scans.set_selection(selection)
    11511144 ASAP> scans.set_unit('km/s')  # Make fit in velocity units
     
    12301223\index{Polarisation}Currently ASAP only supports polarmetric analysis
    12311224on linearly polarised feeds and the cross polarisation products
    1232 measured. Other cases will be added on an as needed basic.
     1225measured. Other cases will be added on an as needed basis.
    12331226
    12341227Conversions of linears to Stokes or Circular polarisations are done
     
    12971290  ASAP> selection = selector()
    12981291
    1299   ASAP> selection.set_polarisations([``I Q U V''])
     1292  ASAP> selection.set_polarisations(``I Q U V'')
    13001293  ASAP  plotter.set_selection(selection);              # Select I, Q, U \& V
    13011294
    1302   ASAP> selection.set_polarisations([``I Q'')
     1295  ASAP> selection.set_polarisations(``I Q'')
    13031296  ASAP  plotter.set_selection(selection);              # Select just I \& Q
    13041297
    1305   ASAP> selection.set_polarisations([``RR LL'')
     1298  ASAP> selection.set_polarisations(``RR LL'')
    13061299  ASAP  plotter.set_selection(selection);              # Select just RR \& LL
    13071300
    1308   ASAP> selection.set_polarisations([``XX YY'')
     1301  ASAP> selection.set_polarisations(``XX YY'')
    13091302  ASAP  plotter.set_selection(selection);              # Select linears
    13101303
    1311   ASAP> selection.set_polarisations([``I Plinear'')
     1304  ASAP> selection.set_polarisations(``I Plinear'')
    13121305  ASAP  plotter.set_selection(selection);              # Fractional linear
    13131306
    13141307[[MALTE: This does not work]]
    13151308
    1316   ASAP> selection.set_polarisations([``Pangle'')
     1309  ASAP> selection.set_polarisations(``Pangle'')
    13171310  ASAP  plotter.set_selection(selection);              # Position angle
    13181311
     
    13391332directly on scantables from the command line using the \cmd{+, -, *,
    13401333/} operators as well as their cousins \cmd{+=, -= *=, /=}. This works
    1341 between two scantables or a scantable and a float. (Note that it does
     1334between a scantable and a float. (Note that it does
    13421335not work for integers).
    13431336
    1344 {\em Currently mathematics between two scan tables is not available }
    1345 
    1346 \begin{verbatim}
     1337{\em Currently mathematics between two scantables is not available }
     1338
    13471339%  ASAP> sum = scan1+scan2
     1340\begin{verbatim}
    13481341  ASAP> scan2 = scan1+2.0
    13491342  ASAP> scan *= 1.05
     
    14641457
    14651458 selection = selector()
    1466  selection.set_polarisation(0)
     1459 selection.set_polarisations(0)
    14671460 data.set_selection(selection)
    14681461 data.scale(xtsys/nomtsys)
    14691462
    1470  selection.set_polarisation(1)
     1463 selection.set_polarisations(1)
    14711464 data.set_selection(selection)
    14721465 data.scale(ytsys/nomtsys)
    14731466
    1474  selection.set_polarisation(0)
     1467 selection.set_polarisations(0)
    14751468 data.set_selection(selection)
    14761469 data.scale((xtsys+ytsys)/(2*nomtsys))
    14771470
    1478  selection.set_polarisation(0)
     1471 selection.set_polarisations(0)
    14791472 data.set_selection(selection)
    14801473 data.scale((xtsys+ytsys)/(2*nomtsys))
     
    15291522
    15301523# Correct for the Tsys using our predefined function
    1531 execfile('mypol.py') # Read in the function
     1524execfile('mypol.py') # Read in the function xyscale
    15321525xyscale(g351_5,23.2,22.7) # Execute it on the data
    15331526xyscale(g351_7,23.2,22.7)
     
    15911584
    15921585# Seperate data from the (1,1)&(2,2) and (4,4) transitions
    1593 g1 = q.get_scan(range(6))     # Rows 0..5
    1594 g2 = q.get_scan(range(6,12))  # Rows 6..11
     1586g1 = q.get_scan(range(6))     # scans 0..5
     1587g2 = q.get_scan(range(6,12))  # scans 6..11
    15951588
    15961589# Align data in velocity
     
    17711764\subsection{.asaprc settings}
    17721765\index{.asaprc}
    1773 \asaprc{verbose}{{\bf True}/False}{Print verbose output}
     1766\asaprc{verbose}{{\bf True}/False}{Print verbose output, good to disable in scripts}
    17741767
    17751768\asaprc{insitu}{{\bf True}/False}{Apply operations on the input
     
    18081801\asaprc{scantable.freqframe}{{\bf LSRK} TOPO BARY etc}{default
    18091802frequency frame to set when function scantable.set\_freqframe is
    1810 called}
    1811 
    1812 \asaprc{scantable.plotter}{{\bf True}/False}{Use internal plotter}
    1813 
    1814 \asaprc{scantable.verbosesummary}{True/{\bf False}}{Control the level
    1815 of information printed by summary}
     1803called or the data is imported}
    18161804
    18171805\subsection{Installation}
Note: See TracChangeset for help on using the changeset viewer.