THELI GUI ING WEB AIFA WEB GEMINI

Table Of Contents

Previous topic

16. Advanced usage

Next topic

18. Guidelines for visiting observers

17. Prepare colour picture

If you ever tried to render a nice-looking three-colour picture out of CCD images, you will have noticed that this is far from trivial. The main difficulties are:

  • Exact alignment of the coadded images in all filters (hereafter: channels)
  • Find a good colour balance
  • Truncate the dynamic range in order to create 16-bit TIFF images

THELI does not go all the way to a final image. However, it can prepare suitable scaled images that can be readily processed in third-party software without much further processing.

17.1. Coadditions

_images/color_1.png

The first step that has to be done is to select those stacked images that should be combined for a colour picture. THELI assumes that all necessary coadd_xxx directories can be found in the same SCIENCE directory. If you followed the guidelines for processing multi-colour data sets, then this will be the case.

All processing takes place in a new sub-directory

SCIENCE/color_theli/

If this directory already exists, it will be unambiguously renamed into

SCIENCE/color_theli_backup_<timestamp>

17.1.1. Preparations

  1. SCIENCE dir: Upon opening this dialog, THELI will fill in the currently processed SCIENCE directory. You can change to any other directory you want. If coadditions are present, then these will be shown in the Select coadditions list.

  2. Select coadditions: Mark the coadditons you want to use for the colour image. Several entries can be highlighted at the same time.

  3. Get coadded images: Upon clicking here, THELI will link the coadded images selected into

    SCIENCE/color_theli/

    If a coadditon was labelled coadd_xxx, the corresponding image and its weight will appear as

    SCIENCE/color_theli/xxx.fits
    SCIENCE/color_theli/xxx.weight.fits
    

    Once all images are linked, an automatic cropping process kicks in that trims all images such that they have precisely the same size, and such that a particular object will have identical pixel coordinates in all channels. Once this is done, the images will be called

    SCIENCE/color_theli/xxx_cropped.fits
    SCIENCE/color_theli/xxx_cropped.weight.fits
    

    Note

    This works only if the coadditions were created with identical reference coordinates! This step does not involve any resampling anymore as the images already have identical astrometric projections (if the coadditions were done with identical reference coordinates).

    Optionally, you can remove some of the cropped images from the list (they will not be deleted from the hard disk, just ignored), or the full list can be restored. The latter is useful if you want to resume work in an already existing color_theli sub-directory.

  1. Statistics region: Define an area which is (ideally) free of any stars and nebulosity. This can be as small as 5x5 pixels if necessary and should correspond to the darkest region in the images. In the later colour picture, this area will appear with a neutral grey background. Though the coadded images are already sky-subtracted, small residuals could be left, which will be removed in this way.

17.2. ELum + NB combination

_images/color_2.png

17.2.1. Create enhanced luminance

If you took red, green and blue exposures, you will obtain a significantly better (deeper) colour image if you combine the three exposures into a synthetic luminance image.

If you have an unfiltered (clear filter, luminance filter) coadded image, you can add the filtered exposures to it to get even greater depth. However, this will only yield an improvement if

  • the combined transmission curves of the filtered exposures cover a similarly large spectral range as the luminance filter
  • if the total exposure time of each of the filtered images is comparable to or larger than the one of the unfiltered/clear/luminance exposure.

Mask combined image

Pixels which are not covered by all exposures (as judged from the individual weight maps) will be set to zero in the combined image.

Combination method

The following two options are available:

  • Noise normalised: The background noise of the individual images will be measured in the statistics region specified previously. Images are normalised with respect to their noise and then added (this is similar to the chi-square sense). In this way images with lower background noise contribute more than those with higher noise. The result is called

    SCIENCE/color_theli/elum_chisquare.fits
    

    You need to be careful, though. For example, at a dark sky location the background increases significantly from blue to red to unfiltered exposures. If you noise-normalise such data, it can happen that the blue exposure which might carry comparably little signal starts dominating the other exposures, in particular the deep luminance channel.

  • Mean: The average of the images is calculated. The result is called

    SCIENCE/color_theli/elum_mean.fits
    

    If you want to combine plain red-, green- and blue-filtered images, then this is the best approach as it mimics what a luminance filter would have seen.

    Note that if you set PHOTINSTRU_KEY = FILTER during astrometry, objects in the three channels will have the same average brightness. If one of them was taken under bad transparency conditions, it will be up-scaled which increases its noise, and can therefore lead to inferior results. Same if you use an image which very low signal-to-noise ratio as compared to the others.

