This section describes the most important concepts for the use of THELI. It covers aspects of running individual processing tasks and the initial organisation of your raw imaging data. We assume use of THELI on ONE (possibly multi-processor and/or multi-core) machine with all data-processing happening on a single disk. Please email_me if you intend to use THELI on distributed computer clusters with the data split over different disks.
All THELI reductions and script calls are launched within a reduce directory (we refer to the complete absolute path of this directory as REDUCEDIR). It can be any directory with an arbitrary name. When being created, it has to contain all the scripts and configuration files that were created during THELI install in dir/theli-x.x.x/scripts/MACHINE.
The THELI scripts are called without any instrument specific arguments. Most instrument interna are stored in configuration files with the name INSTRUMENT.ini. The THELI standrad distribution currently contains the necessary setup for the instruments:
The instrument for which you want to process data is specified in the UNIX environment variable INSTRUMENT. For instance, within the bash shell you would issue the command:
export INSTRUMENT=WFI
for a reduction of WFI@MPG/ESO2.2m data. THELI processing tasks then read instrument specific information from the corresponding files. If you want to setup a new instrument you need to provide the following:
A THELI reduction session consists of the successive call of processing scripts that perform each a small and well defined part of data reduction. After having organised your data and having setup a REDUCEDIR, the beginning of a WFI@MPG/ESO2.2m data set reduction could look like:
# specify instrument:
export INSTRUMENT=WFI
# split up WFI Multi-Extension FITS Files
./process_split_WFI_eclipse.sh <arguments to script>
./process_split_WFI_eclipse.sh <arguments to script>
.
.
# process BIAS frames:
./parallel_manager.sh ./process_bias_eclipse_para.sh <arguments to script>
# process FLAT fields:
./parallel_manager.sh ./process_flat_eclipse_para.sh <arguments to script>
The typical THELI work-flow is to create superscripts that collect several indivdual steps and that allow an unproblematic rerun of old processings if necessary. These superscripts also serve as templates for the processing of data sets with similar characteristica; for instance in a long-term survey operation.
Many THELI scripts operate on individual chips from a multi-CCD camera. Typically the processing on different chips is completely independent from each other, and hence such tasks can be parallelised in a natural way. Scripts that allow parallelisation are indicated by the ending para.sh, e.g. process_flat_eclipse_para.sh (process flat-field images), create_skysub_para.sh (subtract the sky-background). THELI implements a direct and simple parallelisation scheme. Scripts that can be parallelised are not called directly, but via a scripted called parallel_manager.sh. A typical call to such a script looks like:
./parallel_manager.sh ./create_skysub_para.sh <arguments to create_skysub_para.sh>
The parallel_manager.sh would divide the chips of your camera and launch as many instances of create_skysub_para.sh as processors/cores are available on your machine.
Note
You have to manually provide THELI with the available CPUs/cores of your machine. To this end, edit the configuration file progs.ini in REDUCEDIR and change the line NPARA=1 accordingly. A simple way to find out the number to put on a Linux machine is the command grep process /proc/cpuinfo | wc -l
Note
It can be tedious to interrupt a THELI parallel task with the system kill command because the parallel_manager spawns subprocesses that need to be killed separately. To cleanly get rid of these jobs use the parakill.sh THELI script.