Astrofriend's homepage


Ad / Annons:

Project News

Ad / Annons:

Flat calibration and how to shot flat images for color cameras

Flat image calibration

  1. Flat image for color camera
  2. Pixel gain differences
  3. Hardware setup
  4. Exposure
  5. Master flat 3D analyze

1: Flat image for color camera

When I make flat calibration I often use the computer monitor to be able to control the color temperature. For a "white" in raw mode on the camera that will provide the same signal strength on all three color channels require anything else than a white screen to shoot. The advantage of to have the color channels to have the same level is that no one over exposure (saturating) before someone else or one is to low and make noise.

Here is a normal raw histogram, gain equal to 1 for all channels. As you see the levels are very different between the channels, not good. To the right is a line graph diagonal over the sensor, very heavy vignetting because of the lens aperture set to wide open, a Pentax 500mm f4.5 lens.

Histogram whita image

If we instead of a white image have a colored one we can handle this problem. I make them in the simple photo program Paint.

Pink calibration image

Choosen like this it will give the same level on the r, g, b channel and it will look something like this. The color will be different with other combination of cameras and lenses/telescopes.

And here is how the histogram will look with this image:

Histogram pink image

Much better, now the level are equal between the channels. Here I have set the mean level to 50% in the peak center of image, 2000 to 2400 (image to the right). My camera is a Canon 5D that has 12 bit raw files, 4096 levels, but this camera is a little bit special, only use the first 3700 levels. Important, do not oversaturate the histogram to the right (left image), clip the high level and the calibration will go wrong!

Back to contents

2: Pixel gain differences

When making a flat calibration is not just to eliminate vignetting. Each pixel has a slightly different gain and it usually follow the columns. Flat calibration normalizes also the gain on all the pixels, and the static patterns that can be seen in the light parts are reduced.


This is how a flat image in detail will look, in addition to the large patches of vignetting there is a finer pattern pixel to pixel variation as seen above and often follows the columns as you can clearly see here. I made a horizontal line chart, a short composition, see horizontal line in the middle of. Apparently, the signal fluctuates a lot pixel to pixel and that will be reduced a lot with flat image calibration.

In this case, the signal is 2085 +/- 20 ADU, about 1% may not sound like much, but when processe the image to bring out the little weak variations (nebula, galaxies) it also reinforce this pattern and it can get really ugly.

Back to contents

Ad / Annons:

3: Hardware setup

Are supposed to say that it is very difficult to make high quality flat-images for calibration. I usually put a white paper as a diffuser about 0.1 meter in front of the monitor. However, it is very sensitive about the lights falling onto the paper and monitor screen, which can give undesirable gradients. I will try to develop this further because flat calibrations is important.

Here is my very simple setup that I have when doing flat shooting:


The diffuser is a sheet of paper that I tape to the hood.

Light sourche

LCD monitor that is connected to a laptop with a mirror image across both displays, the distance is about 0.05 to 0.1 meter. Here you set the color that gives the same signal strength on the three RGB channels, the image I created in Windows Paint. The levels that are balanced between the three color channels are important since they are taken with the same exposure time in a color camera. Level becomes too low on any channel and it make the flat image noisy, and to high and there is a risk to clip the highlights. If you have a monochrome camera you don't have to worry as you take an exposure for each color at a time.

Note that the histogram in the camera usually is useless, it is not linear. On my camera, a Canon, the 50% linear level is when the cameras histogram is pushed to the right edge.

Dark cover

When I take pictures I cover the installation with a light shield and switch off the lights. If you do not shield the screen from disruptive light or the light changes in the room, from other monitors for example you will have problem. You have to do it much more serious than I have done it in the image above.

I set up a batch in the camera control program (APT). Example: 55x ISO400, 55x ISO800, 55x ISO1600. Takes just minutes to complete. Do not forget to tape the viewfinder of the camera so no light enters backdoor and disturb, even more important when taking darks.

These flats are supposed to also have a set of darks, the flats are taken with about one second exposures, I usually use the same darks as bias. However, if I have done this flats for multiple iso speeds it needs to take darks with the appropriate iso to each and bias also.

Back to contents

4: Exposure

What exposure to choose? They shouldn't be to short, Anders at Astronet remind me that to short and it can interfere with monitors refreshrate. To long and the sensor build up dark-current. You can adjust the monitors contrast and brightness, if this isn't enough, ad an extra diffuser (paper).

Back to contents

Ad / Annons:

5: Master flat 3D analyze

Here i have taken an another flat image, I reduced the aperture to f6.3 to reduce the vignetting and get a more even light.

Flat image f6.3

Compare with the earlier one in the beginning

Flat image in 3D

This is a 3D representation of a master-flat image, this and the other images done in Fitswork. It is clearly visible stains and dust on the sensor and the abrupt cutting of the signal when the light cone approaching the edge of the sensor. Mostly caused by the DSLR camera's narrow entrance to the sensor. The softer rounding come from flat field corrector limitations. The deflection around the circular edge from M48 adapter which in this case is undersized. How to get the sensor free from dust and dry patches seem to be a real science, I've never succeeded. And when I manage to get it quite well, it happens that during the flat image taken sometimes new dust falls down on the sensor that has been hidden in the camera body.

Back to contents