17.2.2. Combine broad-band and narrow-band filters

A problem commonly encountered when creating colour pictures is how to include narrow-band exposures in a set of broad-band exposures. This enhances emission line structures, but commonly results in distorted stellar colours or a skewed general appearance of the image. The solution is straight-forward, and since it has not been documented anywhere else for amateur astronomers, I present it in sufficient detail so that it can be reproduced with other software.

Consider two coadded R-band and {\rm H}{\alpha} images. Both cover the {\rm H}{\alpha} line and shall fully transmit it. Two requirements have to be met:

  1. Both images are normalised to the same exposure time (e.g. 1 second), which happens automatically during coaddition with THELI.
  2. The relative throughputs between the two filters are preserved in the coadded images. In other words, the same continuum source (star) will appear n-times fainter in the narrow-band image if the narrow bandpass is n-times smaller than the broad pandpass. In THELI this is achieved by setting PHOT_INSTRUKEY = FILTER when running the astrometry/photometry with Scamp.

Problem: Let’s consider stars only, which are continuum emitters. When adding the narrow-band exposure to the broad-band exposure, we make the stars brighter, and hence change the colour balance with respect to the other broad-band filters.

Solution: We have to first downscale the broad-band image by some amount, so that the final stellar flux emerges unchanged once the narrow-band image is added.

The scaling factor is easily calculated from the filters’ FWHM ratio. For example, if the narrow-band filter transmits 10% of the broad-band filter, then we have to scale the broad-band image by a factor of 0.9 to accomodate the additional narrow-band flux. Therefore,

I_{\rm \,SUM} = (1 - w * \frac{\rm FWHM_{\,narrow}}{\rm FWHM_{\,broad}}) * I_{\rm \,broad} + w * I_{\rm \,narrow}

Here, I_{\rm \,broad} and I_{\rm \,narrow} represent the two images, and w is a weighting factor that is 1 by default. Now lets consider how this formula works for continuum and emission line sources.

  • Continuum source (star): We assume that the star has a flat spectrum within the bandpasses, which is a good enough approximation for our purposes. Seen through the narrow-band filter, the star then has a flux of

    I_{\rm \,narrow}^{\,\rm star} = \frac{\rm FWHM_{\,narrow}}{\rm FWHM_{\,broad}}*I_{\rm \,broad}^{\,\rm star}

    Insert this for I_{\rm \,narrow} in the first equation, and you will find that

    I_{\rm \,SUM}^{\,\rm star} = I_{\rm \,broad}^{\,\rm star}

    Therefore, a star’s brightness is conserved in the combined image.

  • Emission line source: Both the R-band and the {\rm H}{\alpha} filter encompass the {\rm H}{\alpha} emission line and (nearly) fully transmit it. This means that a pure emission line source, which does not emit outside the narrow bandpass, will appear equally bright in both filters:

    I_{\rm \,narrow}^{\,\rm EMLS} = I_{\rm \,broad}^{\,\rm EMLS}

    Insert this for I_{\rm \,narrow} in the first equation, and you will find that for a weighting factor of w=1 we have

    I_{\rm \,SUM}^{\,\rm EMLS} = (2-\frac{{\rm FWHM}_{\,narrow}}{{\rm FWHM}_{\,broad}})*I_{\rm \,broad}^{\,\rm EMLS}

    In our example, where the {\rm H}{\alpha} filter has 10% the width of the broad-band filter, this means that the {\rm H}{\alpha} flux is enhanced by a factor of 1.9 compared to the broad-band image, while maintaining stellar fluxes. This is sufficient for most purposes. For weighting factors of w=2 or w=3, the enhancement factor would then be 2.8 and 3.7, respectively.

