Saturday, May 19, 2012
Basic image acquisition digital camera settings
There are some very good books on this subject. This section is only intended to be a quick reference to get the reader started, complimenting the basic GIMP image processing tutorials Part 1 using the most basic equipment at hand - at least, a tripod and digital camera.
If you have progressed to a Double Arm Drive or an equatorial mount, you will know that polar alignment, focal length, aperture, ISO and exposure time are basic considerations.
The challenge
Astrophotography can be very demanding. Low light (night time) the rotation of the earth and many other variables, require that the astrophotographer adopt a methodical approach, to consistently produce satisfying images.
Equipment and settings
Tripod - A rigid set up is essential for good results. If necessary and to avoid flexing, set up the tripod without extending the legs fully. As short as possible for comfort.
Camera - Manual settings and the ability to take exposures of 10 - 30 seconds is preferable. Long exposure times will ensure a reasonable degree of detail and produce interesting images. Automatic focus should be off.
Lens - Focal length - Star trails are more pronounced when using long focal lengths. For fixed tripod astrophotgraphy, short focal lengths produce less trailing for longer exposure times.
Aperture - The widest offered by the camera / lens combination, to maximize light transmission. However, the overall performance of the lens may be improved by stopping down 1 or 2 stops.
ISO - Use the highest ISO available to the camera.
Focus - Focus may be achieved by using camera live view, set to 10x zoom, or with the assistance of a focus mask.
Live view focus is OK? The target star should be as small as possible and free of colour fringing.
Focus masks are more reliable. Take a series of 10 or 20 second exposures and adjust focus between as required.
Exposure time - set the exposure time short enough to avoid star trails (unless you want that effect), and sufficiently long to capture adequate detail. Let’s say that a focal length of 18mm will allow up to 20 seconds exposure time, 24mm, 15 seconds - 35mm, 10 seconds and so on.
Number of exposures - more is better, with the proviso that someone will have to align the images. Great if you have the appropriate software, but if you are using GIMP or Photoshop, alignment must be done manually. 6 to 10 is adequate at this stage.
If you don’t have an intervalometer, or a remote shutter release (wired or electronic), set the shutter delay at 2 or 3 seconds - just enough to allow the camera to settle before the shutter activates.
Delay between exposures- 3 seconds should be adequate - allow the object of interest to move across the sensor between images, so that we can improve the look of our final image, once all are combined.
If it’s cloudy let the clouds drift by, or leave them in for effect. If satellites pass through an image, we can discard and take another, as preferred. Car lights and neighbors outdoor lighting can be a nasty surprise. Choose a dark area preferably.
When finished imaging, take bias, dark and flat frames with which to calibrate your newly acquired images see Part 1.
Here is a preview of the combined image used for demonstration in Part 1and Part 2 of the image processing tutorials.

