3. Getting started

3.1. What THELI does and what it does not

THELI is a generic data reduction package. Feed it a set of raw images together with suitable calibration files, and it will produce a fully calibrated, science grade stacked image.

At this point the responsibility of THELI ends. When it comes to extracting science from the final image, individual needs and requirements must be met. Their number is as large as the number of scientific questions that are out there to be answered. THELI will provide you with an excellent image to start with, but you have to push it through DAOPHOT, GALFIT or your specific measurement pipeline yourself.

A great deal of care has been taken in the development of THELI in order to make everything as instrument-independent as possible. For example, once you figured out how to reduce data from a single-chip camera mounted on one telescope, you are already familiar with the processing of multi-chip wide field camera data from a totally different observatory. In fact, there is no difference in processing these two data sets. The same holds for near-IR data. Processing is very similar to optical data, you just need to pick the right sky subtraction method.

3.2. How NOT to use THELI

While reducing data with THELI’s graphical user interface is (or will be) probably one of the most convenient ways you have encountered so far, it does not relieve you from learning and understanding what you are doing and how the software works. It is common to see the brains of scientists (and others) shutting down when they come across a GUI with buttons to click and switches to toggle. If you blindly start somewhere in the middle, THELI will bite you (or at least gives you a sensible warning before it bites you).

THELI uses a strictly linear approach for data reduction, which makes for easy and transparent processing. And you have to stick to that. It is usually not possible to take data that has been processed half-way by other software and do the rest in THELI. FITS headers will not be understood, naming conventions not met, and data structures totally incompatible (think of multi-chip cameras).

3.3. Some good advice

It is of utmost importance that you know what you are doing. Blindly applying e.g. a defringing correction or a sky subtraction with default parameters can wreak havoc in your data if you do not know what is going on. For example, if you are interested in some faint extended features around some object, and you choose the wrong sky subtraction method, this feature may be removed entirely from the data. Or, because of the wrong defringing approach or near-IR sky background modelling, the noise in your final image is twice as high, and the faint supernova you would have caught otherwise and made you famous is gone. Fortunately, all default settings in THELI will lead to very reasonable results in most cases. But you should know the implications of the various selections you make. These web pages will help you, as they explain the effects of all the whistles and bells THELI has.

Do not forget that a successful data reduction depends almost always critically on carefully planned and executed observations. If you fail to take calibrations, you will be lost. Don’t settle for 4 flats and 5 biases, and don’t skip the darks because “the camera is cooled anyway”. Don’t rely on data archives, maybe the last time flats were taken in your filter was half a year earlier, and that observer pointed right into cirrus clouds AND saturated the exposures. Over-calibrate your data, don’t under-calibrate it, you never know what crops up during data reduction.

Lastly, the observing strategy is crucial as well. For example, if you observe extended targets and require accurate sky modelling, then even in the optical regime off-target blank fields can be essential. They cost extra time, but they save your data (infrared astronomers can tell you a thing or two about that). See my guidelines for observers for more things to do or not do do.

THELI isn’t magic. It cannot save your data if the calibrations and/or the observations were messed up. Neither will any other software.

3.4. Processing overview

For a complete data reduction you have to work your way through the seven main sections of THELI. These are:

The last six sections deal with the data reduction itself. Therein you find a blue task area containing the various processing steps available. Those which are mandatory are highlighted with red text.

Almost all tasks can be configured individually. Make your parameter selection, then mark the task you want to execute. More than one task can be marked at the same time. In the command window the exact syntax of the script that is going to be executed is displayed. If you are familiar with THELI, you can edit them according to your needs, but that should rarely be the case.

Once you are happy with your settings, hit the Start button. In the yellow message window you get some feedback as of the task that is currently being executed. All tasks write an extensive log file to disk, which, upon the end of the execution, is scanned for characteristic error messages. If no errors are found, a success message (“Done”) is printed. Otherwise the line in which the error is found is printed, and the logfile will be loaded and shown to you for inspection.

Each task that modifies the image as such inserts a unique string based on which you can tell what processing steps were applied already. The previous processing stage is stored in separate sub-folders. No data is ever deleted.

3.4.1. Initialise

Here you tell THELI where the data is located on your hard disks, and which instrument it was taken with. You also pick a meaningful name for this reduction task, under which THELI stores all the parameters used and tasks already executed. When launching THELI the next time, you will find it in exactly the same state as when you left it, and you can proceed with data reduction.

3.4.2. Preparation

There is only one mandatory task in this section: to transform the raw data and their FITS headers such that it conforms to THELI standards. Multi-extension FITS files are split into individual chips such that they are accessible for parallel processing.

3.4.3. Calibration

In this section the master calibration files (bias, dark, flat) are created and applied to the data.

3.4.4. Superflatting

If your data still have instrumental signatures after the basic pre-processing steps, then you can attempt to remove those in this section. Available options are multiplicative superflatting, defringing, or sky subtraction (near- and mid-IR). You can also attempt to remove horizontal or vertical gradients which are often introduced by near-IR detectors.

3.4.5. Weighting

THELI offers an advanced weighting scheme and defect detection mechanism. This ensures the cleanest coadded image possible with optimal S/N.

3.4.6. Astrom/Photom

This section basically deals with catalogs. Optionally, you can attempt an indirect absolute photometric calibration based on standard star observations, or a direct absolute calibration based upon comparison with SDSS or 2MASS magnitudes.

The remaining two tasks are mandatory. Object catalogs are produced for each image and compared to an astrometric reference catalogue downloaded form the web. A full astrometric solution is created including distortion correction and automatic mosaicing. Relative photometric zeropoints are determined as well to correct for varying atmospheric extinction. Results are written to separate FITS header files.

3.4.7. Coaddition

Here you can subtract individual sky models from each exposure. A large range of options is available to suit your particular needs for background modelling.

Lastly, the coaddition is performed. To this end a large number of configuration parameters is available, presenting you amongst other parameters various resampling kernels, the output pixel scale, or a possible proper motion vector for moving targets.