Changeset 1267
- Timestamp:
- 09/13/06 10:17:00 (18 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SConstruct
r1259 r1267 79 79 env = conf.Finish() 80 80 81 env["version"] = "2.1.0 b2"81 env["version"] = "2.1.0" 82 82 83 83 # general CPPFLAGS -
trunk/doc/userguide.tex
r1259 r1267 48 48 package. 49 49 50 This userguide is beingupdated for the ASAP 2.1. Please report any50 This userguide has been updated for the ASAP 2.1. Please report any 51 51 mistakes you find. 52 52 … … 65 65 66 66 {\em Note. ASAP2.1 only runs on ATNF Linux machines which have been 67 updated to Debian Sarge and are using the ``DEBIAN sarge''67 updated to Debian Sarge and are using the ``DEBIANSarge'' 68 68 /usr/local. If your favourite machine has not been upgraded, send a 69 request your your friendly IT support.} 69 request to your friendly IT support. At the time of writing asap 2.1 70 does not run on hydra, bourbon or kaputar.} 70 71 71 72 \index{Running}To start asap log onto one of these Linux hosts and enter … … 76 77 \end{verbatim} 77 78 78 This starts the ASAP. To quit, you need to type \verb+^+-d79 (control-d) ortype \cmd{\%Exit}.79 This starts ASAP. To quit, you need to type \verb+^+-d (control-d) or 80 type \cmd{\%Exit}. 80 81 81 82 \section{Interface} … … 98 99 main objects are used : 99 100 100 \begin{itemize} 101 \item[\cmd{scantable}] The data container (actual spectra and header 102 information) 103 \item[\cmd{selector}] Allows the user to select a subsection of the 104 data, such as a specified or range of beam numbers, IFs, etc. 105 \item[\cmd{plotter}] A tool used to plot the spectral line data 106 \item[\cmd{fitter}] A tool used to fit functions to the spectral data 107 \item[\cmd{reader}] A tool which can be used to read data from disks 108 into a scantable object (advanced use). 109 \end{itemize} 101 \begin{tabular}{ll} 102 103 \cmd{scantable} & \parbox[t]{0.7\textwidth}{The data container (actual 104 spectra and header information)} \\ 105 \cmd{selector} & \parbox[t]{0.80\textwidth}{Allows the user to select 106 a subsection of the data, such as a specified or range of beam 107 numbers, IFs, etc.} \\ 108 \cmd{plotter} & A tool used to plot the spectral line data \\ 109 \cmd{fitter} & A tool used to fit functions to the spectral data \\ 110 \cmd{reader} & \parbox[t]{0.8\textwidth}{A tool which can be used to 111 read data from disks into a scantable object (advanced use).}\\ 112 \end{tabular} 110 113 111 114 There can be many objects of the same type. Each object is referred to … … 382 385 The common selection functions are: 383 386 384 \begin{itemize} 385 386 \item[\cmd{set\_beams}] Select beams by index number 387 \item[\cmd{set\_ifs}] Select ifs by index number 388 \item[\cmd{set\_name}] Select by source name. Can contain ``*'' as a 389 wildcard, e.g. ``Orion*\_R''. 390 \item[\cmd{set\_ifs}] Select IFs by index number 391 \item[\cmd{set\_polarisation}] Select by polarisation index or 392 name. If polarisation names are given, the data will be on-the-fly 393 converted (for example from linears to Stokes). 394 \item[\cmd{set\_query}] Set query directly. For power users only! 395 \item[\cmd{set\_tsys}] Select data based on Tsys. Also example of user 396 definable query. 397 \item[\cmd{reset}] Reset the selection to include all spectra. 398 387 \begin{tabular}{ll} 388 389 \cmd{set\_beams} & Select beams by index number \\ 390 \cmd{set\_ifs} & Select ifs by index number \\ 391 \cmd{set\_name} & Select by source name. Can contain ``*'' as a 392 wildcard, e.g. ``Orion*\_R''. \\ 393 \cmd{set\_ifs} & Select IFs by index number \\ 394 395 \cmd{set\_polarisation} & \parbox[t]{0.73\textwidth}{Select by 396 polarisation index or name. If polarisation names are given, the data 397 will be on-the-fly onverted (for example from linears to Stokes). }\\ 398 399 \cmd{set\_query} & Set query directly. For power users only! \\ 400 \cmd{set\_tsys} & Select data based on Tsys. Also example of user 401 definable query. \\ 402 \cmd{reset} & Reset the selection to include all spectra. \\ 403 404 \end{tabular} 399 405 400 406 Note that all indices are zero based. … … 418 424 419 425 \end{verbatim} 420 421 \end{itemize}422 426 423 427 \subsection{State} … … 493 497 \end{verbatim} 494 498 495 {\em Currently the following is not implemented 496 497 In both of the above modes, you can also specify the rest frequencies via 498 names in a known list rather than by their values. 499 500 Examples: 501 502 \begin{verbatim} 503 ASAP>scans.set_restfreqs(freqs=['OH1665','OH1667']) 504 \end{verbatim} 505 } 499 A predetermined ``line catalog'' can be used to set the rest 500 frequency. See section \S \ref{sec:linecat}. 501 506 502 507 503 \subsubsection{Masks} … … 1113 1109 zooming the individual plots). From left to right: 1114 1110 1115 \begin{itemize} 1116 1117 \item[Home] This will unzoom the plots to the original zoom factor 1118 1119 \item[Plot history] (left and right arrow). The plotter keeps a 1120 history of zoom settings. The left arrow sets the plot zoom to the 1121 previous value. The right arrow returns back again. This allows you, 1122 for example, to zoom in on one feature then return the plot to how it 1123 was previously. 1124 1125 \item[Pan] (The Cross) This sets the cursor to pan, or scroll mode 1126 allowing you to shift the plot within the window. Useful when 1127 zoomed in on a feature. 1128 1129 \item[Zoom] (the letter with the magnifying glass) lets you draw a 1130 rectangle around a region of interest then zooms in on that 1131 region. Use the plot history to unzoom again. 1132 1133 \item[Adjust] (rectangle with 4 arrows) adjust subplot parameters 1134 (space at edge of plots) 1135 1136 \item[Save] (floppy disk). Save the plot as a postscript or .png file 1111 \begin{tabular}{ll} 1112 1113 Home & This will unzoom the plots to the original zoom factor \\ 1114 1115 Plot history & \parbox[t]{0.8\textwidth}{(left and right arrow) The 1116 plotter keeps a history of zoom settings. The left arrow sets the plot 1117 zoom to the previous value. The right arrow returns back again. This 1118 allows you, for example, to zoom in on one feature then return the 1119 plot to how it was previously. }\\ 1120 1121 Pan & \parbox[t]{0.8\textwidth}{(The Cross) This sets the cursor to 1122 pan, or scroll mode allowing you to shift the plot within the 1123 window. Useful when zoomed in on a feature. }\\ 1124 1125 Zoom & \parbox[t]{0.8\textwidth}{(the letter with the magnifying 1126 glass) lets you draw a rectangle around a region of interest then 1127 zooms in on that region. Use the plot history to unzoom again.}\\ 1128 1129 Adjust & \parbox[t]{0.8\textwidth}{(rectangle with 4 arrows) adjust 1130 subplot parameters (space at edge of plots)}\\ 1131 1132 Save & \parbox[t]{0.8\textwidth}{(floppy disk). Save the plot as a 1133 postscript or .png file}\\ 1134 1135 \end{tabular} 1137 1136 1138 1137 You can also type ``g'' in the plot window to toggle on and off grid 1139 1138 lines. Typing 'l' turns on and off logarithmic Y-axis. 1140 1141 \end{itemize}1142 1139 1143 1140 \subsection{Other control} … … 1228 1225 \bigcommanddef{arrow(x,y,x+dx,y+dy)}{Draw an arrow from a specified 1229 1226 \cmd{(x,y)} position to \cmd{(x+dx, y+dy)}. The values are in world 1230 coordinates. \em {HOW TO SET ARROW HEAD??}}{1231 ASAP>plotter.arrow(-40,7,35,0 )1227 coordinates. Addition arguments which must be passed are {\cmd head\_width} and \cmd{head\_length}}{ 1228 ASAP>plotter.arrow(-40,7,35,0,head\_width=0.2, head\_length=10) 1232 1229 } 1233 1230 … … 1235 1232 specified \cmd{y} position (in world coordinates) between xmin and xmax 1236 1233 (in relative coordinates, i.e. 0.0 is the left hand edge of the plot 1237 while 1.0 is the right side of the plot .}{1234 while 1.0 is the right side of the plot).}{ 1238 1235 ASAP>plotter.axhline(6.0,0.2,0.8) 1239 1236 } … … 1265 1262 } 1266 1263 1267 1268 1269 1264 These functions all take a set of \cmd{kwargs} commands. These can be 1270 1265 used to set colour, linewidth fontsize etc. These are standard … … 1272 1267 1273 1268 \begin{tabular}{ll} 1274 \tt color 1275 \tt linewidth \\1269 \tt color, facecolor, edgecolor \\ 1270 \tt width, linewidth \\ 1276 1271 \tt fontsize \\ 1277 1272 \tt fontname & Sans, Helvetica, Courier, Times etc\\ … … 1287 1282 1288 1283 \section{Line Catalog} 1289 1290 \index{Linecatalog}ASAP can load and manipulate line catlogs to retrieve rest frequencies 1291 for \cmd{set\_restfreqs} and for line identification in the 1292 plotter. No line catalogs are built into ASAP, the user must load a 1293 ASCII based table (which can optionally be saved in an internal 1294 format) either of the users own creation or a standard line catalog 1295 such as the JPL line catalog or Lovas. The ATNF asap ftp area as 1296 copies of the JPL and Lovas catalog in the appropriate format. All 1297 line catalogs are loaded into a ``linecatalog'' object. 1284 \label{sec:linecat} 1285 \index{Linecatalog}ASAP can load and manipulate line catlogs to 1286 retrieve rest frequencies for \cmd{set\_restfreqs} and for line 1287 identification in the plotter. All line catalogs are loaded into a ``linecatalog'' object. 1288 1289 No line catalogs are built into ASAP, the user must load a ASCII based 1290 table (which can optionally be saved in an internal format) either of 1291 the users own creation or a standard line catalog such as the JPL line 1292 catalog or Lovas. The ATNF asap ftp area as copies of the JPL and 1293 Lovas catalog in the appropriate format: 1294 1295 \hspace{1cm}\cmd{ftp://ftp.atnf.csiro.au/pub/software/asap/data} 1296 1298 1297 1299 1298 \subsection{Loading a Line Catalog} 1300 1299 1301 \index{Linecatalog |loading}The ASCII text line catalog must have at1300 \index{Linecatalog!loading}The ASCII text line catalog must have at 1302 1301 least 4 columns. The first four columns must contain (in order): 1303 1302 Molecule name, frequency in MHz, frequency error and ``intensity'' … … 1330 1329 \end{verbatim} 1331 1330 1331 {\em NOTE:} Due to a bug in ipython, if you do not \cmd{del} the 1332 linecatalog table before quiting asap, you will be left with temporary 1333 files. It is safe to delete these once asap has finished. 1334 1332 1335 \subsection{Line selection} 1333 1336 1334 \index{Linecatalog |line selection}The linecatalog has a number of1337 \index{Linecatalog!line selection}The linecatalog has a number of 1335 1338 selection functions to select a range of lines from a larger catalog 1336 1339 (the JPL catalog has $>$180000 lines for 1337 1340 example). \cmd{set\_frequency\_limits} selects on frequency range, 1338 1341 \cmd{set\_strength\_limits} selects on intensity while \cmd{set\_name} 1339 selects on molecule name (wild cards allowed). 1342 selects on molecule name (wild cards allowed). The \cmd{summary} 1343 function lists the currently selected lines. 1340 1344 1341 1345 \begin{verbatim} … … 1359 1363 \subsubsection{Plotting linecatalog} 1360 1364 1361 \index{Linecatalog |plotting}1365 \index{Linecatalog!plotting} 1362 1366 1363 1367 The plotter \cmd{plot\_lines} function takes a line catalog as an … … 1380 1384 1381 1385 ASAP>plotter.plot() # Reset plotter 1382 ASAP>plotter.plot_lines(jpl,doppler=-10,location='Top') # On top with -10 km/s velocity 1386 ASAP>plotter.plot_lines(jpl,doppler=-10,location='Top') 1387 # On top with -10 km/s velocity 1383 1388 \end{verbatim} 1384 1389 1385 1390 \subsubsection{Setting Rest Frequencies} 1386 1391 1387 \index{Linecatalog|set_restfreq} 1392 \index{Linecatalog!set\_restfreq}A linecatalog can be used as an 1393 argument for \cmd{set\_restfreqs}. If a personal line catalog has been 1394 used (which has the same size as the number of number of IFs) or 1395 linecatalog selection has been used to reduce the number of entries, 1396 the line catalog can be used directly as an argument to 1397 \cmd{set\_restfreqs}, e.g.: 1398 \begin{verbatim} 1399 ASAP>jpl = linecatalog('jpl.tbl') 1400 ASAP>jpl.set_frequency_limits(23.66,23.75,'GHz') 1401 ASAP>data = scantable('data.rpf') 1402 ASAP>data.set_restfreqs(jpl) 1403 \end{verbatim} 1404 1405 If a larger linecatalog is used, individual elements can be used. Use 1406 the \cmd{summary} to get the index number of the rest frequency you 1407 wish to use. E.g.: 1408 1409 \begin{verbatim} 1410 ASAP>jpl.summary() 1411 ASAP>data.set_restfreqs([jpl[11],[jpl[21]]) 1412 \end{verbatim} 1413 1414 For data with many IFs, such as from MOPS, the user it is recommended 1415 that the user creates their own line cstalog for the data and use this 1416 to set the rest frequency for each IF. 1388 1417 1389 1418 \section{Fitting} … … 1645 1674 1646 1675 \subsection{Disk Based Processing} 1647 \index{Scantable |disk based}1648 1649 Normally scantables exis it entirely in memory during an ASAP1650 session. This has the ad tantage of speed, but causes limits on the1676 \index{Scantable!disk based} 1677 1678 Normally scantables exist entirely in memory during an ASAP 1679 session. This has the advantage of speed, but causes limits on the 1651 1680 size of the dataset which can be loaded. ASAP can use ``disk based'' 1652 scan tables which 1681 scan tables which cache the bulk of the scantable on disk and require 1682 significantly less memory usage. 1683 1684 To use disk based tables you either need to change the default in your 1685 \cmd{.asapr} file, e.g. 1686 \begin{verbatim} 1687 scantable.storage : disk 1688 \end{verbatim} 1689 1690 or use set the ``\cmd{rc}'' value while running asap to change this 1691 on-the-fly. E.g. 1692 \begin{verbatim} 1693 ASAP>rc('scantable',storage='disk') 1694 ASAP>data = scantable('data.rpf') # Loaded using disk based table 1695 ASAP>rc('scantable',storage='memory') # Memory tables will be used now 1696 \end{verbatim} 1697 1698 Changing the ``\cmd{rc}'' value affects the next time the 1699 \cmd{scantable} constructor is called. 1653 1700 1654 1701 {\bf NOTE: } Currently a bug in ipython means temporary files are not 1655 1702 cleaned up properly when you exit ASAP. If you use disk based scan 1656 tables your directory will be left with 't mp*' directories. These can1703 tables your directory will be left with 'tabXXXXX\_X' directories. These can 1657 1704 be safely removed if ASAP is not running. 1658 1705 … … 1773 1820 1774 1821 \index{Parkes}\index{Polarisation}The following example is processing 1775 of some Parkes polar metric observations of OH masers at1822 of some Parkes polarimetric observations of OH masers at 1776 1823 1.6~GHz. Because digital filters where used in the backend, the 1777 1824 baselines are stable enough not to require a quotient spectra. The … … 1949 1996 \index{Functions!summary}% 1950 1997 \begin{verbatim} 1951 1952 [The scan container] 1998 [The scan container] 1953 1999 scantable - a container for integrations/scans 1954 2000 (can open asap/rpfits/sdfits and ms files) … … 1976 2022 get_abcissa - get the abcissa values and name for a given 1977 2023 row (time) 2024 get_column_names - get the names of the columns in the scantable 2025 for use with selector.set_query 1978 2026 set_freqframe - set the frame info for the Spectral Axis 1979 2027 (e.g. 'LSRK') … … 1990 2038 set_restfreqs - set a list of rest frequencies 1991 2039 flag - flag selected channels in the data 1992 lag_flag - flag specified frequency in the data1993 2040 save - save the scantable to disk as either 'ASAP', 1994 2041 'SDFITS' or 'ASCII' … … 2033 2080 [Selection] 2034 2081 selector - a selection object to set a subset of a scantable 2035 set_scans - set (a list of) scans by index 2036 set_cycles - set (a list of) cycles by index 2082 set_cycles - set (a list of) cycles by index 2037 2083 set_beams - set (a list of) beamss by index 2038 2084 set_ifs - set (a list of) ifs by index … … 2041 2087 set_names - set a selection by name (wildcards allowed) 2042 2088 set_tsys - set a selection by tsys thresholds 2089 set_query - set a selection by SQL-like query, e.g. BEAMNO==1 2043 2090 reset - unset all selections 2044 2091 + - merge to selections … … 2111 2158 arrow - draw arrow annotations either in data or relative 2112 2159 coordinates 2113 set_abcissa - specify a user label for the abcissa 2114 set_ordinate - specify a user label for the ordinate 2115 set_layout - specify the multi-panel layout (rows,cols) 2116 set_colors - specify a set of colours to use 2117 set_linestyles - specify a set of linestyles to use if only 2118 using one color 2119 set_font - set general font properties, e.g. 'family' 2120 set_histogram - plot in historam style 2121 set_mask - set a plotting mask for a specific polarization 2122 text - draw text annotations either in data or relative 2123 coordinates 2160 axhline,axvline - draw horizontal/vertical lines 2161 axhspan,axvspan - draw horizontal/vertical regions 2162 2163 xyplotter - matplotlib/pylab plotting functions 2164 2165 [Reading files] 2166 reader - access rpfits/sdfits files 2124 2167 arrow - draw arrow annotations either in data or relative 2125 2168 coordinates … … 2183 2226 histogram rather than lines.} 2184 2227 2185 {\em MALTE TO FIX}2186 2187 2228 \asaprc{plotter.colours}{}{Set default colours for plotting} 2188 2229 … … 2210 2251 \subsection{Installation} 2211 2252 2212 \index{Installation}ASAP depends on a number of third-party libraries which you must 2213 have installed before attempting to build ASAP. These are: 2214 2215 \begin{itemize} 2216 \item AIPS++ 2217 \item Boost 2218 \item Matplotlib 2219 \item python/ipython 2220 \end{itemize} 2221 2222 Debian Linux is currently supported and we intend also 2223 to support other popular Linux flavours, Solaris and Mac. 2224 2225 Of the dependencies, AIPS++ is the most complex to install. 2253 \index{Installation} 2254 2255 Please refer to the asap wiki for instructions on downloading and/or 2256 building asap from source. 2257 2258 \hspace{1cm}\cmd{http://www.atnf.csiro.au/computing/software/asap/} 2226 2259 2227 2260 \printindex -
trunk/test/file-io.py
r1259 r1267 10 10 11 11 print "Test of file i/o" 12 rc(' plotter', storage='disk')12 rc('scantable', storage='disk') 13 13 data = scantable('data/tid-t002.rpf') 14 14 del data 15 rc(' plotter',storage='memory')15 rc('scantable',storage='memory') 16 16 data = scantable('data/tid-t002.rpf') 17 17
Note:
See TracChangeset
for help on using the changeset viewer.