Dslr Tutorial

Dominik Gronkiewicz

Digital SLRs are great tools for observing the sun, mainly because of vast field of view they provide even used in telescopes with long focal length. In most cases, entire solar disk, which is about half degree in diameter, can be fit in the field of view. yet providing decent resolution for analysing details. DSLRs are a natural choice for full-disk observations, either in white light or in spectral lines (such as Ha or Ca-II).

Such images are of great value for us astronomers, since they provide us a preview on current situation on the Sun. Despite slightly worse image quality, full-disk image sequences may be our only information about phenomena that ocurred in places that were not observed at that time by any of large yet narrow-fielded telescopes in solar observatories.

NOTE. You probably want to read read our general guidelines for solar photography.


0. Make sure your camera battery is charged and memory card is empty. Synchronize your DSLR clock with a reference clock.

1. Set up your telescope. If your observatory is mobile, align your equatorial mount as good as possible. You may use a compass, but remember to take magnetic declination into account.

2. Prepare your telescope. Put an objective filter and UV/IR cut filter, if you use one

Telescope Filter

3. Point your telescope at the Sun and install the camera.

DSLR attached to a telescope via mounting ring

4. Move the solar disk to the center of camera's field of view. Adjust the sharpness and lock it. If you use tension-tuned H-alpha filter (etalon based, for example Coronado PST), adjust it for minimum brightness of the solar disk (Ha line center).

Finding the Ha line center on the image

5. Set your camera mode to RAW mode. The shutter speed should be below 1/100 second (to reduce atmospheric influence), while ISO should be kept relatively low (400 or less). There's much chance that you will have to turn down all exposure parameters to get an unsaturated image.

Adjustment of exposure tme using a histogram

6. If everything is double-checked and ready to run, just set your remote to sequence of photos in the intervals of about 10-20 seconds. Try to capture as long sequence as possible (up to a few hours). Don't change exposure parameters once you start taking photos.

7. Depending on how well you aligned the mount, you'll probably need to correct the telescope pointing every few minutes. Guiding Sun in the centre of the view is important in all telescopes to keep abberations low. However, it has a crucial importance in H-alpha telescopes, where the „sweet spot” of good filter transmission barely covers entire solar disk.

NOTE. After you finish imaging, don't remove or rotate the camera! We still have some work to do until we may consider our data scientific. To be precise, we must take so-called calibration frames. We describe calibration frames in introduction to photography section.

8. After you finish the imaging session, point your scope away from the Sun and cover up the tube. Without changing the ISO speed, set the exposure time to shortest possible value (for example, 1/4000 sec in my Nikon D90) and take about 15 pictures in the intervals of about 2 seconds. The images, apparently black, in fact contain some nonzero values, added by electronics to avoid negative pixel values (called bias) combined with random camera noises (called readout noises). In other words, we need these pictures to calibrate the zero point of your solar images. Professionals call them bias frames or offset frames.

Acquisition of a dark frame

NOTE. Further instruction apply only to telescopes with a removable front objective filter. The owners of integrated H-alpha telescopes must skip this step.

9. Before you disassemble your telescope and enjoy a cup of coffee after successful observations, there's one last step we need to do. Point the telescope at the zenith. Un-cover the telescope tube (I'm assuming that the front solar filter is already removed) and take a photograph of clear blue sky.

Acquisition of a flat field

The first picture is probably going to be very dark. Adjust the shutter speed so that the frame isn't neither too dark nor oversaturated (you can easily check it by looking at histogram – should be in the middle of the scale). Remember: changing ISO speed is not allowed!

Adjustment of FLAT FIELD exposure time using camera histogram

Once you're done, do a sequence of 15 images. We need such pictues of a uniformly illuminated surface (sky) to map all imperfections of your telescope's optics as well as dusts on the camera's sensor. Such a frame is called a flat field. I've shown you an example frame below. Notice all the dust on the sensor!

An example flat field taken with 100/1000 achromatic refracotr and Nikon D90 camera


NOTE. We're going to use free IRIS software (http://www.astrosurf.com/buil/us/iris/iris.htm) to process images. For more solar image processing tips read the article Sun processing.

NOTE. If you're an advanced observer and prefer any other software than IRIS, then feel free to use it. However, reading this tutorial is higly advised to get the point of the processing we need.