Wednesday, May 16, 2012
The Bow Tie Focus Mask: an hybrid diffraction mask
The Bow Tie focus mask, described here, is derived from Carey and Lord focus masks, which are types of diffraction gratings, similar to the well known Bahtinov mask.
The bow tie mask was purpose designed to suit a small aperture, short focal length lens. The four obstructions are intended to produce splayed double spikes, similar to the Carey mask, while eliminating the grating typical of focus mask designs. The wide obstructions and absence of grating increases the brightness of the diffraction spikes - discernible with a small lens.
The junction of the obstructions also provides an area of certainty. A central spike perpendicular to the double splay is generated at focus. This spike is not present otherwise. Another phenomenon of this design is the presence of red and/or blue fill within the splay of each pair of spikes.
The bow tie mask is easy to make. A flat section of rigid bubble wrap is easily cut to shape with a hobby knife and steel rule. The clear plastic can be coated with black indelible marker. Sharp straight edges are essential.
Using the bow tie mask is straightforward. Equal spacing of each pair of spikes and the presence of the perpendicular spike indicate focus.
Sunday, March 18, 2012
Equatorial mount hand controller dither pattern: non-automated
Here is a method of using your non-automated Equatorial mount RA/DEC hand controller to dither your images.
Why dither
I think dithering has been mentioned briefly in another topic, and it cant be over emphasized. Dithering, particularly with DSLR cameras improves signal to noise ratio for very little effort. It can be win win for the astrophotographer, but there is little to be gained by dithering only a few pixels. The type of dithering I refer to is a significant displacement between images of 10 - 15 pixels, to ensure that neighboring pixels are not co-located/adjacent to one another, which produces equally disastrous results.
Executed properly, dithering deals effectively with random noise, hides hot and cold pixels under normal pixels and similarly improves flat fielding and improves sub-pixel sampling; that is, capturing the image over a range of pixels means that we are not sampling the same and possibly less efficient pixels over and again. Calibration is not always as effective as we would like with DSLR images. And even if the images weren’t calibrated, as dithered stack would produce pretty good result.
Here is a comparison of the same area, dithered and not dithered.
Manual dither how-to
For low speed slew rates to ensure adequate pixel spacing. Hand controller set to high, or lowest high speed slew.
Starting with either RA button, move clockwise around the keypad, pressing the RA and DEC push buttons, for a second, between each image, in the following sequence;
Take first image “i”; then
R, “i” - move clockwise to DEC button
D “i” D “i” D “i” - you get the idea… move clockwise to RA button
R R R - move clockwise to DEC button
DDDDD - move clockwise to RA button. Keep moving clockwise
RRRRR
DDDDDDD
RRRRRRR
DDDDDDDDD
RRRRRRRRR …and so on… describing a box spiral.
The trick is to remember how many times you pressed the RA or DEC button, in a single line.
Alternatively, when using a higher speed slew, to keep the spiral tight, to keep the image within the frame.
R
D
RR
DD
RRR
DDD
RRRR
DDDD
RRRRR
DDDDD
RRRRRR
DDDDDD
Sunday, December 11, 2011
Canon 1000D/XS/Kiss F DSLR cooling modification - images and overview
Note: This blog is provided for interest only. I suggest using an old or second hand camera that is dispensable. I purchased a very cheap used camera with faulty firmware for parts back up - just in case.
Acknowledgements: This project would not be possible without the generous assistance of the Arduino forum members, a very helpful Jaycar employee (I bought the more substantial components from Jaycar) and encouragement from my fellow Ice In Space members.
Note: If you would like further details about this mod, please use the contact form.
Note: The Arduino shield used for this modification is a hacked motor shield designed for another project. While designing and etching a shield might be tidier way of doing things, other options such as a DIY shield will do - a bread board at a scrape. This is the next step in the project!!!
Why a cooling mod?
For those not familiar with the why’s and wherefore’s of astrophotography/image processing, specialised CCD cameras used for astrophotography (scientific purposes) are cooled, whereas, DSLR CMOS/CCD sensors are not. DSLR sensors get hot during extended operation, that is, in excess of 10 seconds as a rule. Thermal (dark) current, as it is called, is the heat signature of the sensor and a significant source of noise. Cooling the sensor reduces thermal current and noise in the image.
Reality check
This modification has limitations. For instance, if you live in a coastal area and humidity is high, cooling will be limited by dew point. If you live inland and the air is usually dry, then it is possible to cool to lower temperatures. When designing a cooling mod’, the extent of cooling is a consideration. For example, if the camera will not travel inland, condensation on the front face of the low pass filter will be a significant limitation. Without a means of dew control, cooling is restricted by dew point temperature. Condensation management of the low pass filter is a work in progress.
The Idea
Cooling DSLR cameras is not new - several modifications may be found on the web. Cold boxes and cold fingers use thermo electric cooling (TEC) or Peltier modules, as they are called. A design philosophy is that changes should be reversible, with the capacity to return the camera to its original condition - as much as possible. If you use a cold box, modification of the camera is not necessary. Cold fingers however, require special treatment and this is a cold finger mod.
Importantly, design should achieve, quick cooling, a flexible temperature range, accurate temperature control and low power consumption. Some cold finger and cooling box designs impose unnecessary cooling demands on the TEC. This design minimizes the mass to be cooled, and therefore energy demands, using pulse width modulation (PWM) to control and maintain temperature as accurately as possible - using an Arduino microprocessor board. The native 490hz PWM provided by the Arduino board is acceptable for driving the MOSFET gate.
A constant temperature is maintained by comparing ambient air temperature with cold finger temperature and scheduling pulse width modulation (PWM) to meet the energy requirements. To date, the system has run continuously for several hours at 7C without a hitch.
The Camera
Note: Upgrade to the latest firmware. This is particularly applicable to the 1000D/XS/KissF models. Check that firmware is better than 1.0.5. Preferably, the latest, at the time of writing, 1.0.7.
Canon 1000D/XS/Kiss F DSLR and variants. It is assumed that the camera has been optically modified by replacement of the manufacturers IR filter with an astronomical filter - Astrodon Inside filter (purchased from Hap Griffin), Hutech - or no filter at all, to increase the transmission of Hydrogen alpha wavelengths (the red colour in nebulas). See Gary Honis’ modification instructions/ There seems little point to the cooling mod’ otherwise.
The 1000D/XS/Kiss F, conveniently, provides a pathway for the cold finger, fitting between the back of the sensor and the flat insulated underside of the sensor electronics board, protruding between the back and rear body covers. The video, remote and USB receptacle cover can not be fitted with the cold finger in place.
Bending the cold finger accurately, to fit between the video/remote PCB and camera chassis, is probably the most difficult part of cold finger fabrication - 1.2mm copper plate is easy to bend, but work hardens - a butane torch might help - a heavy duty vice, some thick steel or aluminium plate and a mallet/hammer to form sharp bends is essential.
Note: The camera sensor assembly was stowed in an airtight bag with several dessicant packs (silica gel) after completing the filter modification. Sealing the sensor assembly with silicon was completed a few days later. As a result, and despite cooling below dew point, no moisture is evident between the layers of glass filters. All moisture appears on the face of the low pass filter which is exposed to the air (This can be viewed using the manual cleaning function, which flips the mirror up and opens the shutter to allow cleaning of the filter face. The sensor is not powered in this condition).
The Electronics
This was perhaps the most difficult part of the project, aside from writing the software, which improved with experience.
Electromagnetic interference has been a major design issue. Wiring associated with the cold finger, temperature sensor and the TEC should be shielded with braid. I pulled apart a length of ~5mm coaxial cable, removing the inner plastic coated wire and the outer insulation leaving the braid. Wires were threaded through the braid with tape at either end to prevent fraying. The braid must be connected to ground.
The Peltier (TEC) device is 12v 8a sealed with a QMax of 68.5C. Made in China. Tellurex apparently make a superior product and their FAQ is mandatory reading before tackling a similar project.
Temperature is controlled by switching the Peltier device through a Logic Level N-Channel MOSFET LowRds(on), using Pulse Width Modulation supplied by an Arduino micro processor board. The negative wire of the Peltier is connected to the Drain of the MOSFET. The Gate of the MOSFET is connected to the digital pin of the Arduino board, and the MOSFET Source is connected to GND. For any required temperature (max 30 below ambient) PWM is scheduled by comparing ambient temperature with that of the cold finger.
Rds(on) should be very low to avoid heating of the MOSFET. This one - NXP PSMN1R6-30PL is 0.0014ohms while have a very high power handling capacity. No heat sink required, but it has one anyway, just in case!
A 100R 1/4 watt series resistor is connected between the FET Gate and the Arduino digital pin for current limiting.
To ensure that the MOSFET Gate switches correctly a 750R pull down resistor is connected from the Gate to GND. 1K will probably suffice.
Power to the +ve side of the Peltier is supplied by a 12v 12.5a switched mode power supply, which is very noisy (EMI) and requires damping, as would be the case for any noisy supply. Perhaps a linear supply of a similar rating will do, but they are more expensive.
The temperature probes are TMP36 linear sensors and do not require calibration. Google ladyada for details. The sensors are located, one on the cold finger (finger temperature) close to the camera sensor and one on the PCB mounted on the Arduino board (ambient temperature) - 3.3aRef voltage is used - ladyada for details.
Arduino software calculates and schedules the required PWM signal to the MOSFET Gate, as a function of ambient temperature and desired Set Point temperature, which is set by push button.
There are 2 push buttons. Pressing both simultaneously resets the Set Point temperature ambient temperature (set point == ambient). Pressing Button 1 reduces set point temperature by 2C with each push. Pressing Button 2 reduces Set Point temperature by 1C.
When set point temperature is reduced to ambient -30C or more, by Button 2, Set Point temperature is automatically set to ambient -30. Further Button 2 pushes have no effect on temperature control. Pushing Button 1 however, will reset Set Point temperature to ambient - alternatively, press both buttons at any time to reset temperature scheduling, then start again.
One LED indicates the system on temperature, while another warns that temperature scheduling has been reset, that is, ambient temperature == Set Point temperature.
Interference lines may show up on live view during operation of the cooling system. To eliminate, a 22uf capacitor is required MOSFET Gate to GND, essentially across both sides of the 750R resistor, mentioned above. I tried many variations of snubbers etc and drew a blank. The camera chassis must also be connected to GND. I imagine that an electronics engineer would do a better job.
A PCB is a neater way of doing the electronics and this can be mounted on the side of the heat sink. Given that much experimenting was required with the prototype, I elected to use a two sided bus connector (I think that’s what it’s called). That way, I could move wires around and make alterations, as required.
Ground loops can be a problem where it is decided to separate the GND of the analog temperature sensors. That is, keeping analog and digital GND separate, to prevent feedback from digital GND to the analog circuit. In any case a common ground must eventually connect all GND’s. This is done at the Arduino board.
The Outcome
Maximum temperature differential is 34C (from ambient). A sensible and easily controlled temperature range is 30C. Cooling is rapid, but exponentially slower near maximum differential. At temperature, PWM (pulse width modulation) does a good job keeping the set point temperature, conservatively, within 1C, but it does a lot better and 0.5C is realistic.
Testing at 0C (ambient 20C on the day) showed good thermal inertia. Removing power from the Peltier, the cold finger temperature (measured near the camera CMOS sensor) remained within 0.96C for 13 seconds. This tends to indicate, that irrespective of transient spikes in temperature, plus or minus, thermal stability prevents immediate reaction to changes in PWM scheduling, which quickly recovers in response to normal temperature sensor readings.
System response can be further reduced by increasing capacitance across the MOSFET gate and source. But this also reduces the rate of cooling - this might be desirable in some cases.
Cool down time is quick. For example, from 25C to 0C in a matter of minutes. There is a slight overshoot, followed by undershoot, after which temperature remains within the tolerances mentioned previously and suspect that this is a consequence of capacitance in the cold finger temperature sensor circuit.
Note: Software needs refinement - my skills are fairly basic. Consequently, a second Arduino board to manage cooling separately, removed interference from other functions - shutter control, dithering robot and calibration frame semi-automation.
The materials for this project were many and varied. It is fiddly, particularly cold finger fabrication, insulation (electrical and thermal), condensation elimination from electronic parts, modifying the shutter remote cable, installing the temperature sensor on the cold finger and so on.
Summarizing, the prototype works well and there is room for improvement. Particularly, clearance between the camera and cold finger/Peltier interface, to fit remote cables, video and USB more readily. Perhaps, bending the cold finger toward the front if the camera is a better option. It’s all a matter of usability and access to lens controls.
Tuesday, November 29, 2011
Basic astrophotography image processing in GIMP - Part 2: increasing SNR (image alignment, integration and enhancement)
I thought this section deserved more attention. Leaving off in part 1, we discussed combining images - to use astrophotography jargon, stacking and aligning - more correctly, registration.
Please remember that these tutorials are intended for beginners, using very basic equipment and software. The methodology is the basics of image calibration and processing, but very much hands on, using what we have at our disposal.
Recapping, the purpose of combining images is to increase the signal to noise ratio (SNR); that is, less noise and more signal, improving the overall appearance of our combined final image - our integrated image (more jargon).
We are going to select the best light frames and combine them into a single image. But, noise reduction strategies start before uploading images to our computer. We employ a nifty method during image capture; that is, we make sure that our images are slightly offset one from the other during the imaging session (yet more jargon). The technical term for this is dithering, a science and a separate discussion altogether.
For our purposes however, we will take advantage of our fixed set up. We note that the stars move across the sky and change position from East to West at 15.0416 degrees/hour (the siderial rate), we let the stars drift across the camera sensor between exposures. Of course, after a while the object that we are imaging will drift out of view. For 6 or 10 images there should be no need to recenter our target.
In part 1 we exposed for 10 seconds. Adding a 3 second delay between exposures ensures that a few pixels separate the next image from the previous - in effect offsetting our images. Very crude dithering - effective all the same. And, furthermore, once complete, our total exposure time is 60 seconds vs 10 seconds. However, SNR increases by the square root of the number of combined images. 2 images increases SNR by 1.414 - approximating for our purposes.
So, starting where we left off in part 1, the image below shows the second and third images in our set of calibrated light images - we have already aligned the bottom and second image in the stack. In this case, the third image is selected with Mode set to Difference (and View 8:1, for clarity). This layer is transparent, showing the difference between the two images as they came out of the camera. We can use the drag tool to align the transparent (difference layer) with the image below.
And this is the result in Difference mode. The pixels have been aligned.
We then set Mode to Normal and select the image above, by selecting its ‘eye’ and highlighting the layer, setting its Mode to Difference. As before we drag the image into alignment with the image below, and so on up the stack.
Note: We loaded our images, File > Open as Layers, and need to deselect the ‘eyes’ of the images above the image that we are dragging so that it is visible.
The image below is the first of our image stack (the ‘eyes’ above it are deselected to make it visible). It’s noisy.

