Set Calibration

The Set Calibration command allows you to initialize the calibration function. Calibration is used to overcome limitations in CCD cameras, as well as other instrumental effects (e.g. vignetting). Calibration greatly improves the signal-to-noise ratio and photometric accuracy of images. For more information on calibration and these tools, please see Image Calibration under Guide to Astronomical Imaging.

Calibration is performed using a group of calibration images taken with the same CCD camera under the same conditions as the actual image. Calibration images must be full-frame images, although they can be binned. The Bias Frame is used to remove offsets, the Dark Frame is used to remove variations in dark current, and the Flat-Field Frame is used to remove pixel-specific differences in sensitivity, as well as variations in illumination across the camera sensor. For all three types of calibration frames, it is best to acquire multiple frames. This reduces the effect of readout and thermal noise in the calibration frames themselves. For more information on calibration, please refer to the appropriate sections of the manual.

MaxIm DL allows you to specify multiple groups of calibration images using the Set Calibration command. During calibration, MaxIm DL will select the three groups of calibration frames - bias, dark and flat - that best match the currently active image. MaxIm DL will select the flat-field whose filter name matches that of the image to be calibrated. If no flat-field with a matching filter name exists, then MaxIm DL will attempt to find a flat field with no specified filter name and apply that group to the images. If the image to be calibrated is a subframe, then MaxIm DL will perform calibration using the matching area from the calibration images. This allows you to set up calibration frames for both the guider and main camera, under a variety of conditions, without needing to switch manually between different groups of calibration images.

Groups of color images are handled slightly differently from monochrome images. For color images, the filter name is always TRICOLOR and cannot be altered. When selecting the calibration group to use when calibrating a given image, MaxIm DL will only select groups which match the color state of the image that you're calibrating, meaning that only color groups will be considered for a color image, and only monochrome groups will be considered when calibrating a monochrome image.

Note that RAW images from DSLR cameras will be treated as either color images or monochrome images, depending on the Convert to Color option in the File menu Open command.

Beginners may wish to use the Calibration Wizard to help select the correct settings. The best way to use this command, though, is to use the Automatic features.

MaxIm DL allows you to create an arbitrary number of groups of calibration images. Each image group is identified by the properties of the images that it contains, including the image type (bias, dark or flat), filter used for flat field, duration, image size, binning and camera temperature. All images in a group must be the same size. These input images are combined to produce a single master frame for each group, which is then used for calibration. Each image group has different properties specifying the algorithm used to combine the images. Groups of dark frames have additional settings that control whether and how they are scaled to match the exposure duration of the image to be calibrated. Once defined, the correct groups are selected automatically each time you calibrate an image, based on information in the raw image FITS header.

Automatic Group Setup

This is the recommended method for setting up calibration.

Although you can create groups and add files to them manually, the Set Calibration command can automatically divide a set of calibration images into appropriate groups. Type the path of the folder containing the images into the Source Folder control, or click the adjacent "folder" toolbar button to choose one using a folder browser. (The most recently scanned folders are kept in the dropdown history; to remove an entry, select it and click the "X" toolbar button.) Now click Auto-Generate, which has two modes selectable via its drop menu: Clear Old and Keep Old control whether existing calibration groups are deleted or retained. The Source Folder will be scanned, and any images present will be divided into groups whose contents have similar properties. If Include Subfolders in the drop menu is checked, image files in the subfolders of the Source Folder are classified and distributed to the calibration groups as well. The file scan can be interrupted by clicking Cancel in the progress dialog, which may or may not result in the creation or modification of calibration groups.

Instead of creating the groups and adding files to them manually, the Set Calibration command provides the ability to automatically divide a set of images into appropriate groups, by clicking the Auto-Generate button. The Source Folder will be scanned, and any FITS images present will be divided into groups containing images with similar properties. If Include Subfolders is checked, then the Auto-Generate command will also find all of the files in the subfolders of the Source Folder, and add them to groups as well.

The speed of image calibration can be greatly improved by the use of master frames. A master frame is the combination of all images in a group, that has been pre-calibrated using the appropriate bias (and, in the case of a group of flats, dark) groups. Once generated, calibration will no longer need to load and combine the images in a group whenever that group is needed.

The Replace w/ Masters button can be used to automatically generate calibration groups that use master frames. When clicked, the Set Calibration dialog will automatically generate the master frame for each group, and save it to disk. The files are saved in the folder specified by the Source Folder control, and each file's name is generated based on the description of the file. Once all of the master frames are successfully saved, the file list for each group is changed. The existing files are removed from the group, and the single master frame that was constructed from them is added. No other group properties will be changed.

Note: Settings are saved between sessions. If you calibrate an image without first running the Set Calibrate command, the previous calibration files will be loaded.

Scaling and Combine Type

Dark frames can be automatically scaled to match the duration of the light frame. Note that in order to work correctly, you must use a Bias frame.

Dark Frame Scaling allows you to select one of several dark frame scaling modes:

Note that dark frame scaling is also used for dark-subtracting the flat-field frames. So you can either take a set of "flat-darks", or just use the same darks as for your light frames - even if the exposure time is different.

Combine Type allows you to specify the algorithm to be used for combining the images in the group into a single, master image:

The Bad Pixel Map dropdown is enabled when a dark group is selected. It lists all non-empty bad pixel maps defined in the Remove Bad Pixels command. If a dark group is used to calibrate an image, its associated bad pixel map is automatically applied at the end of the calibration process, after the pedestal has been added to the image. You must make sure that the bad pixel map is appropriate to its dark group (i.e., correct camera, binning, etc.). Select the entry <NONE> if you do not wish any bad pixel map applied when a particular dark group is used.

