Changeset 971
- Timestamp:
- 04/03/06 11:07:03 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/userguide.tex
r970 r971 62 62 63 63 This starts the ASAP. To quit, you need to type \verb+^+-d 64 (control-d) .64 (control-d) or type \cmd{\%Exit}. 65 65 66 66 \section{Interface} … … 93 93 \item[\cmd{fitter}] A tool used to fit functions to the spectral data 94 94 \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). 96 96 \end{itemize} 97 97 … … 126 126 ASAP> av = scans.average_time(mask=msk,weight='tsys') 127 127 ASAP> av = scans.average_time(msk,tsys) 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)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) 131 131 \end{verbatim} 132 132 … … 157 157 ASAP> scans = scantable('MyData.rpf') 158 158 ASAP> scans.se<TAB> 159 scans.set_cursor scans.set_freqframe scans.set_unit scans.setpol160 scans.set_doppler scans.set_instrument scans.setbeam161 scans.set_fluxunit scans.set_restfreqs scans.setif162 159 ASAP> scans.set_in<TAB> 160 scans.set_cursor scans.set_freqframe scans.set_selection 161 scans.set_doppler scans.set_instrument scans.set_unit 162 scans.set_fluxunit scans.set_restfreqs 163 163 164 ASAP> scans.set_instrument() 164 165 \end{verbatim} … … 209 210 210 211 \begin{verbatim} 211 ASAP> help scantable.get_scan 212 ASAP> help scantable.get_scan # or help(scantable.get_scan) 212 213 ASAP> help scantable.stats 213 214 ASAP> help plotter.plot … … 269 270 270 271 The building block of a scantable is an integration, which is a single 271 row of a scantable. Each row contains spectrafor each beam, IF and272 row of a scantable. Each row contains just one spectrum for each beam, IF and 272 273 polarisation. For example Parkes multibeam data would contain many 273 274 beams, one IF and 2-4 polarisations, while the new Mopra 8-GHz 274 275 filterbank 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 276 polarisations. All of the combinations of Beams/IFs an Polarisations are 277 contained in seperate rows. These rows are grouped in cycles - same time stamp. 278 279 A collection of cyclesfor one source is termed 280 a scan (and each scan has a unique numeric identifier, the ScanNo). A 279 281 scantable 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 one281 (averaged) integration.282 scan-averaged your data in time, i.e. you have averegaed all cycles within 283 a scan, then each scan would hold just one (averaged) integration. 282 284 283 285 Many of the functions which work on scantables can either return a … … 303 305 of the frequency information and possibly how to manipulate it. 304 306 305 These columns are called FreqID and RestFreqID. They contain indices, for306 each IF, pointing into tables with all of the frequency information for that307 in tegration. More on these below when we discuss the \cmd{summary} function308 in the next subsection.307 These columns are called FreqID and MoleculeID. They contain indices, for 308 each IF, pointing into tables with all of the frequency and rest-frequency 309 information for that integration. More on these below when we discuss 310 the \cmd{summary} function in the next subsection. 309 311 310 312 There 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. 313 the flags, the Tsys, the source names and so on. 313 314 314 315 There is also a function \cmd{summary} to list a summary of the scantable. … … 320 321 ASAP> scans = scantable('MyData.rpf') 321 322 ASAP> scans.summary() # Brief listing 322 ASAP> scans.summary(verbose=True) # Include frequency information323 323 324 324 # Equivalent to brief summary function call … … 326 326 \end{verbatim} 327 327 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. 328 The summary function gives you a scan-based summary, presenting the 329 scantable as a cascading view od Beams and IFs. 339 330 340 331 \subsection{Data Selection} … … 344 335 IF, beam, polarisation, scan number as well as values such as 345 336 Tsys. Advanced users can also make use of the AIPS++ TAQL language to 346 create selections based on almost any of the standard header values.337 create selections based on almost any of the values recorded. 347 338 348 339 Selection is based on a \cmd{selector} object. This object is created … … 369 360 \item[\cmd{set\_polarisation}] Select but polarisation index or 370 361 name. 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. 362 converted (for example from linears to Stokes). 373 363 \item[\cmd{set\_query}] Set query directly. For power users only! 374 364 \item[\cmd{set\_tsys}] Select data based on Tsys. Also example of user … … 418 408 (e.g. LSRK), Doppler (e.g. OPTICAL) and unit (e.g. km/s) on-the-fly. 419 409 This is important, for example, when you are displaying the data or 420 fitting to it. 410 fitting to it. The reference frame is set on file read to the value 411 set in the user \cmd{.asaprc} file. 421 412 422 413 For units, the user has the choice of frequency, velocity or channel. … … 573 564 \section{Data Input} 574 565 575 \index{Reading data}Data can be loaded in one of two ways; using the reader object or via576 the scantable constructor. The scantable method is simpler but the 577 reader allowthe user more control on what is read.566 \index{Reading data}Data can be loaded in one of two ways; using the 567 reader object or via the scantable constructor. The scantable method 568 is simpler but the reader allows the user more control on what is read. 578 569 579 570 \subsection{Scantable constructor} … … 615 606 ASAP> r.summary() 616 607 ASAP> scan = r.read() 617 ASAP> s = r.read(range(100)) # To read in the first 100 integrations618 608 ASAP> del r 619 609 \end{verbatim} … … 635 625 \begin{verbatim} 636 626 ASAP> q = s.auto_quotient() 627 \end{verbatim} 628 629 By default the quotient spectra is calculated 630 to preserve continuum emission. If you wish to remove the continuum 631 contribution, use the \cmd{preserve} argument: 632 633 \begin{verbatim} 634 ASAP> q = s.auto_quotient(preserve=True) 637 635 \end{verbatim} 638 636 … … 670 668 %rows in scantable \cmd{s}. Scantable \cmd{r} must have either 1 row 671 669 %(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. 679 671 680 672 \subsection{Time average separate scans} … … 729 721 \begin{verbatim} 730 722 ASAP> msk = scans.create_mask([100,400],[600,900]) 731 ASAP> scans.poly_baseline(msk, 1)723 ASAP> scans.poly_baseline(msk, order=1) 732 724 \end{verbatim} 733 725 … … 766 758 # Only fit a given region around the line 767 759 ASAP> scans.set_unit('km/s') 768 ASAP> msk = scans.create_mask( (-60,-20))760 ASAP> msk = scans.create_mask([-60,-20]) 769 761 ASAP> scans.auto_poly_baseline(mask=msk,order=3,threshold=3) 770 762 … … 799 791 800 792 \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') 802 794 # Or in two steps 803 ASAP> scans = scantable( ('2004-11-23_1841-P484.rpf')795 ASAP> scans = scantable('2004-11-23_1841-P484.rpf') 804 796 ASAP> scans.set_fluxunit('Jy) 805 797 \end{verbatim} … … 989 981 ASAP> scans.save('myscans') # Save in default format 990 982 ASAP> scans.save('myscans', 'FITS') # Save as FITS for exporting into CLASS 991 992 ASAP> scans.save('myscans', stokes=True) # Convert raw polarisations into Stokes993 983 ASAP> scans.save('myscans', overwrite=True) # Overwrite an existing file 994 984 \end{verbatim} … … 1044 1034 your own sanity) you need to select a subset of this data. This is 1045 1035 particularly true for multibeam or multi IF data. The selector object 1046 should be used for this purpose. Selection can either be appli deto1036 should be used for this purpose. Selection can either be applied to 1047 1037 the scantable or directly to the plotter, the end result is the same. 1038 You don't have to reset the scantable slection though, if you set 1039 the selection on the plotter. 1048 1040 1049 1041 Examples: … … 1130 1122 \begin{verbatim} 1131 1123 ASAP> plotter.save('myplot.ps') 1124 ASAP> plotter.save('myplot.png', dpi=80) 1132 1125 \end{verbatim} 1133 1126 … … 1140 1133 \cmd{auto\_fit} function. If single value fitting is used, and the 1141 1134 current selection includes multiple spectra (beams, IFs, scans etc) 1142 then the first spectr ain the scantable will be used for fitting.1135 then the first spectrum in the scantable will be used for fitting. 1143 1136 1144 1137 \begin{verbatim} … … 1147 1140 ASAP> f.set_scan(scans) 1148 1141 ASAP> selection = selector() 1149 ASAP> selection.set_polarisation (1) # Fit the second polarisation1142 ASAP> selection.set_polarisations(1) # Fit the second polarisation 1150 1143 ASAP> scans.set_selection(selection) 1151 1144 ASAP> scans.set_unit('km/s') # Make fit in velocity units … … 1230 1223 \index{Polarisation}Currently ASAP only supports polarmetric analysis 1231 1224 on linearly polarised feeds and the cross polarisation products 1232 measured. Other cases will be added on an as needed basi c.1225 measured. Other cases will be added on an as needed basis. 1233 1226 1234 1227 Conversions of linears to Stokes or Circular polarisations are done … … 1297 1290 ASAP> selection = selector() 1298 1291 1299 ASAP> selection.set_polarisations( [``I Q U V''])1292 ASAP> selection.set_polarisations(``I Q U V'') 1300 1293 ASAP plotter.set_selection(selection); # Select I, Q, U \& V 1301 1294 1302 ASAP> selection.set_polarisations( [``I Q'')1295 ASAP> selection.set_polarisations(``I Q'') 1303 1296 ASAP plotter.set_selection(selection); # Select just I \& Q 1304 1297 1305 ASAP> selection.set_polarisations( [``RR LL'')1298 ASAP> selection.set_polarisations(``RR LL'') 1306 1299 ASAP plotter.set_selection(selection); # Select just RR \& LL 1307 1300 1308 ASAP> selection.set_polarisations( [``XX YY'')1301 ASAP> selection.set_polarisations(``XX YY'') 1309 1302 ASAP plotter.set_selection(selection); # Select linears 1310 1303 1311 ASAP> selection.set_polarisations( [``I Plinear'')1304 ASAP> selection.set_polarisations(``I Plinear'') 1312 1305 ASAP plotter.set_selection(selection); # Fractional linear 1313 1306 1314 1307 [[MALTE: This does not work]] 1315 1308 1316 ASAP> selection.set_polarisations( [``Pangle'')1309 ASAP> selection.set_polarisations(``Pangle'') 1317 1310 ASAP plotter.set_selection(selection); # Position angle 1318 1311 … … 1339 1332 directly on scantables from the command line using the \cmd{+, -, *, 1340 1333 /} operators as well as their cousins \cmd{+=, -= *=, /=}. This works 1341 between two scantables ora scantable and a float. (Note that it does1334 between a scantable and a float. (Note that it does 1342 1335 not work for integers). 1343 1336 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 1347 1339 % ASAP> sum = scan1+scan2 1340 \begin{verbatim} 1348 1341 ASAP> scan2 = scan1+2.0 1349 1342 ASAP> scan *= 1.05 … … 1464 1457 1465 1458 selection = selector() 1466 selection.set_polarisation (0)1459 selection.set_polarisations(0) 1467 1460 data.set_selection(selection) 1468 1461 data.scale(xtsys/nomtsys) 1469 1462 1470 selection.set_polarisation (1)1463 selection.set_polarisations(1) 1471 1464 data.set_selection(selection) 1472 1465 data.scale(ytsys/nomtsys) 1473 1466 1474 selection.set_polarisation (0)1467 selection.set_polarisations(0) 1475 1468 data.set_selection(selection) 1476 1469 data.scale((xtsys+ytsys)/(2*nomtsys)) 1477 1470 1478 selection.set_polarisation (0)1471 selection.set_polarisations(0) 1479 1472 data.set_selection(selection) 1480 1473 data.scale((xtsys+ytsys)/(2*nomtsys)) … … 1529 1522 1530 1523 # Correct for the Tsys using our predefined function 1531 execfile('mypol.py') # Read in the function 1524 execfile('mypol.py') # Read in the function xyscale 1532 1525 xyscale(g351_5,23.2,22.7) # Execute it on the data 1533 1526 xyscale(g351_7,23.2,22.7) … … 1591 1584 1592 1585 # Seperate data from the (1,1)&(2,2) and (4,4) transitions 1593 g1 = q.get_scan(range(6)) # Rows 0..51594 g2 = q.get_scan(range(6,12)) # Rows 6..111586 g1 = q.get_scan(range(6)) # scans 0..5 1587 g2 = q.get_scan(range(6,12)) # scans 6..11 1595 1588 1596 1589 # Align data in velocity … … 1771 1764 \subsection{.asaprc settings} 1772 1765 \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} 1774 1767 1775 1768 \asaprc{insitu}{{\bf True}/False}{Apply operations on the input … … 1808 1801 \asaprc{scantable.freqframe}{{\bf LSRK} TOPO BARY etc}{default 1809 1802 frequency 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} 1803 called or the data is imported} 1816 1804 1817 1805 \subsection{Installation}
Note:
See TracChangeset
for help on using the changeset viewer.