Skip to content

Level 3 FITS file

Martin Wiesmann edited this page Oct 25, 2022 · 36 revisions

A level 3 SPICE FITS file consists of 7 extensions per window. All data cubes are required to recreate the analysis structure which is used as input to XCFIT_BLOCK. The keyword header of the first extension (Results) contain all the level 2 keywords describing the data plus level 3 specific keywords. Some of the level 2 keywords were adapted to the level 3 data cubes.

Creating level 3 FITS files

Using a GUI

Level 3 SPICE FITS files can be generated using a GUI, either through SPICE_XFILES or SPICE_XCONTROL.

In SPICE_XFILES you can click on the button 'Open file in XControl_L23', which will open SPICE_XCONTROL_L23. This GUI lets you create level 3 data for single windows at a time or for several or all windows in a level 2 file.

In SPICE_XCONTROL, there's the button 'Create level 3 files', which opens the GUI SPICE_CREATE_L3_WIDGET.

Programmatically

Single file

A level 3 SPICE FITS file can be generated automatically using the following SPICE_DATA method:

SPICE_DATA::create_l3_file

spice_object = spice_data(spice_file)
spice_object->create_l3_file(window_index)

The procedure opens XCFIT_BLOCK with the result. The FIT components and its parameters can be edited/adjusted by the user in XCFIT_BLOCK. The level 3 file is then saved into the directory $SPICE_DATA/user/level3/.

Multiple files

Multiple level 3 files can be created by using the procedure SPICE_CREATE_L3_DRIVER. This tool allows to select all level 2 files within a certain time window, and create level 3 files for all of them. Additionally, one can also create overview images from the level 3 data.

Reading a level 3 FITS file

The easiest way to read and view a level 3 SPICE FITS file is by using SPICE_XFILES. You can search for level 3 files and by selecting one, [SPICE_XCONTROL_L23|SPICE_XCONTROL_L23]] is opened.

Alternatively, you can read a file also with the function FITS2ANA which returns an array of analysis structures, one per window.

Structure of a level 3 SPICE FITS file

The following links describe the level 3 specific keywords.

Structure of a level 2 SPICE FITS file

The following link contains the main header of a level 2 SPICE FITS file.

Clone this wiki locally