Iris is very powerful and gives you full control over the way the processing is done (which is a good thing), however, it's not the most user-friendly astronomical tool (though still more friendly than most professional scientific software).

What we're going to do in this tutorial is:

  1. Import your DSLR RAW files into IRIS

  2. Prepare an offset frame

  3. Prepare a master flat field

  4. Substract the offset from pictures of the Sun

  5. Divide the pictures by the flat field

  6. Convert color filter array into 3 channel RGB picture

  7. Extract desired color channel (red for Ha, green for white light, blue for Ca-K)

  8. Align images

  9. Crop images to reduce the size

  10. Have fun with some cool effects!

Step 0. Prepare IRIS for work

Before we start any work, we must tidy our workplace. Create a directory on your disk for this imaging session. (I usually call directories simply with a date, for example: 2014.11.04) Import RAW files from your camera, and sort them nicely into three (or more) directories:

- sun containing your pictures of the Sun

- flat containing the flatfields

- offset containing offset frames.

Windows doesn't read RAW files by default. However, Microsoft has released Microsoft Camera Codec Pack, which magically enables you to view RAW pictures in default Windows photo browser

After you sort the frames, browse through each picture set and remove bad images. If some of the solar pictures are obscured by clouds or solar disk partially drifted off the field of view, remove them. If one of the flat fields contains a cloud or a bird or an airplane – remove it. If one of the offsets look different from others – remove it. Bad data will ruin all the efforts. This step is essential for further processing to be successful.

The phillosophy of using IRIS is simple: everything is done in one directory. Iris will convert your files to FITS format and place them into that directory. Then, each processing step will generate a set of many FITS files. You probably want to isolate the mess produced by IRIS in a separate folder. Make an empty folder called work for this purpose, next to the three folders with your photos.

IRIS settings window

Now, you should let IRIS know where its playground is. Run the program and press keys Ctrl+R. Copy the full path to your WORK directory (in my case, it was: d:\Astro\2014.11.04\work\) and paste it into the Working path field. You might also click the button with three dots and select your work folder by hand. Either way, before clicking OK, make sure that File type is set to FIT. FITS (or FIT, FTS) is a file format commonly used by astronomers. To display FITS files in Windows, one handy tool is FITS Liberator (http://www.spacetelescope.org/projects/fits_liberator/).

Now, IRIS is prepared to be fed with RAW files from your camera.

Step 1. Import files into IRIS

NOTE. Make sure you updated libdcraw.dll file to the latest version. It contains algorithms for reading RAW files of the latest DSLR cameras. Otherwise you may enounter problems during this step.

IRIS, despite being great software, does not detect the camera type automatically. We need a short while of configuration. In the main window, click the „Camera” button on the main bar.

Button to open the

Camera Settings window is going to be displayed. Among many settings, the most important ones are circled in the picture below. With the exception of the camera model (pick yours from the list), the configuration should look like this:

IRIS: Camera Settings window

Don't worry – once you set it, IRIS will remember the settings until you reinstall the software.

NOTE. In case you can't find your camera on the list, don't panic. Some newer camera models share RAW file formats with older ones. Check the official website of IRIS. Christian, the main author, regularly updates the tips for users of recent DSLRs. It's higly unlikely that IRIS will not read the RAW format of your camera.

Click „OK” to accept changes. Go to „Digital photo” menu and pick „Decode RAW files” entry.

IRIS: Digital Photo menu -- a very important menu in the program

This window is everything you need to convert RAW format into FITS files. First, I'm going to convert the pictures containing solar disk (let's call them proudly science images). Simply drag&drop them from Windows Explorer. They should appear on the list. Now, type a generic name into Name box. In the example below, the converted files will be given names: sun1.fit, sun2.fit, sun3.fit and so on. When you're ready, click CFA button, and wait a few seconds until IRIS completes the work.

IRIS: Image Conversion window

Easy, isn't it? Now click Erase list to clean up the list, and do the same with offsets (change the name to offset) and flat fields (yeah, you guessed – name them flat). After you're finished, the work directory should contain images of the Sun (sun1.fit, sun2.fit, sun3.fit, …), offset frames (offset1.fit, offset2.fit, offset3.fit, …) as well as flat fields (flat1.fit, flat2.fit, flat3.fit, …). If something is missing, I recommend to delete all files and start the conversion from beginning. It's better to take that extra time than mix up offsets with flat fields or science images.

