PMAS online reduction with P3d

GUI-Description

The P3d online reduction GUI is a comfortable tool to process the reduction steps simply by pressing a button. The widget being opened by starting the program is divided into four parts. These are from top to bottom:

     1. Start a new data reduction process
          Tracing
             Bias Subtraction
             Fiber Flat
             Spectra Extraction
     2. Select already existing calibration masks and reduced data
     3. Monochromatic image display
     4. Advanced display tools



Start a new data reduction process


1. Tracing: Clicking on the 'Create New Tracemask' button opens a file browser. Choose the raw frame at which the tracemask shall be determined. Pressing 'OK' starts the tracing process. 
All the spectra in the trace image should be well illuminated in almost all spectral pixels! Suggestion is a halogen lamp flat. 
The tracing procedure opens a window with a plot of a cut in y direction through the chosen raw image (x=mid of the image). The plot shows the crossdispersion profiles of the 256 spectra. The found spectra peaks are marked by crosses (see image to the right). 
The result of the tracing is stored in a file with the suffix '.trc'. This file is stored in the same directory as the raw file and carries the same prename. Having finished the tracing the program brings up a selection image. Chose a number (1-8) to store the resulting tracemask in a corresponding IDL array trc(1-8). This 2D-array contains the y-positions for each spectral pixel of all the spectra in the raw trace image. Each row of the array corresponds to one spectrum.
2. Bias Subtraction: Clicking on 'Create New Bias' brings up the file browser where you can choose a raw bias frame. For each column in the image a bias level is computed as a median of all intensities in that column. You can inspect the result in a display widget with editable colour ranges (see image to the right). 
The result of the tracing is stored in a file with the suffix '.bias'. This file is stored in the same directory as the raw file and carries the same prename. Having finished the bias modelling the program brings up a selection image. Chose a number (1-8) to store the resulting bias image in a corresponding IDL array bias(1-8).
3. Fiber Flat: Fiber Flat is only possible if a bias image is selected!
Clicking on 'Create New Fiber Flat Mask' also opens the file browser. Choose a raw fiber flat field image. this can either be a halogen lamp flat or a sky flat field. The program first determines the spectra traces (see Tracing). If the resulting tracemask should be maintained then set a number (1-8) in the upcoming selection widget.
Cancelling the selection will not cancel the flatfield procedure! 
The tracemask will be used for the following spectra extraction independant of the selection. 
The extraction results in a 2D image each row corresponding to one spectrum. The sensitivity of each spectrum is  given by the integration of its intensities over all wavelengths normalized by the mean of the integrated intensities of all 256 spectra. 
The result is a 2D-image with 16x16 elements corresponding to the spatial pixels with entries of the order of 1 giving the relative spectra sensitivities. It is stored in a file with the suffix '.flat' in the same directory as the raw file and carries the same prename. Having finished the bias modelling the program brings up a selection image. Chose a number (1-8) to store the resulting fiber flat image in a corresponding IDL array flat(1-8).
 
4. Spectra Extraction: Spectra extraction works only if a tracemask is selected!
Clicking on 'Extract New Object' opens the extraction menu. It offers a file browser for selecting the raw image of the object to be extracted and and a calibration menu. Here you can select which calibration steps shall be included additional to the spectra extraction. These are:
Bias Subtraction: only if one of bias(1-8) is set.
Fiber Flat: only if one of flat(1-8) ist set.
Wavelength Calibration: is always possible. 
This calibration is only a rough estimate of the wavelength scale on the basis of some default templates. But at least it is usefull to get an idea of what you see in the spectra.



Select already existing calibration masks and reduced data

Beside the option of creating new calibration masks there is also the possibility to activate already existing ones. The middle part of the GUI offers a file browser for each type. The masks are stored via a selection widget into corresponding IDL variables (see table). The files for each image type must have a certain suffix as there are:
 

Image Type: IDL Variables: Suffix of the Filenames::
Tracemask: trc(1-8) .trc
Bias: bias(1-8) .bias
Flatmask: flat(1-8) .flat
Extracted Object: obj(1-8) .ex

Only one mask of a type can be active at the same time. The active one is used for calibration purposes when undertaking the spectra extraction. Once you have stored several reduction results in IDL variables it is possible to exchange the active one. Clicking the 'Select' button of a certain type opens a select widget. Type in the number of the IDL variable you want to activate. The active mask is written in the corresponding panel of the online reduction GUI.



Monochromatic image display

The extracted objects are displayed as monochromatic images in the lower part of the GUI. The active one appears on the left size in the large display area, the others are displayed on the right side in the small windows. You can change the active object by clicking into the small windows on the right side.
As a default the monochromatic images are taken from the middle spectral position (column) in the extracted image. If wavelength calibration was activated before the spectra extraction then the wavelength corresponding to the monochromatic image appears in the 'Column' text field below the large image area (otherwise there appears the column). You can change the wavelength (column) editing this text field.
Beside the Wavelength text field there are two more fields 'Col. Min.', 'Col. Max.' giving the current colour range of the active image. These fields are also editable.



Advanced display tools

There are a couple of display tools usefull for checking the quality of the taken exposures and the data reduction quality, and they provide a first look into the reduced results. Pressing on a button in the lower panel of the GUI starts the corresponding display tools acting on the currently active obj(1-8):
 

viewer displays the raw image and plots arbitrary rows or columns.
trace inspector plots a cut through the raw object image in crossdispersion direction and marks the position of the tracemask with the possibility to scan through the image columns. This tool is only active when a trc(1-8) is set. 
cube viewer is an advanced tool for displaying monochromatic images and plotting spectra of spatial elements.
scancube displays monochromatic images with the option of scanning through the wavelengths.
imfocus displays and evaluates the results of a telescope focus series taken with PMAS