The Apply Boxcar Filter setting is available only for groups of flat fields. When enabled, this setting causes MaxIm DL to apply a boxcar kernel filter to the master flat generated from the group. It is useful for raw images from DSLRs and one-shot color cameras, in which adjacent pixels vary in intensity due to the different filters covering them. If a flat field is applied normally MaxIm DL will calibrate out all of the color information. The solution is to blur the flat field slightly.

If Apply To All is checked, then any change to the group settings (excluding the addition or removal of files) will be propagated to all other enabled (checked) groups. Normally these settings affect only the currently selected group.

Manual Group Setup

Manual setup is usually only done by more advanced users, or if you are dealing with files that do not have FITS headers and cannot be automatically sorted into groups.

The Add Group button allows you to create a new, empty group. The group type is set by the combo box next to the Add Group button. If <AUTO> is selected, the type is assigned according to the first file that is added to it. Click Remove Group or press the Delete key to delete the selected group. Clear All Groups deletes all of the existing groups.

The list of Calibration Groups can be sorted on any column by clicking on the column header. Sorting never affects the way image calibration is actually done.

To change the type of an existing group, right-click on its row and select the new type from the context menu. To change a group's name, double-click anywhere on its row, then type the new name into the Name column. For monochrome Flat groups, you can double-click directly on the Filter cell to modify it. In either case, press Enter to complete the edit.

The Group Properties for the selected group are displayed below the list of groups. Each group contains a set of images that are combined to produce a master image, that latter being used for image calibration. Clicking the Add button displays a dialog that allows you to add new files to the list; alternatively, you can drag and drop a list of files from Windows Explorer onto the Set Calibrate dialog. Remove (or the Delete key) removes the currently selected files from the group. Normally, the list of files shows the full path to each file. If you click Show File Names Only, then only the file name will be displayed. You will be prevented from adding images with incompatible properties to the group (for instance, you can't add a 256x256 image to a group that already contains a 512x512 image). Also, if a group contains a master calibration frame, then that is the only file that may be present in the group. You may not add a master frame to a group that already contains other images, and you may not add any other images to a group that already contains a master.

Sigma Clip and SD Mask Settings

When the Sigma Clip or SD-Mask (Standard Deviation Mask, a custom algorithm contributed by Ray Gralak) combine algorithms are selected, additional parameters are required to control how the images are combined. In both cases, the input images are normalized to the same intensity level before they are combined. Normalization works by examining a rectangular Normalization area that occupies the center of each input image; the size of the rectangle is a proportion of the input image, as specified by the Normalization area. Two algorithms are available for normalizing the images. If Delta-Level is selected, then only the image background levels will be modified by normalization. If Linear is selected, then linear regression is used to determine a combination of changes to the background level and the scaling of the image data, resulting in images with equivalent overall intensity levels.

Both algorithms work by calculating the mean of each pixel value, for all of the input images, as well as the standard deviation of those pixel values. If Ignore Black Pixels is checked, then any pixel with a value of 0 is excluded from the mean/standard deviation calculation. If Ignore Pixels Over is checked, then any value exceeding the specified value will also be excluded from the mean/standard deviation calculation.

The Sigma Clip algorithm works as follows. Once the mean and the standard deviation of the input pixels are known, the pixel that is farthest from the mean is selected. MaxIm DL will then calculate the number of standard deviations between the mean and the outlier pixel's value. If the outlier pixel's value is fewer than Sigma Factor standard deviations from the mean, then the calculated average is assigned to the output. If the outlier pixel's value is greater than Sigma Factor standard deviations from the mean, then the outlier pixel is discarded from the set of input pixels, and the mean of the inputs is re-calculated, excluding the outlier. The new mean is then assigned to the output pixel.

When using the SD-Mask algorithm, a similar technique is used. The SD-Mask algorithm works by repeatedly applying the same process to the image, for a number of times given by the Number of passes. With each pass, the input images are normalized to the same intensity level (see above for a description of normalization). Then, for each pixel in the output image, the standard deviation of the set of input pixels is calculated. If the standard deviation exceeds the Sigma Factor (note that this parameter has a different effect and purpose than in Sigma Clip) then the median of the input values is assigned to the output.  Otherwise, the output is the mean of the inputs. The idea is to use the mean where possible because it does a better job of suppressing gaussian noise, and to use the median only when there is reason to expect that the input data contain outliers.

Advanced Settings

The Advanced settings should only be changed by advanced users.

The Pedestal setting is used to compensate for noise in the calibration frames and in the image being calibrated. This value is added to the final calibration frame so that all of the pixel values are positive, and is recorded in the PEDESTAL keyword of the FITS header. It should be set to 3x the standard deviation of the background noise for the image, as displayed in MaxIm DL's information window. You may need to increase this number for certain models of cameras.

The Calibrate Bias, Calibrate Dark and Calibrate Flat check boxes are used to enable or disable the use of the associated type of group for calibration. If bias and dark subtraction are both enabled, then the dark frame will always have the bias frame subtracted from it. Flat fields are themselves calibrated before being used to calibrate a light frame, but it is possible to disable the bias subtraction and dark subtraction steps using the Dark-Subtract Flats or Bias-Subtract Flats check boxes. Normally these functions should all remain enabled, since MaxIm DL automatically determines the correct files to use.