Lets see what happens when we average the images; that is, with Mode set to Normal for all images, (all ‘eyes’ selected), we set the Opacity slider of the bottom image to 100% - the default setting. Select the second image and set it to 50%, third to 25%, 4th to 12.5%, 5th to 6.3% and our 6th image to 3.1%.
As you proceed up the layers, note the change - dithering has been to good effect and pixels that were not removed during calibration are hidden behind good pixels. Additionally, because ambient noise is random the image is becoming less noisy. If we had 50 or 100 images, noise would be reduced even further. Still, for 6 images the result is impressive - as below - and much smoother.

Just to finish things off, Image > Flatten, to fuse all the layers together. Apply a sharpen algorithm to the luminous layer. This can be found at, FX-Foundry > Photo > Sharpen > Luminosity Sharpen. You can also use, Filters > Enhance > Sharpen (Smart Redux), or any of the available sharpen algorithms available for GIMP. Avoid the use of unsharp mask if you can. It too, tends to overdo the image (my personal view).

And here is our completed image.

For comparison, the image below is the final image from part 1, which is a single layer, as opposed to 6 layers in the image above.
Comparing the position of the constellation Orion on the frames shown, it should be evident that any one of our light images may be selected as the base or background image, framing the scene as preferred. Terrestrial objects do not align in any case, and we have to live with that.

The availability of free programs to perform calibration, registration and integration, and then using GIMP to finish off with brightness, contrast, colour and enhancement, makes the process much easier. (Keep in mind that images that contain terrestrial objects may interfere with alignment in some programs, essentially designed to align stars).
The next step perhaps, is to use RegiStax or Deep Sky Stacker (DSS) to do all the heavy lifting (calibration, registration and integration of our images) and follow up with GIMP. Now we are getting into serious amateur stuff. But, we can still use our fixed tripod/camera set up, to take beautiful shots of the Milky Way, well beyond the spectrum of the human eye.
Perhaps you need one of these.