ASG Astronomy

Explore our collection of articles and tutorials

Creating Calibration Files

Flats, Darks, Bias, how to do calibration files with your astro camera

When you use a CMOS camera with deep space imaging, it is very different from fast ISO exposure images taken with many DSLR cameras.  Exposure lengths can easily reach 5-10-15 minutes and with that comes inherit heat, signal noise, and light artifacts you may not otherwise see.

Calibration files are designed to eliminate inherent noise in your camera, inherent noise with electronics and heat buildup, and inherent noise from dust and optics.  Using a variety of these calibration files can really give your images that cleaned up and boosted look as well.

Lastly, calibration files are very easy to do, can often be done during the daytime, and best of all they are a free way to upgrade your images.  There is no downside to NOT creating calibration files other than a bit of unknown or misconception of how or when to use them.  Hopefully we can simplify it here.

Bias Frames (or Bias)

Bias frames are the simplest calibration images, requiring only the camera body and a lens cap. They capture the read noise and the inherent electronic signal (often called dark power-on noise) that a camera produces simply by being powered on. They are acquired with the shortest possible exposure time (e.g., seconds) and with the sensor in complete darkness. Bias frames are essential for removing this baseline electronic noise from all other calibration and light frames.

 

Dark Frames (or Darks)

Dark frames are long-exposure images taken with the lens cap in place, matching the exposure time, temperature, and gain/ISO settings of the corresponding light frames (the actual images of the sky). While a quick bias frame captures the minimal power-on noise, a longer exposure allows for the accumulation of dark current noise, which increases with exposure length and sensor temperature. This noise appears as random speckling and can also manifest as amp glow—brightening, often along the edges, common in CMOS sensors. Dark frames are critical for subtracting this thermally-generated noise from the light frames.

 

Flat Frames (or Flats)

Flat frames are used to calibrate out non-uniformities in the imaging system’s light path. They require illuminating the sensor evenly across its entire surface. Flats correct for several optical imperfections, including:

  • Vignetting: A gradual dimming of light toward the corners or edges of the image, often caused by small-diameter filters or insufficient light coverage on a large sensor.

  • Dust motes, lint, or smudges: Imperfections on the camera sensor, lenses, or filters that create distinct shadows or rings in the image. Flat frames essentially capture a map of the entire optical train’s light transmission and are used to normalize the pixel values across the final image.

 

Dark-Flat Frames (or Dark Flats)

Dark-flat frames are optional calibration frames designed to remove any dark current noise specifically generated during the acquisition of the flat frames. They are taken with the same exposure time, temperature, and gain/ISO settings as the flats, but with the sensor covered (like a dark frame). They are independent of the optical path. However, because flat frames are typically short exposures (e.g., to seconds), the dark noise generated is often negligible and can sometimes be effectively removed by simply using a master bias frame. Their utility is a point of debate among astrophotographers, with many considering them unnecessary for typical CMOS systems.

 

Bad Pixel Map

A Bad Pixel Map is a file generated to identify and correct pixels on the sensor that are permanently malfunctioning—either “dead” (always black), “hot” (always bright), or otherwise defective upon manufacture or from subsequent use. These defective pixels appear as static, unchangeable artifacts in an image. The map allows processing software to interpolate and replace the values of these non-functional pixels with the average values of their surrounding, healthy pixels, effectively removing them from the final image.

 

Image with no Calibration

This image of LBN 325 was a stack of images and NO calibration files taken into account.  Notice the severe gradient over the top, which is more vignetting and flats will take care of that, but also noise and other data errors in this image.

 

Image with Calibration

This is the same image loaded with calibration files for Bias, Dark, Flat, and Bad Pixel Map in Astro Pixel Processor.  The flats have removed serious gradients and with the use of bias and darks there is no amp glow on the ends and much sharper signal to noise ratio.

Best Practices for Acquiring Calibration Frames

To ensure optimal results and a consistent workflow, adhere to the following rules when capturing your calibration frames:

Maintain Software Consistency

Always process and stack your images using a calibration library built entirely within the same software package. Different software applications (e.g., dedicated capture software vs. stacking programs like AstroPixelProcessor, PixInsight, or DeepSkyStacker) may implement algorithms for creating master bias, master darks, and master flats differently. Mixing files or generating masters across different programs can introduce inconsistencies or artifacts. Establish your calibration library using the same platform you intend to use for final image integration.

Ensure Temperature and Gain Match

