Viewer Testing -- Images
(If you still need to load the test data into your working directory, go
here).
(Measurement Set testing is
here).
0. Starting the Viewer -- Preliminaries
From system prompt (if you have not already done so):
casaviewer&
or, from the casapy prompt:
viewer
Two windows, titled
Viewer Display Panel and
Load Data, should appear:
%BEGINFIGURE{label="fig:dp" caption="Viewer Display Panel."}%
%ENDFIGURE%
%BEGINFIGURE{label="fig:opendata" caption="Load (Open) Data Dialog."}%
%ENDFIGURE%
I will refer to the toolbuttons of the display panel's first row by the following names (left to right). Hover over the buttons for a hint if you forget (the panel must have keyboard focus for that to work, grr... click the panel's title bar to be sure):
%BEGINFIGURE{label="fig:toolbar" caption="Main Toolbar."}%
%ENDFIGURE%
Open (raise
Load Data window)
Adjust (raise
Data Options window)
Register
Close Data
New Panel (creates another display panel window)
Panel Options (raise
Panel Display Options window)
Print
Unzoom (zoom out all the way)
Zoom In (x2)
Zoom Out (/2)
Identical functions (except for zooming) can also be found within the menus.
1. Simple Image Viewing ('image load') -- Animation
If the
Load Data window is not showing, click
Open so that it does.
Select
4826.im
in that window.
Click
Raster Image there.
The
Data Display Options window should appear, but close it for now -- we'll get to it later.
Locate the
Frame slider on the display panel's
animator section; move it to frame
9.
The display panel should now look something like this:
%BEGINFIGURE{label="fig:4826frm9" caption="Viewing a Raster Image."}%
%ENDFIGURE%
The main area of the panel with the black background is called the
display area (or
pixelcanvas). The area inside the black margins where the image is actually drawn is known as the
draw area. If you move the cursor around within the draw area you should notice a continuously changing data display in the
cursor tracking area.
The
tapedeck buttons on the
animator (the ones with blue background) are, left to right:
ToStart
RevStep
RevPlay
Stop
Play
FwdStep
ToEnd
Move the animator
Rate slider all the way up (to 50 frames/sec.) and click the
Play button and the image animation should start. It should be obvious why this sort of spectral galactic image is sometimes known as a "butterfly". Your computer may not actually be able to achieve 50 frames/second, but you
should notice a significant speedup the second time through the animation. Press
Stop (or press
Play again) to stop the animation.
Try the other tapedeck buttons. You can enter a frame number manually. The greyed-out entry boxes on the animator are intended to limit the animation range and stride, but are not functional yet. Press
Compact to hide some of the animator interface, and
Full to restore it again. (Qt4.2+ no longer correctly recovers the saved space for the display area, but you can move the partition manually to accomplish that). Blink mode will be covered later.
2. Some Basic Tweaks
Start as above, with 4826.im loaded and the animator stopped on frame 9.
Zooming and Panning:
Press
Zoom In twice.
Click on the display area (just to focus the keyboard there).
Press the
right-arrow
(keyboard) key twice, which should center the galactic slice:
%BEGINFIGURE{label="fig:4826zm" caption="Zooming and Panning."}%
%ENDFIGURE%
Press
Adjust (the plain wrench icon). The
Data Display Options (or 'adjust') window should re-appear:
%BEGINFIGURE{label="fig:adjust" caption="Data Options ('Adjust') Window."}%
%ENDFIGURE%
Sections of the Options window can be opened and closed by clicking on section titles. Throughout this test, feel free to close sections when moving to another section (it can save scrolling).
Enter these changes and watch for their effects:
Data Range: .1,1
Power cycles: -1
Resampling mode: bilinear
Colormap: Rainbow 2
Aspect ratio: flexible
Now return aspect ratio to its original value by clicking the "wrench" icon on the
Aspect ratio line and selecting "original".
Open the
Axis labels drop-down section and enter the following:
X grid type: Full grid
Y grid type: Full grid
Open the
Axis label properties drop-down section and enter the following:
X grid/tick color: red
Y grid/tick color: red
Direction Reference: GALACTIC
Movie Axis label type: world
Character size: 1.05
Close the
Axis label properties drop-down by clicking the section label. Open the
Beam Ellipse section and enter:
Color: green
X Center: .9
Open the
Color Wedge section and enter:
Display Color Wedge?: Yes
The display panel should look similar to the following:
%BEGINFIGURE{label="fig:adjusted" caption="The ngc4826 image after changing some options."}%
%ENDFIGURE%
3. Contour Over Raster Display
Still continuing from the display panel as shown above, click
Open to show the
Load Data window again. In that window, select
4826_m0.im
and this time press
Contour Map. We now have a display with two "layers" or "overlays": a raster overlay and a contour overlay.
Click
Adjust to raise the Options window again if it's lost behind other windows. Note that it now has two tabs (and unfortunately, it's quite easy to "adjust" the wrong one by mistake). Click the
4826_m0.im-contour tab. In the
Beam Ellipse section enter:
Draw Beam?: No
The display panel should look as follows:
%BEGINFIGURE{label="fig:2layer" caption="The ngc4826 image with moment 0 contours."}%
%ENDFIGURE%
4. Closing and registration.
We'll start fresh by selecting
Close ->
Close all
:
%BEGINFIGURE{label="fig:closeall" caption="The close data button."}%
%ENDFIGURE%
The display area should turn black.
This time we'll add the spectral cube as contours and moment 0 as raster:
Press
Open
In the load window select
4826.im
and
Contour
select
4826.im_m0
and press
Raster
(Note that options for newly reloaded layers, such as Colormap, will be at their defaults again).
Press
ZoomIn button.
Click
Adjust. In the options window select the
4826.im_m0 tab. Set
Colormap to Rainbow 2.
Move to animator frame 9:
%BEGINFIGURE{label="fig:2layer2"}%
%ENDFIGURE%
Now unregister the raster layer by selecting
Register and unchecking
4826_m0.im
%BEGINFIGURE{label="fig:unregister"}%
%ENDFIGURE%
%BEGINFIGURE{label="fig:contour"}%
%ENDFIGURE%
Re-register the raster layer by rechecking
Register ->
4826_m0.im
The open raster layer should reappear (as shown 3 figures back), with its changed option (Rainbow colormap) still in effect.
5. Blink Mode, Panel Options, Side-by-side Display.
From above, unregister the contour layer (uncheck
Register ->
4826.im-contour
Open a new 4826.im raster layer (
Open , Load Data Window ->
4826.im
,
Raster )
Set the animator to frame 9 again.
Press the
Blink mode radio button on the animator.
Press
Play on the animator (turn the rate down if you're subject to seizures).
Press
FwdStep a few times.
The animator should be alternating between these two displays:
%BEGINFIGURE{label="fig:blink0" caption="Blink: raster image 0 (moment 0)."}%
%ENDFIGURE%
%BEGINFIGURE{label="fig:blink0" caption="Blink: raster image 1 (spectral slice 9)."}%
%ENDFIGURE%
Press
ToStart (leftmost tapedeck button) to stop at image 0.
Now press
Panel Options (the wrench icon with a "P").
In the "ViewerCanvasManager" window (should read "Panel Display Options" -- oops) set
Number of panels in x to 2, to see the following:
%BEGINFIGURE{label="fig:side" caption="Side-by-side Raster display."}%
%ENDFIGURE%
The labels are a little cut off. To fix, drop down the
Margins section of the "ViewerCanvasManager" window and set
Left margin spacing (PG chars) to 15:
%BEGINFIGURE{label="fig:side2" caption="Better Margins."}%
%ENDFIGURE%
Move the cursor around in the display area; tracking should switch from one image to the other, depending on the image the cursor is over.
Re-register the contour layer (
Register -> check
4826.im-contour
). The contour layer should show above both raster images:
%BEGINFIGURE{label="fig:side3" caption="Contour over Side-by-side Display."}%
%ENDFIGURE%
6. Position-Velocity Display
We'll start pretty much from scratch by doing the following:
Close ->
Close all
Switch back from
Blink to
Normal mode on the animator.
Press
Panel Options
In that window, under
Number of panels in x press the black wrench icon and select
Original
Do the same for
Left margin space (PG chars)
%BEGINFIGURE{label="fig:original" caption="Returning an Option to its Original Value."}%
%ENDFIGURE%
Re-open
4826.im
as follows: Press
Open , in load window select
4826.im
and press
Raster Image .
In the data options window, open the
Display axes section. Set:
Y-axis:
Frequency
Z-axis:
Declination
Response to the last command may be a bit slow. (Actually, I'm used to about 3 sec. for this sort of thing, but this is taking 18 sec. for me, which is a bit worrisome....)
Move the animator frame slider to frame slider to frame 124.
On the display panel, retrieve some display space by pulling all the way down on the divider that is the light horizontal stripe in the middle of the following figure:
%BEGINFIGURE{label="fig:divider" caption="Retrieve wasted space from dock area."}%
%ENDFIGURE%
Note: this wasn't necessary until Qt-4.2.
The stippled area below the divider, as well as the button immediately to its right, can be used to dock or undock either the animator or the tracking area. The "X" button to the right of that can be used to close either the tracking or animator areas (use the
View menu to get them back):
%BEGINFIGURE{label="fig:dockctl" caption="Dock Widget Controls."}%
%ENDFIGURE%
The checkboxes to the
left of each section of the tracking area can hide tracking for individual layers; the title of each registered layer is always shown:
%BEGINFIGURE{label="fig:hidesec" caption="Hide tracking section."}%
%ENDFIGURE%
The
Compact/Full button on the animator hides/shows some of the animator interface.
You can play with all these controls if you want. There are a few other automatic sizing problems besides the one mentioned above (I need to hammer on the Trolltech folks some more), but with enough fiddling such as docking and undocking you should be able to get the display panel to look like this again (with the 'dock widgets' back to their default configuration):
%BEGINFIGURE{label="fig:posvel" caption="Galaxy Rotation Curve."}%
%ENDFIGURE%
Using the left mouse button (or, on primitive machines, the only mouse button), drag with the mouse over the draw area (and release), to create a rectangle similar to the one shown below. If you don't like the looks of your rectangle you can move it or reshape it by dragging it or one of its 'handles'. You can also hit the
esc
(keyboard) key to erase it and start over:
%BEGINFIGURE{label="fig:zoomrect" caption="Drawing a Custom Zoom Rectangle."}%
%ENDFIGURE%
Now double-click inside the drawn rectangle to execute a zoom into that area. You should see something fairly similar to this:
%BEGINFIGURE{label="fig:zoomed" caption="Custom Zoom Executed."}%
%ENDFIGURE%
Notice the second row of toolbuttons just above the display area:
%BEGINFIGURE{label="fig:mstls" caption="Mouse Tools."}%
%ENDFIGURE%
From left to right they'll be called:
Zoomer (the one you just used)
Panner
Fiddler (changes shift/slope of colormap)
BrtCont (changes brightness/contrast of colormap)
Crosshair (selects a position)
RectReg (selects a rectangular region)
PolyReg (selects a polygonal region)
PolyLine
Note that three of the buttons are shown depressed, with a different mouse button symbol highlighted on each. On sophisticated machines three mouse tools can be active at once, each operated with a different chosen mouse button. By default,
Zoomer is active on the left mouse button,
Fiddler is on the middle, and
RectReg on the right mouse button. On macs, you must first press the mouse tool button to select it for use on the 'left' (i.e. the only) mouse button, if it is not already active there.
To use the
RectReg mouse tool for image statistics press its toolbutton with the desired mouse button (if it is not already active on that button). Then sweep out an area similar to the one shown and double-click inside (using the selected mouse button), just as you did for zooming:
%BEGINFIGURE{label="fig:rectstats" caption="Selecting Image Statistics Region."}%
%ENDFIGURE%
In the
terminal window (where you started the viewer), something similar to the following should be shown (though your numbers will probably vary somewhat):
%BEGINFIGURE{label="fig:stats" caption="Image Statistics Display."}%
%ENDFIGURE%
In fact, we can check for exact numbers, and should probably do so: Click
Unzoom , then select the
full image plane with
RectReg as shown below (you may have to hit
esc
to erase the old rectangle) and double-click:
%BEGINFIGURE{label="fig:stats" caption="Selecting the Full Plane for Image Statistics."}%
%ENDFIGURE%
The terminal window should display figures
very close to these:
%BEGINFIGURE{label="fig:stats" caption="Full-Plane Statistics for Declination Plane 124."}%
%ENDFIGURE%
Hit
esc
to erase the rectangle again.
8. Image profiles
For spectral profiles we need to return to the usual axis configuration (sky on display, animating frequency).
Press
Adjust. In the display options window, under
Display axes, return
Y-axis and
Z-axis to their original values via the black wrench icons.
Move the animator out to frame 16 (of the 30 frames).
Press
ZoomIn 5 times.
From the display panel menu select
Tools ->
Spectral Profile
A window should appear like the following:
%BEGINFIGURE{label="fig:profile" caption="Spectral profile Window."}%
%ENDFIGURE%
Select the
Crosshair mouse tool. The image pixels should look as shown below. Click on the square shown (
in its upper-right quarter -- someone's not rounding right...) with the mouse button you assigned to the
Crosshair:
%BEGINFIGURE{label="fig:selectpoint" caption="Selecting a Point to Profile."}%
%ENDFIGURE%
The displayed profile should look like this (though the numerical coordinates may vary slightly):
%BEGINFIGURE{label="fig:pointprofile" caption="Spectral Profile -- Single Sky Point."}%
%ENDFIGURE%
Drag the crosshair around the image. The profile should change as you move to different image pixels. Hit
esc.
(or move the crosshair off the image) to erase it.
Select the
RectReg mouse tool and draw a rectangle which straddles the 4 pixels shown while staying inside them (you do
not need to double-click to activate profiling):
%BEGINFIGURE{label="fig:selectrect" caption="Selecting a Rectangular Region to Profile."}%
%ENDFIGURE%
The displayed profile should look like this:
%BEGINFIGURE{label="fig:rectprofile" caption="Spectral profile -- Rectangular Region."}%
%ENDFIGURE%
Click on the display area and hit
esc.
to clear the rectangle.
Select the
PolyReg mouse tool.
Click on successive vertices (approximately in the data pixel centers) to create a polygon straddling the same image pixels as shown below; click the final point twice to complete the polygon.
After completion, you can move individual points or the whole polygon, but you must hit
esc.
and start over to change the number of points. You can also start over by clicking outside the old polygon.
%BEGINFIGURE{label="fig:selectpoly" caption="Selecting a Polygonal Region to Profile."}%
%ENDFIGURE%
The displayed profile should look like this:
%BEGINFIGURE{label="fig:polyprofile" caption="Spectral profile -- Polygonal Region."}%
%ENDFIGURE%
9. All-sky Images. Sky Catalogs. Colormap Fiddling.
Hit
esc
to erase any existing polygon, and
Close the old image.
Open allSky.im
as a
Raster Image.
Click
Adjust. Under
Axis labels, set both
X grid type and
Y grid type to
Full grid.
Under
Axis label propertiess, set
Direction Reference to
GALACTIC.
Under
Basic settings set
Colormap to *Rainbow 2 and
Data range to
[0,70]
.
Click
Panel Options and under
Margins in that window set
Top margin space to
7
.
Click
Open and load
sources.sc
as a
Sky Catalog.
%BEGINFIGURE{label="fig:allsky1" caption="Large Sky Area Display."}%
%ENDFIGURE%
Click
ZoomIn (once).
Activate the
Zoomer mouse tool with the [left] mouse button (just so that the
PolyReg tool we were using before doesn't try to draw).
Click on the display area (just to assure it has keyboard focus).
Pan up by hitting
ctrl-up-arrow
(on the keyboard):
%BEGINFIGURE{label="fig:allsky2" caption="Large Sky Area Display."}%
%ENDFIGURE%
Click on the display panel and pan left by hitting
ctrl-left-arrow
.
Press
Adjust; in the
sources.sc tab under
Label properties, set
Column listing name to
Source
:
%BEGINFIGURE{label="fig:allsky3" caption="Large Sky Area Display."}%
%ENDFIGURE%
(Note: sky catalogs are just barely working; rash-like brown dots are all you get at present...).
10. Print (to file). Colormap Fiddling.
(Note: postscript printing is in flux at the moment...).
Click
Print; in the Print Manager dialog set
Output file to
allsky.jpg
.
%BEGINFIGURE{label="fig:print" caption="Print Manager Dialog."}%
%ENDFIGURE%
Select
Save ->
JPG.
allsky.jpg
in your working directory should look like the display panel's display area:
%BEGINFIGURE{label="fig:allsky" caption="Saved jpg file: allsky.jpg."}%
%ENDFIGURE%
Return
sources.sc-skycatalog's Column listing names option to
<none> (just to clear a little clutter).
Click the
all.sky.im tab and set
Color Wedge ->
Display Color Wedge? to
Yes.
On the display panel select the
Fiddler mouse tool.
Drag around the display area (and below it), observing the color changes both in the image and the colorbar (this is often the most handy color control).
If you click the fiddler tool on the middle of the colorbar, your image should look something like this:
%BEGINFIGURE{label="fig:fiddled" caption="Colormap 'fiddling' (Shift/Slope control)."}%
%ENDFIGURE%
(Not much to see here; just checking that this format loads like any other...).
Select
Close ->
Close All
Press
Open. In
Load Data select
m51.fits
and
Raster Image.
In
Data Options ->
Basic Settings set
Data range to
[50,1000]
.
Set
Scaling power cycles to
-1
.
Retrieve space for the display area if necessary (see
this link if you forget how).
The display should resemble this:
%BEGINFIGURE{label="fig:fits" caption="Displaying a FITS Format Image."}%
%ENDFIGURE%
12. Displaying a Complex-Valued Image.
Close ->
Close m51.fits
.
Press
Open. In
Load Data select
complex.im
and
Raster Image.
Click the
Zoomer mouse tool with the [left] mouse button (just to avoid mischief).
Click
ZoomIn twice, (keyboard)
up-arrow
twice (with keyboard focus on the panel),
left-arrow
once and
ZoomIn once more.
In
Data Options ->
Basic Settings set
Colormap to
Misc. 2: Topography and
Scaling power cycles to
-1
. Set
Resampling mode to
bilinear:
%BEGINFIGURE{label="fig:complex0" caption="Displaying a Complex-Valued Raster Image (Magnitude Component)."}%
%ENDFIGURE%
Close the animator by clicking the small 'X' button at upper-right of the
animator section of the display panel (do not close the display panel itself); this will give the display area more room.
Press
Open to find the
Load Data window again. With
complex.im
still selected, press
Contour Map. Then press
Vector Map (the latter command takes a little while to process).
Press
Adjust. In the
Data Display Options window select the
complex.im-contour tab. Under
Basic Settings set
Line color to
black.
Select the
complex.im-vector tab. Under
Basic Settings set
Amplitude scale factor to
6
,
X-increment to
11
,
Y-increment to
7
amd
Line color to
red.
The 3-layer complex image should look about like this:
%BEGINFIGURE{label="fig:complex" caption="Displaying a Complex-Valued Image with Raster, Contours and Vectors."}%
%ENDFIGURE%
13. Specifying Mask Regions with Interactive CLEAN.
Interactive Clean uses a specialized version of the viewer with some added interface.
Exit the viewer we've been using by closing the display panel.
Run casapy (if are not already doing so) by typing
casapy --nolog
in the terminal window where you were running the viewer (from your test data directory).
If you have run this test before, type the following at the casapy prompt, to remove any old masks created the last time:
os.system 'rm -rf 4826.im.mask 4826.im.mask.text'
Type the following to bring up the interactive masking viewer tool:
im.drawmask '4826.im'
Detach both the animator and the new masking interface section from the display panel by dragging on the stippled areas of these sections. Detached, the masking interface looks like this:
%BEGINFIGURE{label="fig:maskinterface" caption="Interactive Masking Controls."}%
%ENDFIGURE%
You can then resize the display panel window to something more compact like the following (if desired):
%BEGINFIGURE{label="fig:clean1" caption="Interactive CLEAN Display window."}%
%ENDFIGURE%
Press
ZoomIn once. Animate around the image some, then stop at frame
9
. This image is clearer if we 'fiddle' the colormap a little too, so select the
Fiddler mouse tool and drag it around the image a little. You can get color balance like the following when the fiddler tool is released somewhere in the lower-left corner of the draw area:
%BEGINFIGURE{label="fig:clean2" caption="Adjusting Image Color."}%
%ENDFIGURE%
Turn the animation frame rate all the way up to
50
and press
Play. The second time through the animation should run much faster, and give you a better idea of the whole area the galaxy occupies.
Select the
RectReg mouse tool and draw a rectangle enclosing this area. You can keep the animation running while you define the rectangle if you like, to be sure you have sized it well. Stopping on frame 9 again, this is about what the mask region should look like after you have double-clicked to confirm your rectangle:
%BEGINFIGURE{label="fig:clean3" caption="Initial Mask Region Defined."}%
%ENDFIGURE%
Let's cut off the upper corner of this region:
In the masking control panel (which you previously separated from the display panel), switch from
Add to
Erase.
Select the
PolyReg mouse tool and draw a triangle with it similar to the one shown:
%BEGINFIGURE{label="fig:clean4" caption="Cutting Out a Corner of the Region."}%
%ENDFIGURE%
When you double-click the final point to confirm, the corner should be cut out of the mask region:
%BEGINFIGURE{label="fig:clean5" caption="Corner Removed."}%
%ENDFIGURE%
Regions can also be selected or refined for individual channels rather than all channels at once.
First, uncheck the
All Channels button on the masking interface.
Select the
RectReg mouse tool again and draw a box with it which encloses the old region on channel 9:
%BEGINFIGURE{label="fig:clean6" caption="Removing The Entire Region For Channel 9."}%
%ENDFIGURE%
When you double-click inside the new rectangle, the old mask region will disappear.
Now switch back to
Add Clean Regions on the masking control panel. Select the
PolyReg mouse tool again and draw a polygon with it outlining the area where flux is expected in channel nine, similar to the one shown:
%BEGINFIGURE{label="fig:clean7" caption="Redefining the CLEAN Region (Channel 9 Only)."}%
%ENDFIGURE%
When you double-click on the polygon's last point, the new region should be defined (for channel 9 only):
%BEGINFIGURE{label="fig:clean8" caption="Channel 9 Region Redefined."}%
%ENDFIGURE%
If you animate to other channels, however, the old region (a box with a corner cut out) should still show.
On the Clean Region interface, press
Clean ->
Stop to exit the tool.
In the working directory there should be a
4826.im.mask.text
file with an ascii-format definition of the defined region. The numbers should look similar (though probably not identical) to this:
[79, 80] [189, 162] 1
[124, 72, 72, 124] [175, 127, 176, 175] 0
[73, 74] [194, 169] 0
[159, 125, 130, 129, 172, 177, 164, 168, 159]
[161, 153, 133, 109, 100, 128, 130, 151, 161] 1
Click
here to continue viewer testing with MSs.
--
DavidKing - Jan 2008