Processing steps for astrophotographs

This page is up to date for GRIP version 12.3.15 but see the "What's new" page for more recent changes.

This process is available on the Batch/Astro menu of GRIP. There are now (2012 March) several relevant options on that menu. Read about them here and then come back to this page.

Two of the options ("Astro combine into 1 image" and "Astro warp/shift onto common basis") cause the astro-process dialogue to be displayed. Its title shows which option was selected: the title is either "Astro COMBINE" or "Astro ALIGN".

Controls in the astro-process dialogue

Files to process is a complicated control with a list of files and 3 buttons. The easiest way to use it is to click its "Browse..." button on the right to select a number of files in the usual way. The files will then be listed and the buttons "View first" and "View last" may then be used to open the first and last images in the list, for visual confirmation that you have selected the right range of images. Having opened either of those images it may be useful to check that certain processes on the levels menu give reasonable results on them, before embarking on the full time-consuming process:

correct background (if required - not intended for telescopic images)

auto-segment (stars)

detect blobs

Method: Warp - GRIP was designed on the premise that simply shifting images to superimpose them would not be good enough because camera and telescope optics always distort images to some extent. If objects have moved from one frame to the next they will not be distorted in exactly the same way. So recognising objects by their mutual patterns and then warping to superimpose them for noise reduction was GRIP's original method of working. It is most necessary for non-telescopic photographs taken on a fixed tripod, so the stars move significantly through the image sequence. It is unlikely to be necessary for images taken on a driven equatorial mount (with or without telescope) because the stars then move only by small amounts. Warp is still the method unless you deliberately select one of the following instead.

Method: Shift by average - it has become apparent that there are not always enough stars in a telescopic field for the warping algorithm, which really needs at least 9 objects that are matchable throughout the sequence of images. So this simpler method is offered. It finds the average offsets of all objects from one image to another and simply shifts (ie, translates) an image by that average offset for superimposing it on the accumulating image. This method is also adequate for photos taken on a driven equatorial mount, but may not be good enough on a driven altazimuth mount because of field rotation.

Method: Shift by brightest only - in some images (eg, photos of planets) there is really only one large bright object. For this case, GRIP also offers the simplest possibility: measure the offset of only the brightest object in every image and stack the images using only those shifts.

Dark frame image should be used if you have created a dark frame. There is a browse button for selecting the file. There is also a button for viewing the selected file, for visual confirmation. The dark frame would typically be an averae of several dark frames, the averaging having been done before this via another batch menu option.

Flat field image should be filled in if you have created a flat field image. There is a browse button for selecting the file. There is also a button for viewing the selected file, for visual confirmation. Again, the flat field should have been prepared beforehand.

Neutralise background first does statistics on each image to find the mode in each channel. It then determines which channel has the minimum modal brightness and scales the other channels so that their modes move down to that minimum level. The modal values of astro images usually relate to the background sky. The sky is commonly coloured by light pollution so this operation neutralises the colour by making the background levels all more or less the same. It does not affect the maximum level in each channel so bright objects will not change colour. This option is more suitable for telescopic photos than the next one is. It can be useful even if also using a flat field image. It should not be used if the end result of the processing is to be used for measuring star magnitudes.

Correct background from histogram should be ticked if the background level of your images is not uniform (see details here). This is likely to be the case for camera images with lenses of wider angle (say, less than 100mm, for 35mm cameras). If you are processing telescopic images, and particularly with a flat field image, then there is no need to tick this box. It should not be used if the result of the processing is for measuring magnitudes.

Do inverse gnomonic projection is also only likely to be needed for wide angle photos taken without a motorised drive, to enable them to be mapped onto each other more easily. More details are here.

Lens focal length (mm) may be needed if inverse gnomonic projection is to be done. In many cases it is even then not necessary to enter anything in this field because the focal length can be obtained automatically from metadata in the image files.

Tuning parameters: allows certain parameters to be altered from their initial values. The initial values have been found to work reliably on many images so try the processing first with those. The number of brightest stars to measure in each image needs to be at least 9 for the warping algorithm to work. The larger the number, the longer it will take to analyse matches between images. The matching works by considering the vectors between the brightest stars in the image. Two vectors are considered to match if they are of similar length and orientation. The tolerances for measuring similarity can be adjusted here. In practice it has only been necessary to increase them for the second kind of processing, where a number of images taken on quite separate occasions are being matched and their orientations are considerably different.

