Spectral Viewer: Difference between revisions
No edit summary |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[Category: CASA Basics]][[Category: Interactive Tools]][[Category: Analysis]] | [[Category: CASA Basics]][[Category: Interactive Tools]][[Category: Analysis]] | ||
__FORCETOC__ | __FORCETOC__ | ||
'''A quick tutorial on how to use the Spectral Profile plotting tool, based on the CASA cookbook''' | <big> '''A quick tutorial on how to use the Spectral Profile plotting tool, based on the CASA cookbook'''</big> | ||
Line 56: | Line 55: | ||
<div style="float: left; width: 50%; align: left;"> | <div style="float: left; width: 50%; align: left;"> | ||
You can change both of these defaults in the two drop-down menus to the bottom right of the spectrum. Here (Figure 4), the data are shown plotted with the RMS error bars. Instead of displaying the mean on the y-axis, you can also view the | You can change both of these defaults in the two drop-down menus to the bottom right of the spectrum. Here (Figure 4), the data are shown plotted with the RMS error bars. Instead of displaying the mean on the y-axis, now we are looking at the median (you can also view the sum, or the flux of in the selected region, but no error bars are available for these quantities). | ||
</div> | </div> | ||
<div style="float: right; width: 50%; text-align: center;"> | <div style="float: right; width: 50%; text-align: center;"> | ||
[[File: | [[File:viewer_new4.png | 300px]] | ||
''Figure 4; Click to enlarge'' | ''Figure 4; Click to enlarge'' | ||
</div> | </div> | ||
|- | |||
|- | |||
| | | | ||
== | == Toolbars == | ||
<div style="float: left; width: 50%; align: left;"> | <div style="float: left; width: 50%; align: left;"> | ||
At the top of the Spectral Profile panel is a toolbar (Figure 5) which allows you to save the spectrum as either a data file (fits/ASCII) or an image. | |||
The toolbar also allows you to pan and zoom the spectrum (you can also do this with your trackpad, sometimes without meaning to!). | |||
One of the most useful buttons is the 'unzoom' button, which resets the spectrum, and allows you to undo any inadvertent panning or zooming. | |||
</div> | </div> | ||
<div style="float: right; width: 50%; text-align: center;"> | <div style="float: right; width: 50%; text-align: center;"> | ||
[[File: | [[File:sviewer_toolbar.png | 300px]] | ||
''Figure 5; Click to enlarge'' | ''Figure 5; Click to enlarge'' | ||
Line 82: | Line 84: | ||
|- style="background-color:#eeeeee;" | |- style="background-color:#eeeeee;" | ||
| | | | ||
== Selecting Data == | |||
<div style="float: left; width: 50%; align: left;"> | <div style="float: left; width: 50%; align: left;"> | ||
Using just the left mouse button, you can click on the spectrum to draw a box, and zoom in on a particular part of the spectrum (Figure 6). | Using just the left mouse button, you can click on the spectrum to draw a box, and zoom in on a particular part of the spectrum (Figure 6). | ||
You can always unzoom to the original spectrum by, | You can always unzoom to the original spectrum by, in the top toolbar, clicking the left-hand magnifying glass button. | ||
</div> | </div> | ||
Line 92: | Line 97: | ||
''Figure 6; Click to enlarge'' | ''Figure 6; Click to enlarge'' | ||
</div> | |||
|- | |||
| | |||
<div style="float: left; width: 50%; align: left;"> | |||
When you hover over the spectrum displayed in the Spectral Profile viewer, holding down the Ctrl-key will draw a grey vertical line at the position of the mouse. With the Ctrl-key held down, if you then click the left mouse button, the viewer will display the channel corresponding to that point in the spectrum (Figure 7). | |||
</div> | |||
<div style="float: right; width: 50%; text-align: center;"> | |||
[[File:viewer_tut7.png | 300px]] | |||
''Figure 7; Click to enlarge'' | |||
</div> | </div> | ||
|- | |||
|- style="background-color:#eeeeee;" | |||
| | | | ||
Line 102: | Line 121: | ||
<div style="float: left; width: 50%; align: left;"> | <div style="float: left; width: 50%; align: left;"> | ||
The Spectral Profile tool allows you to quickly make several types of moment maps for the selected cube. | The Spectral Profile tool allows you to quickly make several types of moment maps for the selected cube. | ||
With the mouse in the Spectral Profile window, clicking and dragging with the left mouse button, while holding down the Shift-key, will highlight a range of the spectrum (in grey). To remove the highlighted range, in the top toolbar, click the | With the mouse in the Spectral Profile window, clicking and dragging with the left mouse button, while holding down the Shift-key, will highlight a range of the spectrum (in grey). To remove the highlighted range, in the top toolbar, click the left-hand magnifying glass button. The data can then be collapsed over the highlighted range. A drop-down menu below the spectrum allows you to choose between either summing the data, creating a Moment 0 map, or making an image of the mean or median values over the selected region of the spectral axis. Clicking 'collapse' will generate the requested image in the Viewer (Figure 8). | ||
Instead of selecting the data range by highlighting the spectrum, you can also enter the desired x-axis range directly in the 'from' and 'to' boxes below the spectrum. | Instead of selecting the data range by highlighting the spectrum, you can also enter the desired x-axis range directly in the 'from' and 'to' boxes below the spectrum. | ||
</div> | </div> | ||
<div style="float: right; width: 50%; text-align: center;"> | <div style="float: right; width: 50%; text-align: center;"> | ||
[[File: | [[File:viewer_new6.png | 300px]] | ||
''Figure | ''Figure 8; Click to enlarge'' | ||
</div> | </div> | ||
|- | |- | ||
| | | | ||
Line 118: | Line 137: | ||
<div style="float: left; width: 50%; align: left;"> | <div style="float: left; width: 50%; align: left;"> | ||
At the very bottom left of the Spectral Profile window is a tab which allows you to toggle between creating moment maps (the default), and fitting Gaussians. Clicking on the 'linefit' tab will allow you to fit a Gaussian + polynomial to the displayed spectrum. You can select the x-axis region to be fit with the 'from' and 'to' boxes, or by highlighting the spectrum as described above. The drop-down menus below the spectrum allow you to fit a Gaussian, Gaussian + 0th or 1st-order polynomial, or simply a polynomial to the spectrum. The resulting fit parameters are sent to standard output (the window with the casapy prompt, or the terminal in which casaviewer was launched) | At the very bottom left of the Spectral Profile window (Figure 9) is a tab which allows you to toggle between creating moment maps (the default), and fitting Gaussians. Clicking on the 'linefit' tab will allow you to fit a Gaussian + polynomial to the displayed spectrum. You can select the x-axis region to be fit with the 'from' and 'to' boxes, or by highlighting the spectrum as described above. The drop-down menus below the spectrum allow you to fit a Gaussian, Gaussian + 0th or 1st-order polynomial, or simply a polynomial to the spectrum. The resulting fit parameters are sent to standard output (the window with the casapy prompt, or the terminal in which casaviewer was launched) | ||
</div> | </div> | ||
Line 124: | Line 143: | ||
[[File:viewer_tut8.png | 300px]] | [[File:viewer_tut8.png | 300px]] | ||
''Figure | ''Figure 9; Click to enlarge'' | ||
</div> | </div> | ||
|- | |- style="background-color:#eeeeee;" | ||
| | | | ||
Line 133: | Line 152: | ||
<div style="float: left; width: 50%; text-align: left;"> | <div style="float: left; width: 50%; text-align: left;"> | ||
If nothing appears in the Spectral profile window, first try clicking the left-hand magnifying glass button in the top toolbar to reset the zoom. If there is still no spectrum, make sure that you have selected a region in your image. | |||
Strange things happen when you have multiple registered images in the viewer at one time. Spectra from all registered cubes will be overlaid in the spectral viewer (Figure 10), but you can only fit profiles and view error bars (and presumably save fits/ASCII data) for one of these spectra. | |||
If you are looking at line profiles with multiple registered images, and the images have different velocity axes, then closing/unregistering one image can also cause the velocity axis in the spectral viewer to become gibberish. Close and reopen the spectral viewer, or unregister/register the main image and the axis will reset. | |||
</div> | |||
<div style="float: right; width: 50%; text-align: center;"> | |||
[[File:viewer_multispec.png | 300px]] | |||
''Figure 10; Click to enlarge'' | |||
</div> | </div> | ||
|- | |- | ||
| | | | ||
Last checked on CASA Version 3.4.0 (r19988). | Last checked on CASA Version 3.4.0 (r19988). | ||
--[[User:Bmills|Betsy Mills]] 08:25, 21 August 2012 (UTC) | --[[User:Bmills|Betsy Mills]] 08:25, 21 August 2012 (UTC) |
Latest revision as of 05:21, 23 August 2012
A quick tutorial on how to use the Spectral Profile plotting tool, based on the CASA cookbook
Opening the Spectral Profile plotting toolFirst, open the image viewer by calling 'viewer' from the CASA prompt, or 'casaviewer' from the command line. To select the region of your image for which you want to display the spectrum, use the Point, Rectangle, Ellipse or Polygon Region tool in the Viewer Display Panel (Figure 1). The values for extended regions are computed as the mean over all pixels within the marked region, (but you also have the option to view the median, sum, or flux). For Point positions, it is possible to mark multiple positions and switch between the positions by hovering over the respective markers (to remove a point or region box, hover over it and hit ESC). |
From the Main Toolbar of the Viewer (see Figure 2), the Spectral Profile plotting tool can be selected. This creates a new Spectral Profile window containing an x-y plot of the intensity versus spectral axis. The displayed spectrum is extracted in the region you have marked. |
Data Display OptionsThis is the Spectral Profile panel (Figure 3) that appears, showing the spectrum for the selected region in the image. If you have not yet selected a region, the spectral profile window will remain blank until you do. You can mark multiple regions for which you want to extract profiles; hovering over a region will display the corresponding spectrum in the Spectral Profile window. By default if you have selected a region larger than a point, the value plotted on the y-axis is the mean of data in the region. By default, the data are also plotted with no error bars. |
You can change both of these defaults in the two drop-down menus to the bottom right of the spectrum. Here (Figure 4), the data are shown plotted with the RMS error bars. Instead of displaying the mean on the y-axis, now we are looking at the median (you can also view the sum, or the flux of in the selected region, but no error bars are available for these quantities).
|
ToolbarsAt the top of the Spectral Profile panel is a toolbar (Figure 5) which allows you to save the spectrum as either a data file (fits/ASCII) or an image. The toolbar also allows you to pan and zoom the spectrum (you can also do this with your trackpad, sometimes without meaning to!). One of the most useful buttons is the 'unzoom' button, which resets the spectrum, and allows you to undo any inadvertent panning or zooming. |
Selecting DataUsing just the left mouse button, you can click on the spectrum to draw a box, and zoom in on a particular part of the spectrum (Figure 6). You can always unzoom to the original spectrum by, in the top toolbar, clicking the left-hand magnifying glass button. |
When you hover over the spectrum displayed in the Spectral Profile viewer, holding down the Ctrl-key will draw a grey vertical line at the position of the mouse. With the Ctrl-key held down, if you then click the left mouse button, the viewer will display the channel corresponding to that point in the spectrum (Figure 7).
|
Making a Moment MapThe Spectral Profile tool allows you to quickly make several types of moment maps for the selected cube. With the mouse in the Spectral Profile window, clicking and dragging with the left mouse button, while holding down the Shift-key, will highlight a range of the spectrum (in grey). To remove the highlighted range, in the top toolbar, click the left-hand magnifying glass button. The data can then be collapsed over the highlighted range. A drop-down menu below the spectrum allows you to choose between either summing the data, creating a Moment 0 map, or making an image of the mean or median values over the selected region of the spectral axis. Clicking 'collapse' will generate the requested image in the Viewer (Figure 8). Instead of selecting the data range by highlighting the spectrum, you can also enter the desired x-axis range directly in the 'from' and 'to' boxes below the spectrum. |
Fitting ProfilesAt the very bottom left of the Spectral Profile window (Figure 9) is a tab which allows you to toggle between creating moment maps (the default), and fitting Gaussians. Clicking on the 'linefit' tab will allow you to fit a Gaussian + polynomial to the displayed spectrum. You can select the x-axis region to be fit with the 'from' and 'to' boxes, or by highlighting the spectrum as described above. The drop-down menus below the spectrum allow you to fit a Gaussian, Gaussian + 0th or 1st-order polynomial, or simply a polynomial to the spectrum. The resulting fit parameters are sent to standard output (the window with the casapy prompt, or the terminal in which casaviewer was launched) |
Trouble ShootingIf nothing appears in the Spectral profile window, first try clicking the left-hand magnifying glass button in the top toolbar to reset the zoom. If there is still no spectrum, make sure that you have selected a region in your image.
|
Last checked on CASA Version 3.4.0 (r19988). --Betsy Mills 08:25, 21 August 2012 (UTC) |