Joint Astronomy Centre
Show document only
JAC Home
JCMT
UKIRT
Contact info
JAC Divisions
OMP
Outreach
Seminars
Staff-only Wiki
Weather
Web Cameras
____________________

JCMT home
Observing at JCMT
OMP Observation Manager
Telescope
Spectral Line Observing
Continuum Observing
Schedule
Data Archive
Future Developments
Legacy Surveys
Newsletter & Publications
Cube Analysis

Cube Analysis

In the following sections we walk through some other routines and procedures which allow you to inspect the reduced data cube in various ways.

Collapsing to a 2D image

The first thing we can do is to collapse the data cube into a single 2D image, producing what is sometimes termed a "white light" image. This can be done using the KAPPA command collapse,
> collapse in=tempcube_base axis=vrad estimator=mean out=tempcube2d
"White Light" image
The image above shows the resultant "white light" image from a cube which has had its baselines corrected for. The axis to collapse the cube along is chosen with the axis parameter. If you know what the axis is called then you may give that as your response (in this case we know that the spectral axis is called VRAD - it's case insensitive also!). If you do not know the axis name then provide the axis number, as in this example:
> collapse in=tempcube_base axis=3 estimator=mean out=tempcube2d
If you enter the wrong axis by mistake, then a most useful and polite error message informs you of your mistake and also provides you with a list of valid options:
AXIS - The axis to be collapsed /'VRAD'/ > redshift
!! 'redshift' is not a valid option for parameter AXIS.
! Valid options are: 'RA','Dec','VRAD'
! Options may also be specified by index in the range 1 to 3.
!! Please supply a new value for parameter AXIS.
AXIS - The axis to be collapsed /'VRAD'/ > 
By default the mean is used to calculate the final 2D image. Other options include median, mode and a wmean which calculates the weighted mean based on the associated variance (and only works if a variance array is present). The estimator parameter is a a 'sticky' one, which means that it remembers it's last value (stored in the adam directory). So to be sure of what is entered, it is best to always specify it or to use reset on the command line (although this will set all of your parameters to their defaults). Look at the help on the estimator parameter for the many other options that are available, some of which are described later in this document.

One can also collapse the cube along a specified range. If the range is known (maybe from inspecting the cubes with GAIA) then they can be specified with the low and high parameters:
> collapse in=tempcube_wcs axis=vrad estimator=mean low=-10.0 high=10.0 out=tempcube2d
If you are not sure about the range that you want to collapse your cube along, then you may want to plot out a spectrum for inspection.

Plotting a spectrum within a cube

To do this, use the display command to show your 2D image after collapse. To find the position where you would like to extract and plot a spectrum, use the cursor command:
> cursor showpixel
The showpixel parameter will ensure that the pixel indices as well as their WCS values are shown. An example return on the terminal screen after clicking on the image would be:
> cursor showpixel
DEVICE - Name of graphics device /@xwin/ >


Use the cursor to select positions to be reported.
To select a position press the space bar or left mouse button
To forget the previous position press "d" or the middle mouse button
To quit press "." or the right mouse button


Picture comment: KAPPA_DISPLAY, name: DATA, reporting: SKY co-ordinates
RA (hh:mm:ss.s) Dec (ddd:mm:ss)
3:25:37.0 30:45:09
(-3.4 2.3)
The pixel indices are shown in parantheses. Note that floating point pixel coordinates will be interpreted as integer pixel coordinates as long as the NDF does not contain AXIS structures (created, perhaps, using the setaxis command in KAPPA). To plot the spectrum:
 > linplot 'tempcube(-3.4,2.3,)' device=xw \\
You can now visually inspect a spectrum from the cube on a xwindows display to select your velocity limits.

Of course, this can be done in a more interactive and convenient way from within GAIA.

Smoothing data

There are various routines available which can smooth data and users are encouraged to explore them to see which suits their needs best. In KAPPA, the most common routines for data smoothing are block and gausmooth.

Each of the these routines can smooth the whole data cube, but their default behaviour is to do so by iterating through each 2D plane. Although this is not a true 3D smooth, the effect is still to smooth the spectrum as the following image shows.

Comparison of smoothed and unsmoothed spectra

The red line is the original spectrum and the blue line shows the same spectrum after the cube was subject to a 3 pixel gausmooth. The plane on which data is smoothed is controlled by the axes parameter. The default is axes=[1,2] which means that smoothing is successively performed in each parallel plane which includes these two axes.
The spectrum was smoothed using the command:
 > gausmooth tempcube fwhm=3 axes=[1,2] out=tempcube_sm \\

Moment analysis

It is also possible to use the collapse command to look at the principal moments in your data cube. The image below shows the result of using the Iwc estimator in the collapse command (the white light image collapsed over the same velocity intervals is overlaid as blue contours):
> collapse tempcube_base estimator=Iwc axis=vrad low=-25 high=25 tempcube_Iwc
Comparing the principal moment with the white light image

This calculates the value of, , the intensity weighted velocity in this case, for all pixels in the image. Using the estimator Iwd will return an image of the intensity weighted dispersion in the image. The image shows how the northern lobe is blueshifted relative to the southern, fainter stream of material.

Creating channel maps

Channel maps 'salami-slice' the data along a particular axis and present the integrated intensity for each slice. The most common reason for creating channel maps is as a method of visually inspecting the distribution of radiating gas as a function of velocity. To create a channel map (seen in the image below), one can use the KAPPA command chanmap,
> chanmap in=cube axis=3 low=-20 high=20 nchan=6 shape=3 estimator=mean out=chan
Use the display command to then plot the channel maps out:

Channel maps
Here we have chosen 6 channels (nchan) in total to be determined between -20 and +20 km/s along the velocity axis (3). The widths of the channels are determined by the software and are chosen to be uniform (as best possible). The shape parameter ensures that there will be 3 panels plotted horizontally with the rest of the channels distributed vertically. If you wish the software to decide how to best display the channels, then enter a null ! character for the shape command. For each slice, the mean is used to calculate the intensity in that channel. The same estimator choices that are available to the collapse command are available to chanmap.

...ooh, that looks like SPECX!

Finally, we have the return of an old favourite - well, almost. The clinplot routine in KAPPA allows users to display spectra on a defined grid, very similar to the grid-spectra command in SPECX. The image below was created by first displaying an image, choosing the region which to display by specifying sections of the ndf, and then overlaying the grid of spectra with the clinplot command:
> display 'tempcube_Integ(-10:0,-10:0)' device=xw lut=~/lutgaia \\
> clinplot 'cube(-10:0,-10:0,-15:25)' noclear specstyle='colour(curves)=blue'
device=xw
Other parameters such as lmode, ytop and ybot give you control of how the spectra are plotted.
An example of clinplot
The lut parameter in the display command allows a colour look-up table to be used for the image. Pixel coordinates have been used to section the ndf so that only the region of interest is displayed, and in the clinplot command, a section on the third axis is used to select a velocity range (defined in pixel coordinates not velocities).

The noclear parameter in the clinplot prevents the previous display from being erased. When this parameter is used, the line graphics are first aligned (using the WCS information in the axis frames of both images) and then plotted over the image.

<Back to Contents>

Contact: Per Friberg. Updated: Mon Dec 10 14:39:17 HST 2007

Return to top ^