This method works for all sets of narrow- and broad-band filters that cover the same emission line, e.g. a blue or green filter and the [OIII] doublet. If the broad-band filter transmits the emission line to e.g. only 60%, because the line is at the edge of the bandpass, then this can easily be corrected for by multiplying the FWHM ratio by 0.6.

_images/bbnb.jpg

NGC 7822: Left: RGB; Middle: (RHa)GB, w=1.0; Right: (RHa)GB, w=1.5;

Note that the stars’ colours remain unchanged, while the extended nebulosity gets increasingly enhanced with growing weight factors. Exposure data: ST10XME, 102mm FSQ, RGB = (8x8x8)*240s, {\rm H}{\alpha} = 6*1800s. Apart from identical contrast stretching no further image processing took place for these three images. Colour calibration was achieved based on BVR magnitudes of 50 stellar NOMAD sources (see next section below).

17.3. Color calibration

The idea behind colour calibration is to have a solar-type G2V star appearing white in the colour picture. If this only depended on the total telescope throughput (mirror reflectivity, corrector lenses, filter transmission and quantum efficiency), fixed calibration factors could be used. However, the atmosphere changes its transparency continuously, either because of changing airmass, dust, cirrus, humidity etc. Atmospheric extinction has a significant impact even in very clear nights when targets are rising or setting, affecting the calibration factors by 10% or more. If exposures are taken in different nights, the balance can be off even more. Variations on the level of a few percent are easily seen by the eye in a colour picture.

The best way to obtain the colour calibration is to identify solar-type stars directly in the images. Like that

  • no external standard star observations are necessary
  • it works under non-photometric conditions
  • no extrapolation from external observations is necessary.

However,

  • G2 stars are rare (only 6% of all stars are have type G2)
  • known G2 stars in the image could be saturated as only bright stars have spectra taken
  • the reference star could be variable
  • no reference stars are present in the field (or their spectral types are unknown).

17.3.1. Photometric colour calibration (PCC method)

To work around these problems, one can drop the requirement of selecting known G2 stars as standards, and take G2-alike stars instead. These can be selected photometrically from an external reference catalogue by means of their colour indices. In the classic Johnson-Cousins UBVRI system, G2 stars have on average B-V = 0.65 and V-R = 0.5. In SDSS ugriz filters we have u-g = 1.43 and g-r = 0.44. Once a sample of suitable field stars is known, they can be identified in the images and calibration factors are readily determined.

17.3.2. The average white approach

What if no G2-alike stars are found, i.e. in under-dense regions or in images with a very small field of view? In this situation a good white point can still be obtained by making all stars on average white. Compared to the PCC method the blue and green channels appear enhanced. The reason is that the average stellar population is somewhat reddish (80% of all main sequence stars in the solar neighbourhood are red dwarfs).

The calibration factors will also depend on the line of sight: stars in the galactic halo have different characteristics than those in the disk, and towards the galactic bulge things change once more. Thus, one will obtain slightly different calibration factors depending whether one looks outside the disk, into the disk, or towards the galactic centre. Galactic extinction (interstellar reddening) will be partially removed by this method, which might be a desirable effect (or not).

17.3.3. Calibration in THELI

THELI offers both the PCC method as well as the average white approach.

_images/color_3.png

Calibration is fairly easy:

  1. Identify the red, green and blue channels
  2. Method: Select Photometric calibration or Average white
  3. If you go with the PCC method, several other options are available:
    • Photometric reference catalog: Either SDSS or NOMAD. SDSS covers about 11600 square degrees around the northern galactic cap, with a few extensions down into the galactic plane. It is based on CCD photometry which is accurate to within about 1%. NOMAD on the other hand covers all the sky, however it is a conglomerate of different surveys mostly based on photographic plates. Photometric accuracy is significantly worse than SDSS, variations of 10% or more are not uncommon and also depend on sky position. As soon as SDSS-like photometry becomes available for all the sky (Pan-STARRS, Skymapper), NOMAD will be retired from THELI.
    • Choose from various download servers should one of them be unavailable
    • Optionally, edit the B-V and V-R (u-g and g-r) G2V star colour index ranges (i.e. widen them should no sources be found). This compromises the idea of the PCC approach though as more non-G2 stars will be included.
  4. Click on Calibrate. Objects will be detected in the images and non-saturated stars extracted. In case of the PCC method only stars matching the G2-alike stellar sample will be used, whereas with the average white approach all non-saturated stars will be kept. The red and blue images are then scaled such that these stars have on average the same brightness as those in the green image.
  5. Preview the result. This is not a well-balanced image in terms of contrast and black- and white-points, but the colours are accurate. You can modify the calibration factors manually and see their impact. Sometimes, NOMAD calibrations should have their blue values reduced by 10%, and the red values increased by 5% to match those of SDSS. These are noisy though and depend on the line of sight.