Show objects detected in each image (diagnostic). As it says, this is only a diagnostic aid. If you do use it, it is important to close the displayed diagram windows fairly quickly, or you may run out of memory during the processing.

Run with no pauses. If this box is ticked the processing will run right through without any opportunity for intervention. The results will be saved in 2 files: a 16-bit TIFF file and a file twice as big in a special format for the 32-bit-per-channel accumulator. Only GRIP can re-read the accumulator file, to load all of the summed image data back into memory. If the box is not ticked you will get a chance between passes 1 and 2 of the processing to deselect object matches which look wrong.

Process button starts the processing of the selected images, as described in further detail below.

Cancel aborts the processing.

Help displays the present page in your system's default browser.

Dark frames

The original plan was to identify dark frames automatically among the sequence of images and then, for each real image, to subtract the dark frame which was taken at the nearest time. The identification of dark frames proved to be unreliable so a simpler approach has been adopted. It is now assumed that you have used the averaging batch process on a series of dark frames beforehand. The dialogue explained above asks whether there is such an averaged dark frame and where it is.

Flat fields

It is possible to use flat field images, if available, for the process. A flat field is a photo of a uniformly illuminated white area, completely filling the frame. This must be photographed with exactly the same optical arrangement as the images for which this is to be used to correct.

DSLR darks and flats

With a DSLR it is not really necessary to use dark and flat frames during the stacking process. For one thing, hot pixels can be mapped out in the camera. (For Canon cameras, before each session do the following. Put the body cap on. Select the menu option for manual sensor cleaning, which flips the mirror up. Leave it like that, mirror up and body sealed, for about a minute. Then switch off, releasing the mirror. At this point it seems that the camera stores a list of hot pixels. This list must go into the metadata of each image so that Adobe Camera Raw and similar programs can use it when interpolating for the Bayer filter. I have not been able to work out where the list is, to use it in GRIP. Instead I convert my RAW images to TIFF before stacking, using Canon's DPP application that came free with the camera, and that process apparently uses the list.)

The flat field can be applied to the result after the stacking as a manual step on the image combination menu, rather than applying it to every frame along the way - unless there is very large movement of stars through the image sequence.

The steps of the process

User selects an arbitrary number of image files to process. They must be all in the same format but that may be RAW if the particular RAW format from the camera can be read by the jrawio library (find that out by trying to open a RAW image file in GRIP before starting this process; if it fails it will be necessary to convert the images to TIFF through other software before starting this process)

The user selects an averaged dark frame image (if there is one); it is loaded; if it is RAW it is interpolated, scaled and its dark margin trimmed (as set in the configuration menu)

The user selects a flat field image (if there is one); it is loaded; if it is RAW it is interpolated, scaled and its dark margin trimmed (as set in the configuration menu)

Pass 1: for each image file

load the image from file (into memory but do not waste time displaying it)

if the image was in RAW format, do the necessary interpolation and scaling and trim its dark margin (as set in the configuration menu)

if the image has been modified by any of the preceding steps, save the adjusted image as a temporary file in TIFF format

segment stars in the image, as blobs (contiguous groups of pixels)

list the positions of the centres of the brightest N objects (N is a configured parameter, default value 24; see the configuration menu)

Analyse the positions measured in all the images to match brightest blobs between images

Pause to let the user reject some matched objects (not usually necessary, but in case some non-star objects have been matched). This is done by displaying a diagram of all the matches and asking the user to draw rectangles intersecting the match trails which are to be rejected. Here is a portion of an example of such a diagram (the diagram is displayed as an image in GRIP's usual way, so it can be manipulated and saved also).
This diagram shows part of the constellation of Andromeda. Numbering starts at 0 and roughly increases as measured star brightness decreases (though it is really more complex than that). Confirmation is sought before each trail is deleted.
It is necessary to close the window containing the diagram in order to proceed to the next step.

Another window opens at the end of each pass of the batch astro-process to summarise the displacements between all the images that have been processed. An example can be seen here.

Pass 2: for each image

load the image from file (from the temporary file if one was made in pass 1)

use the measurements from pass 1 to warp the image slightly, like a rubber sheet, so its brightest objects fit over the brightest objects in the middle image in the sequence

add the warped image into an accumulator image (32 bits per channel)

delete the temporary file, if there is one

Save the result as a FITS file, 32 bits (integer) per channel, as a safeguard in case the user forgets to save it.

Display the result in the usual GRIP image frame with all menus available.