It is critical to match the sensor’s temperature and the camera’s gain/ISO setting to the corresponding light frames. Thermal noise (dark current) is highly sensitive to temperature. Therefore, if you primarily image at with a gain of 100, your dark frames must use those exact settings. Develop a standardized approach for your most-used settings (e.g., at 0, 75, or 139 gain) to simplify your ongoing calibration library management.

Establish a Coherent, Planned Capture Strategy

Capture your entire set of bias and dark frames in a single, dedicated session. While flat frames often require specific sky conditions (twilight or a uniformly illuminated panel), collecting all other calibration files in one go ensures maximum consistency and minimizes the chances of forgetting a setting or deviating from a standard. Schedule this task during the day or a period of poor weather. Building a complete, organized calibration library all at once prevents the common issues of inconsistency and loss of rigor that arise from acquiring files piecemeal over a long period.

HOW to CREATE each calibration type

 Creating Bias

basic rules to follow, take quick exposures with the lens cap on in the total dark.

  1. Cover lens cap
  2. I like to do gain/offset and temp  (-10 or -20 and gain sets of 0, 75, unity, 200 or whatever you commonly like)
  3. Lowest exposure setting of say .001 seconds that your camera will handle
  4. take 40 or 50 of them, they are quick

Creating Darks

Darks are long exposures, setup can take a couple days.  I usually do -10 or -20 and take a low gain setting, unity gain setting, and a high gain setting.  You will take your most popular exposure lengths.  I typically do 15s, 30s, 60s, 90s, 120s, 180s, 240s, 300s, 600s of each gain.

  1. Cover lens cap
  2. I typically do 15s, 30s, 60s, 90s, 120s, 180s, 240s, 300s, 600s of each gain (0, 75, unity, 200).
  3. Use same temperature you will take at.  I always do -10 or -20, but you may do 0 as well.
  4. take 10-30 of them in each gain/exposure combination.  Some take a long time, so it can easily take 2 days.
  5. It’s important to calibrate these with the bias of the same gain you created earlier.

Creating Flats

Flats are fairly quick to take, and should be done after every imaging session as dust and imperfections change.  In reality, I use a set of master flats for a couple months.  Do as you see fit.  You should have a flat for every filter if you do narrowband because each filter can have different imperfections.

  1. Use a t-shirt over the scope, or early morning dusk/dawn sky, or a flat panel LCD off amazon over the top of your scope… just a consistent light source that isn’t scalding bright.
  2. Take a few exposures, shoot for about 20,000 ADU or about 30% of your histogram.  Easy way is to take a picture and look at your histogram, the large hump needs to be around 30-35% across the histogram.  Adjust your exposure accordingly until you find the right area.  It all depends on your light source.  Some may be .02seconds, others might be 5 seconds.  I like to dim my light source so that my flats are about 1-2 seconds.
  3. take 20-30 of them.  I use the same temperature as my imaging.  Gain/offset and exposure really can very here.  I take with the same gain I use most often, but it won’t hurt if the gain is slightly different here, they are quick and will work when calibrating.

Creating Dark Flats

These are the most optional calibration in my opinion.  I don’t use them often, but if you take flats, the idea is to cover your lens and remove the optical train, capture that dark flat noise at the same gain, exposure, temperature.  A good bias will do virtually this same thing since these are such small exposures very little dark current has time to build up.  It’s much easier to just reuse a Master Bias here than to take dark flats.

  1. Cover your lens cap after taking flats
  2. Take 20-30 of them at same temperature, gain, exposure as your flats.

Bad Pixel Map

A bad pixel map is a good idea if your system generates one.  I know not all stacking software will calculate the bad pixel map, but Astro Pixel Processor is a good choice that does calibrate one for use.  Nothing special here is needed, your master calibration process will create one if available.

Loading and Creating Masters

Once you have collected and built all these images, it’s time to load them into your stacking software.  ALWAYS use the same software you will stack with to build your master files.  You are essentially going to add all the calibration files and then create one master bias, master dark, master flat, bad pixel map for each set of images.

All your calibrations are combined into these masters that you can reuse for the life of your camera (with the exception of Flats, which are good to do once in a while.)

Notice we have here a Bad Pixel Map for each gain, a Master Bias for each gain, a Master Dark for each gain AND exposure length, and then a Master Flat for each optical filter change.

Now when I go to stack images, I can throw in a few master files and I get all that bad signal removed and it didn’t cost anything!