6.2. Cubes and the Spectrum Explorer

Cubes from all three spectrometers on board Herschel (and spectra from other observatories) can be viewed, interacted with and modified by the same set of tools in HIPE. There are some instrument-specific viewers and tools, but these are described in the instrument data reduction guides or other instrument-specific documentation.

The default viewer on cubes is the Spectrum Explorer, which you can select with a double click on your cube in the Variables pane of HIPE. This viewer allows you to:

  1. plot and overplot the spectra from your spaxels/spatial pixels, and

  2. access the Spectrum Toolbox (), the SpectrumFitterGUI (described in Chapter 7, ), and the Cube Toolbox ().

The Spectrum Explorer is a viewer. It is not a toolbox in of itself. The Spectrum Explorer will allow you to view the spectra of a cube (or any other spectral product), overplot different spectra or different cubes, and make nice plots. In addition, when you are using the toolboxes the Spectrum Explorer can be used to identify spaxels, or whole spectral and spatial regions, that the toolbox tasks should work on. In most cases, the icons that allow you to do these selections are in the button bar at the top of the Spectrum Explorer.

What types of cubes can the toolboxes work with? Spectral cubes come in various flavours in the framework of HIPE, and are explained in detail in the Scripting Guide. For all instruments the final cubes are of class SpectralSimpleCube.

All of these classes of cubes and spectra are known to HIPE as "SpectrumDatasets" (often "datasets" in conversation) and implement what is known as the "SpectrumContainer" interface, which allows them all to be visualised and interacted with in the same way. Any SpectrumContainer will be accepted by the Spectrum Explorer. A common class of spectral product is the Spectrum1d and Spectrum2d. These can hold single spectra, and also multiple-spectra datasets but with the data held in rows rather than a cube arrangement.

Why should you care about the class of the product that you are working on? In most cases, if you are running a task on a cube, then the output will also be a cube even if only some of the spectra have been changed. However, some of the Spectral Toolbox tasks will return the data as Spectrum1|2d, even if the input is a cube. In this chapter we will inform you where this is the case.

[Note] Note

The Cube Toolbox will only work on SpectralSimpleCubes (and the instrument flavours of these cubes). If you have a SimpleCube instead, you can convert with the simple command:

# what is the class of a cube?
print cube.class
# create a SpectralSimpleCube from SimpleCube ("cube")
specCube = SpectralSimpleCube(cube)

Example 6.1. Creating an SpectralSimpleCube object.

A word about arrays within cubes. The data within the cubes—the fluxes, errors, etc—are held as arrays, except RA and Dec which may be described rather by the WCS attached to the cube. HIFI cubes also describe the frequency grid via the WCS, SPIRE and PACS use an "ImageIndex" array for their standard products, and the PACS so-called equidistant cubes use the WCS. This is nothing the user needs worry about—the various spectral tasks know where to look for the arrays they need. For more information on the weights, errors and flag arrays, read Section 6.4.

[Tip] Tip

Spaxels and (spatial) pixels: mean the same thing, but HIFI uses "pixel" while PACS and SPIRE use "spaxel". These are the spatial-spectral unit of the cube, so one spaxel/pixel is one spatial element of your cube (one "square") with a full spectrum contained within it. If you change your spatial grid, e.g. by regridding the cube, the spaxels/pixels are still called spaxels/pixels, it is just that their size has changed.