If you're here, I would like to say that the most boring part is over. We have finished all technical stuff. Now we can play with pure science!

Step 2. Make a master offset

We want to combine our offset frames into one to have all random noises removed. After all, we don't want to introduce extra noise to our pretty pictures of the Sun. Go to Digital photo menu and pick the Make an offset tool. A small window appears that asks for only two inputs. The first is generic name of offset files (we called them offset, unless you were seeking for adventure and called them differently). The second – number of offset frames.

IRIS: Make an offset -- used to prepare a median offset frame

Click OK and watch as IRIS combines the frames into one. Click the Save button and name the file master-offset.fit.

IRIS: Save button

IRIS: Save dialog

This is how my master-offset.fit looked like. It's pretty much uniform random noise. Good news is that unless you change the ISO settings between the sessions, you can use this file for future shots with this camera.

An example offset frame from NIKON D90 camera

Step 3. Make a master flat

NOTE. If you haven't taken a flat field, go straight to Step 4.

Creating a master flat is not much more complicated than creating a master offset. In Digital photo menu choose the Make a flat field option.

IRIS: Create a flat field window -- makes the median flat field with offset substracted

Similarly, the first required parameter is the generic name of the flat field sequence (I think we named them flat). Next, enter the name of freshly-created master offset. Leave the default normalization value (5000). As in previous case, the last parameter is the number of frames to process. Click OK. After IRIS does all required stuff, you may save the result. Sticking to our convection, let's name this file master-flat.fit.

NOTE. More advanced users may want to execute the GREY_FLAT command before saving.

IRIS: Save dialog

Here's a flatfield taken with my TAL 100 RS achromatic refrator and Nikon D90. What an awful dirt and vignetting we have here! This should help you realize the importance of all this preprocessing we're doing here. In case scientists needed your data, such irregularities could ruin all the analysis if it was not corrected using the flatfield.

An example flat field from 100/1000 refractor and NIKON D90 camera

Step 4. Substract the bias

We have prepared the calibration frames. Now let's use them to correct instrumental defects on our pictures.

In the Digital photo menu, click Remove offset. Let me make it clear what we are about to do: we want to substract the offset image (master-offset) from each photograph of the solar disk (sun1.fit, sun2.fit, ...). As a result, we're going to obtain a new sequence of cleared images (aa1.fit, aa2.fit, …). This is exactly represented by the input fields: first, the name of the input sequence (of Sun images), name of the file we're going to substract from each frame, and name of the result sequence. Last number is, as always, number of frames to process (in this case, number of Sun images).

IRIS: Remove offset window -- removes the offset from a sequence of images

As you click OK, you can watch files aa1.fit, aa2.fit, … appearing one by one in the work directory. You can open one of them in Fits Liberator. There's little chance that you can see any difference compared to the original photo. You have to trust me that these photos are bias-free.

Step 5. Divide by the flat-field

NOTE. If you haven't taken a flat field, go to Step 6. However, keep in mind that the input name for RGB conversion will be the result of Step 4, that is, aa.

You have probably already learned where to search for a proper command. Of course, the option Divide by a flat field can be found in the Digital photo menu. But wait, why do we want to divide by a flat field, if earlier we substracted the offset? Well, I'm afraid that this is not the best place to get into such detail, as there are tons of dedicated articles on the Internet. For now, what we must know is that division is the operation we have to perform.

IRIS: Divide by a flat field window: applies the flat fields to a sequence of images

