Changeset 770
- Timestamp:
- 12/05/05 11:30:12 (19 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/install.sh
r756 r770 1 1 #!/bin/sh 2 2 3 pypath=/usr/local/lib/python2.3 3 prefix=/usr/local 4 pypath=${prefix}/lib/python2.3 5 base=`pwd` 4 6 5 7 if [ ! -d ${pypath} ]; then … … 18 20 cp bin/asap /usr/local/bin 19 21 fi 22 23 if [ ! -d ${prefix}/share/asap ]; then 24 echo "creating asap data directory" 25 mkdir ${prefix}/share/asap 26 fi 27 28 cp share/ipythonrc-asap /usr/local/share/asap/ 29 20 30 if [ -d /usr/local/share/asap/data ]; then 21 31 echo "removing old data directory" … … 23 33 fi 24 34 25 echo "installing asap data directory" 26 cp -rf data /usr/local/share/asap 35 echo "extracting and installing asap data directory" 36 cd /usr/local/share/asap 37 tar jxf ${base}/share/data.tar.bz2 38 echo "The asap python module has been installed in" 39 echo " ${pypath}/site-packages" 40 echo "asap data is in ${prefix}/share/asap" -
trunk/doc/README
r732 r770 15 15 ======= 16 16 17 To install simply run 18 ./ install.sh17 To install simply run (as root or 'sudo') 18 ./bin/install.sh 19 19 which will install asap into /usr/local 20 20 -
trunk/doc/cookbook.tex
r738 r770 1 1 \documentclass[11pt]{article} 2 2 \usepackage{a4} 3 \usepackage{calc} 3 4 \usepackage[dvips]{graphicx} 4 5 … … 11 12 \setlength{\parskip}{1ex} 12 13 13 14 \title{ATNF Spectral Analysis Package\\Cookbook } 14 \title{ATNF Spectral Analysis Package\\User Guide } 15 15 \author{Chris Phillips} 16 16 17 18 17 \newcommand{\cmd}[1]{{\tt #1}} 18 19 \newcommand{\asaprc}[3]{ 20 \begin{minipage}[t]{45mm}#1\end{minipage} 21 \begin{minipage}[t]{30mm}\raggedright #2\end{minipage}\hspace{3mm} 22 \begin{minipage}[t]{\textwidth-75mm}#3\end{minipage} 23 } 19 24 20 25 \begin{document} … … 26 31 ASAP is a single dish spectral line processing package currently being 27 32 developed by the ATNF. It is intended to process data from all ATNF 28 antennas, and can probably be used for other ant nnas if they can33 antennas, and can probably be used for other antennas if they can 29 34 produce ``Single Dish FITS'' format. It is based on the AIPS++ 30 35 package. … … 45 50 \end{itemize} 46 51 47 To start asap log onto one of these Linux hosts and 52 To start asap log onto one of these Linux hosts and enter 48 53 49 54 \begin{verbatim} … … 87 92 There can be many objects of the same type. Each object is referred to 88 93 by a variable name made by the user. The name of this variable is not 89 important and can be set to whatever the user prefers (i e``s'' and94 important and can be set to whatever the user prefers (i.e. ``s'' and 90 95 ``ParkesHOH-20052002'' are equivalent). However, having a simple and 91 96 consistent naming convention will help you a lot. … … 113 118 ASAP> av = scans(msk,weight='tsys') 114 119 ASAP> av = scans(mask=msk,weight='tsys') 115 ASAP> av = scans(msk, True)120 ASAP> av = scans(msk,tsys) 116 121 ASAP> scans.polybaseline(mask=msk, order=0, insitu=True) 117 122 ASAP> scans.polybaseline(msk,0,True) … … 128 133 \subsection{Interactive environment} 129 134 130 ipython has a number of useful interactive features and a few things to be aware131 of for the new user.135 ipython has a number of useful interactive features and a few things 136 to be aware of for the new user. 132 137 133 138 \subsubsection{String completion} … … 157 162 fail with an syntax error. 158 163 164 \subsubsection{Variable Names} 165 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. 171 159 172 \subsubsection{Unix Interaction} 160 173 … … 221 234 scantable.save : 'ASAP' 222 235 223 224 236 # default frequency frame to set when function 225 237 # scantable.set_freqframe is called … … 229 241 scantable.autoaverage : True 230 242 \end{verbatim} 243 244 For a complete list of \cmd{.asaprc} values, see the appendix. 231 245 232 246 \section{Scantables} … … 340 354 341 355 Examples are the selection of beam, IF and polarisation, spectral unit 342 (e.g. km/s) frequency reference frame (e.g. BARY) and velocity Doppler356 (e.g. km/s), frequency reference frame (e.g. BARY) and velocity Doppler 343 357 type (e.g. RADIO). 344 358 … … 405 419 406 420 \begin{verbatim} 407 # Select for specified source/IF 408 ASAP> scans.set_restfreqs(freqs=1.667359e9, source='NGC253', theif=0) 409 410 # Select for all sources and IFs 411 ASAP> scans.set_restfreqs(freqs=1.667359e9) 412 \end{verbatim} 413 421 # Set rest frequency for all IFs 422 ASAP> scans.set_restfreqs(freqs=[1.6654018e9,1.667359e9,]) 423 424 \end{verbatim} 414 425 415 426 In both of the above modes, you can also specify the rest frequencies via … … 422 433 ASAP> scans.set_restfreqs(lines=['OH1665','OH1667']) 423 434 \end{verbatim} 424 425 435 426 436 … … 581 591 %How and when? 582 592 \subsection{Auto quotient} 583 Quotients can becomputed ``automatically''. This requires the data to have matching source/reference pairs or one refrence for multiple sources. 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. 584 598 585 599 \begin{verbatim} … … 645 659 646 660 The default is to use integration time weighting. The alternative is 647 to use none, variance 661 to use none, variance, Tsys weighting or Tsys \& integration time. 648 662 649 663 \begin{verbatim} … … 675 689 676 690 The function \cmd{auto\_poly\_baseline} can be used to automatically 677 baseline your data with out having to specify channel ranges for678 the line free data. It automatically figures out the line-free 679 emission and fits a polynomial baseline to that data. The user can use 680 masks to fix the range of channels or velocity range for the fitas681 well asmark the band edge as invalid.691 baseline your data without having to specify channel ranges for the 692 line free data. It automatically figures out the line-free emission 693 and fits a polynomial baseline to that data. The user can use masks to 694 fix the range of channels or velocity range for the fit as well as 695 mark the band edge as invalid. 682 696 683 697 Simple example … … 727 741 \subsubsection{Brightness Units} 728 742 729 RPFITS files to not contain any information as to whether the telescope743 RPFITS files do not contain any information as to whether the telescope 730 744 calibration was in units of Kelvin or Janskys. On reading the data a 731 745 default value is set depending on the telescope and frequency of … … 772 786 As higher frequencies (particularly $>$20~GHz) it is important to make 773 787 corrections for atmospheric opacity and gain-elevation effects. 788 789 {\em Note that currently the elevation is not written correctly into 790 Tidbinbilla rpfits files. This means that gain-elevation and opacity 791 corrections will not work until a work around is implemented.} 774 792 775 793 Gain-elevation curves for some telescopes and frequencies are known to … … 819 837 \cmd{perif} argument. By default it will align each source and freqid 820 838 separately. This is needed for scan tables containing multiple 821 sources. However if scan-based Doppler tracking has been made at the observatory,822 each row will have a different freqid. In these cases run with 823 \cmd{perif=True} and all rows of a source will be aligned to the same824 frame. In general \cmd{perif=True} will be needed for most839 sources. However if scan-based Doppler tracking has been made at the 840 observatory, each row will have a different freqid. In these cases run 841 with \cmd{perif=True} and all rows of a source will be aligned to the 842 same frame. In general \cmd{perif=True} will be needed for most 825 843 observations as Doppler tracking of some form is made at Parkes, Tid 826 844 and Mopra. … … 927 945 \section{Plotter} 928 946 929 Scantable spectra can be plotte rat any time. An asapplotter object is947 Scantable spectra can be plotted at any time. An asapplotter object is 930 948 used for plotting, meaning multiple plot windows can be active at the 931 949 same time. On start up a default asapplotter object is created called … … 1155 1173 \subsection{Simple Calibration} 1156 1174 1157 {\em Currently the receiver position angle is not stored in the RPFITS 1158 file. This severely hampers correct handling of polarimetry. In the future 1159 we aim to define a general framework and populate the RPFITS files 1160 with the data required for transparent polarimetric calibration.} 1175 {\em Currently the receiver position angle is not read from the RPFITS 1176 file and a position angle of zero is assumed. This severely hampers 1177 correct handling of polarimetry. In the future we aim to define a 1178 general framework and populate the RPFITS files with the data required 1179 for transparent polarimetric calibration.} 1161 1180 1162 1181 It is possible that there is a phase offset between polarisation which … … 1199 1218 1200 1219 \begin{verbatim} 1201 ASAP> plotter.set_cursor(pol= [``I'',''Q'']1202 ASAP> plotter.set_cursor(pol= [``RR'',''LL'']1203 ASAP> plotter.set_cursor(pol= [``XX'',''YY'']1204 ASAP> plotter.set_cursor(pol= [``I'',''Plinear'']1220 ASAP> plotter.set_cursor(pol=``I Q'') 1221 ASAP> plotter.set_cursor(pol=``RR LL'') 1222 ASAP> plotter.set_cursor(pol=``XX YY'') 1223 ASAP> plotter.set_cursor(pol=``I Plinear'') 1205 1224 \end{verbatim} 1206 1225 … … 1220 1239 \end{verbatim} 1221 1240 1222 \section{Function Summary} 1241 1242 \section{Scantable Mathematics} 1243 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). 1248 1249 \begin{verbatim} 1250 ASAP> sum = scan1+scan2 1251 ASAP> scan2 = scan1+2.0 1252 ASAP> scan *= 1.05 1253 \end{verbatim} 1254 1255 \section{Scripting} 1256 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. 1263 1264 \hspace{1cm} http://www.atnf.csiro.au/computing/software/asap/tutorials 1265 \hspace{1cm} http://www.python.org/doc/Introduction.html 1266 1267 \subsection{Running scripts} 1268 1269 The asap global function \cmd{execfile} reads the named text file and 1270 executes the contained python code. This file can either contain 1271 function definitions which will be used in subsequent processing or 1272 just a set of commands to process a specific dataset. 1273 1274 \subsection{asapuserfuncs.py} 1275 1276 The file $\sim$/.asap/asapuserfuncs.py is automatically read in when 1277 asap is started. The user can use this to define a set of user 1278 functions which are automatically available each time asap is 1279 used. The \cmd{execfile} function can be called from within this file. 1280 1281 \section{Worked examples} 1282 1283 In the following section a few examples of end-to-end processing of 1284 some data in asap are given. 1285 1286 \subsection{Mopra} 1287 1288 \subsection{Parkes Polarimetry} 1289 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: 1299 1300 \begin{verbatim} 1301 def xyscale(data,xtsys=1.0,ytsys=1.0,nomtsys=25.0) : 1302 1303 data.set_cursor(pol=0) 1304 data.scale(xtsys/nomtsys,allaxes=False) 1305 1306 data.set_cursor(pol=1) 1307 data.scale(ytsys/nomtsys,allaxes=False) 1308 1309 data.set_cursor(pol=2) 1310 data.scale((xtsys+ytsys)/(2*nomtsys),allaxes=False) 1311 1312 data.set_cursor(pol=3) 1313 data.scale((xtsys+ytsys)/(2*nomtsys),allaxes=False) 1314 \end{verbatim} 1315 1316 The typical asap session would be 1317 1318 \begin{verbatim} 1319 1320 # Remind ourself the name of the rpfits files 1321 ls 1322 1323 # Load data from an rpfits file 1324 d1665 = scantable('2005-10-27_0154-P484.rpf') 1325 1326 # Check what we have just loaded 1327 d1665.summary 1328 1329 # View the data in velocity 1330 d1665.set_unit('km/s') 1331 d1665.set_freqframe('LSRK') 1332 1333 # Correct for the known phase offset in the crosspol data 1334 d1665.rotate_xyphase(-4) 1335 1336 # Create a copy of the data and set the rest frequency to the 1667 MHz 1337 # transition 1338 d1667 = d1665.copy() 1339 d1667.set_restfreqs(lines=['OH1667']) 1340 d1667.summary 1341 1342 # Copy out the scan we wish to process 1343 g351_5 = d1665.get_scan('351p160') 1344 g351_7 = d1667.get_scan('351p160') 1345 1346 # Plot the data 1347 plotter.plot(g351_5,g351_7) # Only shows one panel 1348 1349 # Tell the plotter to stack polarisation and panel scans 1350 plotter.set_mode('p','s') 1351 1352 # Correct for the Tsys using our predefined function 1353 execfile('mypol.py') # Read in the function 1354 xyscale(g351_5,23.2,22.7) # Execute it on the data 1355 xyscale(g351_7,23.2,22.7) 1356 1357 # Only plot the velocity range of interest 1358 plotter.set_range(-30,10) 1359 1360 # Baseline the data 1361 msk = g351_5.create_mask([-20,-15],[0,5]) 1362 g351_5.poly_baseline(msk,1) 1363 msk = g351_7.create_mask([-20,-15],[0,5]) 1364 g351_7.poly_baseline(msk,1) 1365 1366 # Update the plot with the baselined data 1367 plotter.plot() 1368 1369 # Look at the various polarisation products 1370 plotter.set_cursor(pol='RR LL') 1371 plotter.set_cursor(pol='I Plinear') 1372 plotter.set_cursor(pol='I Q U V') 1373 1374 # Save the plot as postscript 1375 plotter.save('g361_stokes.ps') 1376 1377 # Save the process spectra 1378 g351_5.save('junk5.asap') 1379 g351_7.save('junk7.asap') 1380 1381 \end{verbatim} 1382 1383 \subsection{Tidbinbilla} 1384 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. 1393 1394 \begin{verbatim} 1395 1396 # Load the rpfits file and inspect 1397 d = scantable('2003-03-16_082048_t0002.rpf') 1398 print d 1399 1400 # Make the quotient spectra 1401 q = d.auto_quotient() 1402 print q 1403 1404 # Plot/select in velocity 1405 q.set_freqframe('LSRK') 1406 q.set_unit('km/s') 1407 1408 # Seperate data from the (1,1)&(2,2) and (4,4) transitions 1409 g1 = q.get_scan(range(6)) # Rows 0..5 1410 g2 = q.get_scan(range(6,12)) # Rows 6..11 1411 1412 # Align data in velocity 1413 g1.freq_align(perif=True) 1414 g2.freq_align(perif=True) 1415 1416 # Average individual scans 1417 a1 = g1.average_time() 1418 a2 = g2.average_time() 1419 1420 # Rpfits file only contrains a single rest frequency. Set both 1421 a1.set_restfreqs(freqs= [23694.4700e6,23722.6336e6]) 1422 1423 plotter.plot(a1,a2) 1424 plotter.set_mode('i','s') 1425 x = raw_input() 1426 1427 a1.auto_poly_baseline() 1428 a2.auto_poly_baseline() 1429 1430 plotter.plot() 1431 1432 a1.smooth('gauss',5) 1433 a2.smooth('gauss',5) 1434 plotter.plot() 1435 1436 \end{verbatim} 1437 1438 \newpage 1439 1440 \section{Appendix} 1441 1442 \subsection{Function Summary} 1223 1443 1224 1444 \begin{verbatim} … … 1341 1561 execfile - execute an asap script, e.g. execfile('myscript') 1342 1562 list_rcparameters - print out a list of possible values to be 1343 put into $HOME/.asaprc1563 put into \$HOME/.asaprc 1344 1564 mask_and,mask_or, 1345 1565 mask_not - boolean operations on masks created with … … 1359 1579 \end{verbatim} 1360 1580 1361 \section{Scantable Mathematics}1362 1363 It is possible to to simple mathematics directly on scantables from1364 the command line using the \cmd{+, -, *, /} operators as well as their1365 cousins \cmd{+=, -= *=, /=}. This works between two scantables or a1366 scantable and a float. (Note that it does not work for integers).1367 1368 \begin{verbatim}1369 ASAP> sum = scan1+scan21370 ASAP> scan2 = scan1+2.01371 ASAP> scan *= 1.051372 \end{verbatim}1373 1374 %\section{Scripting}1375 1376 %Malte to add something1377 1378 \section{Appendix}1379 1380 1581 \subsection{Installation} 1381 1582 … … 1399 1600 \subsection{.asaprc settings} 1400 1601 1602 \asaprc{verbose}{{\bf True}/False}{Print verbose output} 1603 1604 \asaprc{insitu}{{\bf True}/False}{Apply operations on the input 1605 scantable or return new one} 1606 1607 % plotting 1608 1609 \asaprc{useplotter}{{\bf True}/False}{Preload a default plotter} 1610 1611 \asaprc{plotter.gui}{{\bf True}/False}{Do we want a GUI or plot to a 1612 file} 1613 1614 \asaprc{plotter.stacking}{{\bf Pol} Beam IF Scan Time}{Default mode for 1615 colour stacking} 1616 1617 \asaprc{plotter.panelling}{Pol Beam IF {\bf Scan} Time}{Default mode 1618 for panelling} 1619 1620 \asaprc{plotter.ganged}{{\bf True}/False}{Push panels together, to 1621 share axislabels} 1622 1623 \asaprc{plotter.decimate}{True/{\bf False}}{Decimate the number of 1624 points plotted by a factor of nchan/1024} 1625 1626 % default colours/linestyles 1627 %\asaprc{plotter.colours}{.}{.} 1628 %\asaprc{plotter.linestyles{.}{.} 1629 1630 % scantable 1631 \asaprc{scantable.save}{{\bf ASAP} SDFITS FITS ASCII MS2}{Default output 1632 format when saving} 1633 1634 \asaprc{scantable.autoaverage}{{\bf True}/False}{Auto averaging on 1635 read} 1636 1637 \asaprc{scantable.freqframe}{{\bf LSRK} TOPO BARY etc}{default 1638 frequency frame to set when function scantable.set\_freqframe is 1639 called} 1640 1641 \asaprc{scantable.allaxes}{{\bf True}/False}{Apply action to all axes 1642 not just the cursor location} 1643 1644 \asaprc{scantable.plotter}{{\bf True}/False}{Use internal plotter} 1645 1646 \asaprc{scantable.verbosesummary}{True/{\bf False}}{Control the level 1647 of information printed by summary} 1648 1401 1649 \end{document} 1650 -
trunk/web/index.html
r762 r770 44 44 line observations</em>. At this stage it is tuned towards data from 45 45 ATNF instruments and reads/writes <em>rpfits, sdfits and ms</em> data. 46 A release 1.2 of ASAP is available on linux systems at ATNF47 46 <a href="intro.html">more...<a> 47 48 <h2>Current Release</h2> 49 ASAP latest stable version 1.2 was released on November, 30<sup>th</sup> 2005. It can be obtained in the <a href="#download">Download</a> section. 48 50 49 51 <h2>Screenshots</h2> … … 66 68 67 69 <h2>Documentation</h2> 68 ASAP has a cookbook for general use, and a reference manual for people 69 who want to write scripts to reduce and analyse their data. 70 ASAP has a user guide for general use and telescope specific examples, 71 and a reference manual for people who want to write scripts to reduce 72 and analyse their data. 70 73 <ul> 71 74 <li> List of commands <a href="commands.html">(html)</a> </li> 72 <li> Cookbook <a href="cookbook/">(html)</a> or Cookbook <a href="cookbook.pdf">(pdf)</a></li>75 <li> User Guide<a href="userguide/">(html)</a> or User Guide <a href="userguide.pdf">(pdf)</a></li> 73 76 <li> Reference manual <a href="refman/">(html)</a> <a href="refman.pdf">(pdf)</a></li> 74 77 <li><a href="tutorials/">Tutorials</a></li> … … 78 81 <p> 79 82 80 < h2>Download</h2>81 83 <a name="download"><h2>Download</h2></a> 84 ASAP source code and binaries are available in the <a href="http://www.atnf.csiro.au/pub/software/asap/">ATNF ftp area</a> 82 85 <ul> 83 <li> The currentrelease source code snapshot <a86 <li>Current stable release source code snapshot <a 84 87 href="ftp://ftp.atnf.csiro.au/pub/software/asap/asap_src.tar.bz2">asap source</a> </li> 85 <li> A binary tar archive <a88 <li> A binary tar archive of the latest stable release<a 86 89 href=ftp://ftp.atnf.csiro.au/pub/software/asap/asap_linux.tar.bz2>linux binary</a>. 87 90 You will need to have the following libraries:<br> 88 91 gcc-3.3, blas, lapack, g2c, boost_python and of course 89 92 python2.3.<br> 90 The matplotlib python module has to be installed too. 93 The matplotlib python module has to be installed too. 91 94 </li> 92 95 <li>For Mac OSX 10.4 follow <a href="./osx.html">these instructions.</a>
Note:
See TracChangeset
for help on using the changeset viewer.