17.4. FITS >> TIFF

_images/color_4.png

The last step is to convert the FITS images to 16-bit TIFF format. The latter can be exported into e.g. Photoshop or other programmes for further processing. Note that for Photoshop FITS Liberator is available, which can directly import the FITS images. The next release of FITS Liberator will be a stand-alone tool that does not require Photoshop anymore.

Before you can proceed in Photoshop or with FITS Liberator, you must fine-tune the sky background and apply the colour calibration factors:

Click on Get statistics, which will measure the mean background level and its rms in the statistics section defined previously.

Then choose between two methods to create the 16-bit TIFF images:

17.4.1. Convert FITS to TIFF (classic)

This will convert each FITS image to a stand-alone TIFF image, which you have to combine in an external programme to render the final colour image. You can manually override THELI’s suggestions:

  • Sky: This is the average background level measured in the statistics section. This value can usually be left unchanged.
  • TIFFmin: This will be the black-level of the TIFF image, i.e. all pixels in the FITS image with values below this threshold will be represented as black in the 16-bit TIFF. THELI identifies the image with the largest background noise and multiplies this value with -6. The resulting value, TIFFmin, will be the same for all exposures. In this way the sky background is not clipped. Usually you can leave this value unchanged.

  • TIFFmax: This is the white-level of the TIFF image, i.e. all pixels in the FITS image with values above this threshold will be represented as white in the 16-bit TIFF. TIFFmax is set arbitrarily 500 times higher than TIFFmin.

    If you want to display even brighter image parts without saturation, increase this value, otherwise leave it (or decrease it). For example, you observed a galaxy with a bright core and don’t want this core to be saturated. Measure its brightness in the three colour channels (e.g. red=25, green=15, blue=12) and set TIFFmax to a value that is somewhat higher than the maximum of the three (e.g. to 30).

    Warning

    TIFFmin and TIFFmax must be identical for the red, green and blue channel, otherwise the colour calibration performed previously will be distorted. You may choose different values for luminance channels.

Using the Convert FITS to TIFF button will convert all images listed in the statistics table into TIFF images:

SCIENCE/color_theli/*.tif

If you want to use the corresponding FITS images (colour calibrated and sky subtracted) for e.g. FITS Liberator, use

SCIENCE/color_theli/*_2tiff.fits

17.4.2. Convert FITS to TIFF (using STIFF)

A slightly different approach uses the STIFF package. STIFF creates individual 16-bit TIFF images as well, but can also combine the three colour channels into a colour TIFF, such that you don’t have to do this in external software anymore. In addition, STIFF offers to increase the colour saturation and to apply a non-linear gamma correction. However, these things can also be done in any classic image processing software).

STIFF parameters

Note

STIFF applies the sky background values listed in the statistics table, the same as used by the classic FITS to TIFF conversion.

  • Min | max level: Same as TIFFmin and TIFFmax described above.

  • Saturation: Only meaningful when creating a RGB colour TIFF

  • Gamma: Non-linear gamma correction to the dynamic range.

  • Make RGB image: Select here which images should be converted. If you choose Make RGB image, the red, green and blue images defined in the colour calibration section will be converted into a 3-colour RGB TIFF image, saved as

    SCIENCE/color_theli/rgb_stiff.tif
    

    If you want to convert a specific channel into a grey-level TIFF, then just select it from this pull-down menu. The resulting TIFF image will be displayed automatically and is stored as

    SCIENCE/color_theli/*_stiff.tif

Only one TIFF at a time will be created when clicking on Convert FITS to TIFF.