This window is very similar to the one from Step 4. We must specify the name of input sequence (which is the output of previous step, in our example: aa), name of the master flat field, name of the output sequence (let's unambitiously call it bb) and number of images to process. After you hit OK, a sequence of frames named bb1.fit, bb2.fit, … will be produced, containing images of the solar disk corrected for all instrumental effects. Congratulations!

Step 6. Add some colour

How are digital cameras able to see colours? CCD as well as CMOS detectors are color-blind (monochrome). To register colours, one must take the picture using several filters (usually red, green and blue) and combine them into one image. To avoid taking three images in a row, each for one colour, filters of all colours are assigned to different pixels and distributed uniformly in the field of view (CFA – color filter array). Such a picture is then decoded to colours by camera software (unless you use RAW mode).

If you load one of the images and zoom very close, you can notice that the surface has a very characteristic pattern of brighter and darker pixels (see picture). This pattern is called a Bayer matrix and it's commonly used in digital cameras to arrange red, green and blue pixels. To decode the Bayer matrix and see the Sun in colours, use Sequence CFA conversion option.

IRIS: Conversion of CFA image to tricolor RGB

Input name is, as always, the name of the output of the last command (bb if you used flat fields and aa if you didn't). I will name the output files as rgb, to emphasize that these are color images. Make sure that Color switch is selected!

Click OK and watch as the Sun gets its colour... There's much chance that colour balance will be far off and solar disk appears unnatural. Don't worry – we're not going to use the colours anyway.

Step 7. Gray is better

Yeah, the Sun in colors may look cool, but scientist mostly use monochrome (greyscale) images in their work, because proper interpretation requires knowledge about the spectral range that is visible on the image. If you want to be a scientist, you need your Sun to be monochrome too. Let's extract only one colour channel for further analysis and reject the other two.

Which channel is the best one? That strongly depends on your telescope setup. If you process white-light pictures (using neutral density film), you want only green channel. Users of H-alpha telescopes will use red channel, while blue channel will be desired for Ca-K telescopes.

IRIS: Separation of color image into 3 monchrome images

Channel extraction is performed by Sequence RGB separation command from Digital photo menu. The input for this command are your color images (rgb in our example). As a result, three sets of images are produced, containing red, green and blue channels for each input picture. Three following fields in Sequence RGB separation window are generic names for these images. Pick one channel (depending on your telescope, as described above) and name it mono. Enter some names for two other channels (I named them r and b, but names are not important – we're not going to use them anymore). The last field is, as always, the number of Sun images.

Step 8. Hold still

At that point, your data is already prepared for scientific use. You could pick the sequence of mono files and send them to F-Chroma data center. However, fits files are somewhat largish, while your pictures probably containt a large area of black background pixels (open one of the mono files in FITS Liberator and check it yourself!). The purpose two next steps is to trim all that unnecessary space and reduce the file size by a factor of 5!

Uncropped image of the Sun

Because of imperfections in telescope guiding, there is 99% chance that solar disk drifted slightly between the frames. To crop our sequence as tightly as possible, we must stabilize the image, so that Sun remains in the same position in every frame. IRIS is able to do that operation automatically.

First, we must let IRIS know how to detect the Sun on the picture. Open mono1.fit file and select a small area around the solar limb (see picture). Right-click and open Statistics window. Remember roughly the median value of signal (see circle in the picture).

Reading the pixel statistics from the solar limb

Close the Statistics window. Go to Processing menu and select Planetary registration 2 command.

IRIS: Planetary registration 2 algorithm allows to align solar images

Input sequence is of course the product of point 7, which we called mono. Level should be roughly 1/3 of the median value you just read from the solar limb (this is about 300 in my example). The output sequence will be named align. Click OK and watch the cool visual effect as IRIS aligns the images!

After IRIS is done, open a few random align frames in FITS Liberator. The Sun should be in the same position on every frame.

If IRIS seems to lose the track, adjust Level to higher or lower value until Sun remains perfectly stationary between the frames. Another possible reason is offset not having been substracted. You can check that easily by measuring the median level of the background. That should be relatively low compared to the brightness of the solar disk. The last possibility is that some frames are empty, the Sun is partially out of view or clouds obscured by clouds. You should have removed these frames in Step 0.

Step 9. Make it fit

Whew, we're almost there. Now, let's finally trim all that unnecessary black area on our images. However, cropping tool in IRIS is rather harsh in use and requires you to manually enter coordinates of the crop rectangle. Moreover, there's no graphical window for this tool, and you have to manually call the WINDOW4 procedure from IRIS command prompt. To open command prompt, click the button on top bar:

IRIS: Command Line

First, let's measure the position (X, Y coordinates) and size (radius) of solar disk. Open the align1.fit picture and execute CIRCLE2 command, threshold being equal to signal level you used in previous step.

>CIRCLE2 [threshold]

IRIS will expect you to click two points, being corners of the rectangle containing the disk of the celestial body. This is useful in analysis of pictures containing more than one object (for example, a planet and its moons). Because the only body in our pictures is the Sun, just select the entire picture by clicking in the very bottom-left and top-right corners.

IRIS: Calculation of coordinates of solar disk

IRIS will fit a circle to the solar limb and draw it with a dotted line. Check if the circle looks okay. It should precisely follow the limb of the Sun! If not, adjust the threshold value to obtain the best fit.

In the Output window, program prints the coordiates (yellow circle) and radius (blue circle) of the Sun. Being given the radius, I can estimate the final image size multiplying it by 2.2 (that guarantees 10% of margins on each side). In my case, radius=850 pixels, therefore my final images should be cropped to size 2.2x850=1870 pixels.

NOTE. Users of H-alpha telescopes may want slightly larger margins (2.5xR or more) due to possible prominences.

To crop a sequence of images, we're going to use two commands: MOUSE_SELECT to specify the center of the image and WINDOW4 to do the proper crop. First, let's have a look at MOUSE_SELECT. It expects you to enter the coordinates of corners of selection rectangle: (x1,y1) and (x2,y2).

>mouse_select [x1] [y1] [x2] [y2]

However, we want to select only one, central pixel of the Sun. Simply type the coordinates obtained by CIRCLE2 procedure twice (round them up to integer values). See the yellow rectangles in the picture below.

IRIS: Selecting the central pixel of the Sun

Having selected the center, we can make IRIS crop the images. Syntax of the WINDOW4 command is as follows. If you forget the syntax of any command in IRIS, just type its name without parameters, and IRIS will display help.

>window4 [in] [out] [size] [number]

First, you have to specify input sequence name (align) and output sequence name (I call that final sequence disk). Next, specify the diameter of the image (=2.2x radius, we calculated that above). The last parameter is the number of images to process.

Here is the un-cropped and cropped image. As you can see, we saved lots of diskspace with this operation:

Comparison of cropped and uncropped image

A sequence of images called: disk1.fit, disk2.fit, … is the final product of your processing. Browse them all carefully and delete any bad images that you come across. Compress the sequence into zip or tgz archive and submit them to F-Chroma data center. You can delete all other images from work directory – we don't need them anymore. (Two exceptions are master-offset.fit and master-flat.fit, which you can use for the next session.)

Step 10. Give it a cool look!

NOTE. This is an extra part of this tutorial to show you some nice tricks that you can use to give your images a nice touch. However, remember that this has only aesthetic value and cannot be applied to scientific images.

In this part I'll show you how to eliminate limb darkening in white-light images and give them a cool, SDO-like appearance. Removal of limb darkening makes it possible to boost the contrast and make subtle details of the photosphere visible. The trick is to divide the image by an artificial solar disk computed by IRIS.

First, open disk1.fit. You can do it traditionally through the dialog box, or use a LOAD command:

>LOAD disk1

Once again, we must use the CIRCLE2 command to precisely localize the Sun. Required steps are identical as in Step 9: execute the command, click the corners and check if obtained circle precisely matches the limb.

Now, let's generate an artificial Sun. The syntax of the command is following:

>SYNTHE_SUN [x-center] [y-center] [radius] [lambda (nm)] [intensity]

First three parameters, disk center coordinates and radius, are the results of CIRCLE2 command (orange ellipse above). Lambda is the wavelength for which the limb darkening model is computed. Values around 450-600nm should work best with most digital cameras (I use 530nm for my Nikon D90). The last parameter may be set to 1000 or 2000.

IRIS: Generation of synthetic sun

An empty, synthetic solar disk should appear. Save it with name synthe. You can use the Save dialog box or simply type:

>SAVE synthe

Generated synthetic solar disk

Now, let's apply this effect to our images! But first, normalize images to compensate brightness variations. Load the disk1.fit picture once again and compute its statistics:

>LOAD disk1

Statistics of an image

Now, go to Processing and select Gain normalization of a sequence command. Pick a new name for normalized sequence (I choose disk_norm) and enter median value into the Normalization value field.

IRIS: Normalization of sequence of images

Now, we're going to divide the real Sun by our smooth synthetic Sun. As a result, we're going to get all subtle details. The division is performed by Divide a sequence command from Processing menu. Image to divide is of course our artificial Sun (synthe), while Multiplicative coefficient may be set to 1000 or 2000.

IRIS: Division of a sequence

Below I compare a regular image and image compensated for limb darkening. Notice how prominent solar faculae as well as granulation have become.

Comparison of solar fisk before and after compensation of limb darkening