Advertisement / Annons:
I have some old astrophotos taken with cameras and telescopes that I no longer have left. The old flat frame images I have are or of bad quality or I don't have any at all and I can't make new anymore.
I also have problem with the flat images I take today. There are always new dust and drying stains from earlier cleaning that don't match the flat image. There are also old dust and markings on flat image that have been cleaned away from the sensor, see below how it appear on the image. I can of course always take new flats and make new master flats, but it's very time consuming. There are also internal reflections in the telescope that get caught on the flat image that make problem when increasing the contrast in the images.
The light grey blobs are from the flat calibration when it try to correct for dust that's not on the sensor anymore. The dark gray blobs are from new dust on the sensor which is not on the flat frame. Of course will a master flat created by math not handle the dust blobs, but I think it's better to handle them separate. One drawback is that a synthetic flat image doesn't compensate that different pixels has small variations in the sensitivity relative each other. But I already deal with fixed pattern in the back ground with dithering technique, that will also reduce this problem as well.
These problem are what I try to solve with synthetic flat images. I will do it with AstroImageJ, but there was one problem for me. To do this I need to develop the plugin with JAVA, and that something I don't have any deep knowledge of. But now I got a new friend who knows how to do these JAVA plugin and he is interested in astronomy too, I learn a lot from him.
Find a polynomial that simulate vignetting, a flat frame:
I have prepared this by setup an Excel sheet that calculate the parameters for a polynomial that simulate a rotation symmetric vignetting. The polynomial is of sixth degree.
Because it's rotation symmetric the b*x1, d*x3 and e*x5 are not used.
The function that calculate a flat frame use the radius which is: r = rot ( x2 + y2 )
To get something to start with it is good to have an old flat frame even if it is of bad quality. In an example on next page I will show how to use the background to get some values to use when setting up the polynomial. The camera data with the size in pixels of the sensor has to be put in the Excel sheet. The X and Y position of the optical center has to be find. It's needed some levels along the radius-axis, from the corner to the optical center. The X and Y-positions to use for these test points are calculated in the Excel sheet above (ImageJ X, ImageJ Y, columns colored green).
All fields is market red are were you have to put in some data. The blue fields are were you get data to the Flatfield-plugin that make the synthetic master flat.
Find optical center:
I use AstroImageJ and open one not so good masterflat. First try to find the optical center, it's not very difficult. Open an old masterflat image or an image with heavy background light. It open as a grey scale, here I have changed the Lockup color table to get it colored, se below how.
Change the lockup table in AIJ to someone that increase the contrast and let you see the center better. Adjust the contrast of the image with the scrollbars at bottom of the image, zoom in.
Move the cursor to the center where the level (Value, top right) is strongest, move the cursor around the center to get some average level. Take the coordinates of ImageJ X, ImageJ Y (above left) and put it in the Excel sheet at camera data and 'optical center real'. You also get the size of the image at top left, in this case 2238x1477, put in this figures in the Excel sheet.
Now there shall be some pre calculated positions where to place the curser, the green values in the Excel sheet.
Find the levels along X-axis:
Move the cursor until ImageJ X and ImageJ Y correspond to the pre calculated table 'X and Y-columns' colored green in the Excel sheet. You only take the values on the left side, the values on the right side will just be a mirror because this vignetting simulation we calculate is rotation symmetric. It follows the line from upper left corner to where it cross the optical center. Take the Value at the pre calculated ImageJ X and ImageJ Y coordinates and put it in the Excel sheet.
Values along the diagonal:
Calculate the parameters:
The constants for the polynomial will immediately be calculated. The upper row of blue values. The second red row is used to set these parameters manually if you want to fine adjust them. Both the calculated and your fitted curve will be drawn in the Excel sheet so you get an overview how it looks. Choose either the blue or red parameters and write them in the Flatfield function in AstroImageJ. You can now download the Flatfield plugin at bottom of this page and install in AstroImageJ.
The problem for me with this master flat and why I don't use it directly, it is that I only have the aperture set to f/4.5, not f/5.6 or f/6.3. By testing with variation of the parameters I can find the correct curve fit for the other aperatures.
A flat image are normally normalized to have the value = 1 at center.
Setup 'Generate synthetic flat':
Take one set of the polynomial parameters and put them in the plugin Flatfield to generate a synthetic flat. The Flatfield plugin is now ready for download.
The new synthetic master flat. You can use it for all colors. Save it somewhere in your directories for master flats.
This is just the beginning, it will come more later !
Excel sheet that calculate the parameters:
You can download the Excel sheet here:
Function Flatfield for AstroImageJ:
You can download the function here:
Instructions how to use AstroImageJ and install plugins: Tutorial AstroImageJ.