Image Processing

Part I - Homework & Image Capture

This is the first in a series of practical explanations showing how I go about capturing and processing my images. There are about as many different ways of doing these things as there are astroimagers, and the guys who really know what they are doing have truly superior routines and skill sets. Still, these methods have worked well for me and may give you some food for thought, especially if you are just getting started (note that I have shamelessly borrowed techniques that work for me from those master imagers who have graciously shared their insights in magazine articles or online). Please drop me an email at jkmorse57@gmail.com if you have any follow-on questions (and never feel shy about asking even the most basic question, that’s how we all learn) or if you have had success with different ways of doing things. I am always ready to learn new and better methods.

  1. Homework

    1. Prepare library of Dark and Bias calibration Masters
      1. Minimum 16 exps for each Master frame (I use 100+)
      2. Bias Masters for each temp (I shoot 400+ subframes)
    2. Two options for Dark Masters
      1. Long (30+ min) frames for each temp. (for Dark scaling)
      2. Frames matching light frame times for each temp. (I use both methods)
    3. Capture Option 1:
      1. Binned 2x2 for RGB (assuming you bin your RGBs)
      2. Binned 1x1 for Lum, Ha, SII, and OIII
    4. Capture Option 2 (my method)
      1. Binned 1x1 RGB and/or Ha, OIII, and SII
      2. Under this method, I do not shoot lums at all, but instead create a synthetic lum as a part of my image processing from the RGB frames/
    5. Select Imaging Targets using CCD Navigator 3, AstroPlanner 2, or your own favorite planning tools

Notes: Obviously, much of this applies to cooled CCDs only. If you are imaging with a DSLR or a non-cooled CCD, your only real choice is to take your Darks in the field so you match the temp of your lights. However you take your darks, it is absolutely critical that you match the temperature of your darks to the temperature of your light frames. If you don't, subtracting darks is worse than useless; it will seriously degrade your images. If you examine my “Learnings” page, you will see the results of skimping on getting the Darks right (and on not knowing how to do Flats, which is a necessary skill, especially for slower scopes (e.g., f/8) that we’ll discuss in more detail below).


This is initially a time consuming activity but what else do you have to do on cloudy or moon-filled nights? Besides, the Bias sets take no time at all (zero time exposures) and the Dark frames can be left on their own for hours on end (I set it up and let them run while I am sleeping). One thing to consider for cooled CCDs is how to mimic indoors the colder temps you may be experiencing under the stars, expecially in the winter months. My solution is to put the CCD in the frig (just do it carefully; if you read my “Stupid Things to do While Imaging” page, it was while setting up a refrigerator run that I succeeded in dropping both my CCD and my computer on the floor). If you are using a quality CCD your Dark and Bias library will be good for 6 months or more but be sure to check regularly and reshoot if you notice any thing strange in your processed images, such as banding. Any of the better processing programs makes creating Masters a breeze. I happen to use The SkyX Camera Add-on for image capture and PixInsight to make the Masters, but really it’s just a matter of finding a workflow that suits you at a price you can afford (Nebulosity is a great piece of "starter" software in this regard).

As stated above, I mostly use Option ii in creating my Master Darks. I understand the theory of Dark scaling and it works, but I like the extra control of matching my Dark exposure times to my actual light frame times in most instances. I also now only use Option 2 for my image capture. I have fully bought into the theory I discuss elsewhere that shooting 1x1 RGBs and then creating a synthetic luminance frame from them is the superior way to image.

A few thoughts on how I manage my files. Before I start imaging for the night, I set up my file folders. All of my image files are in the same master “Images” file on my system. The next level is that I have separate sub-files for each CCD-OTA combination. I then have a separate file for every night of imaging. Within those dated files, I include a separate file for each target and a separate file for all of the flats I take that night. I keep all of my raw images for a particular target in that target’s file folder (e.g., all luminosity, red, green, and blue lights for a particular target are lumped in the same file (by “lights” I simply mean the images that capture a target and its associated star field, unlike the flats and darks that are for calibration only). Similarly, all my flats for that target go into one file folder.

If you decide to do the same, one convenient thing to consider is labeling each set of images of the same class by a unique code. For example, all of my red images of a target have the code “Rd” at the end, green has “Gr”, etc. (Camera Add-on and some other image capture software automate this process, making it even easier). When I do my flat fields, I use a similar system, labeling red flats with a “Rff” code. (Note I did not put in “Rdff” since I want to be able to easily separate each series and any duplicate letters (such as the embedded “Rd” will confuse the red flats with the red lights, thereby defeating the purpose of this little exercise). Now, when I want to open all the red images in a series, instead of having to pick through the whole mess of files, I type *Rd* in the file identifier box (it works a little different in Linux but the concept is the same) and hit enter. The system now shows me just my red files. Then it’s a simple matter of holding down the shift key and highlighting the whole list and hitting open. Most people probably already know this stuff, but I find these kinds of shortcuts fascinating.

I recommend both CCD Navigator 3 and AstroPlanner 2 for planning imaging sessions. Either one will do the job on their own but they offer different tools for getting to the same place and I find the combination of the two best suited to how my mind works (AstroPlanner is more database focused and CCD Navigator is more image driven).

Another thing to keep in mind that applies both to your homework and your image capture is the type of file you save your images as. Whether you are using a DSLR or a CCD camera, you will want to save your images in the FITS file format, initially in 16 bits when capturing and using 32 bit floating point for all processing. The key is to preserve every bit of data for the later processing steps. Once you start combining images, even images taken with a 12 bit DSLR can quickly exceed 16 bits of data. That is certainly true if you are using a 16 bit CCD (of course its more complicated, everything is. Even with a 16 bit CCD you only get the full effect of a 16 bit image (namely 65535 different grey shades) if your CCD's full well capacity exceeds 65535. For example my SBIG STXL 6303 has a full well capacity of 100,000 -e whereas my SBIG STT8300's full well capacity is only 25,000. Hard to get 65535 different shades when the CCD's pixels saturate at 25,000 counts. Still, the 8300 is a great chip, you just need to understand what you are working with).

2. Image Capture

    1. System Set-up
      1. Polar Alignment
      2. Focusing
      3. Autoguiding
    2. Learn to take Flats!!!
      1. New Flats every time you change the image train
      2. Expose until you are in the 18,000 to 24,000 count range
      3. Separate Flats for each filter and binning mode

Notes: Your first task is getting the system set up properly for the night's imaging. The first critical undertaking is getting your scope polar aligned. Failure to get this right means your images will suffer field rotation around the edges. I discuss the problem in more detail and provide some examples in my Learnings page. You need to find a system that works for you. Drift alignment and other mechanical methods are full proof, if time consuming. I have gone the software route, using the Polar Alignment tool in the SkyX T-Point module which, with my Paramount MX, really shines. I get the scope aligned by eyeball when I get to the site (at HAS the pads are all aligned north/south). When I can start to see stars (but well before full darkness) I get the scope syncronized and then run an automated T-Point calibration run. I can complete a 100 target run in just over 30 minutes and then am all set to use both the Accurate Polar Alignment routine and, later, ProTrack to assist my autoguiding. Note the Paramounts have a superb adjustment mechanism in both altitude and azimuth). It is a wonderful, timesaving, setup.

Focusing is the second critical setup function. You can do it manually, but even then be sure to use some helpful tools. The best is a program that will give you a full width half maximium (FWHM) reading which you seek to minimize (again,the Camer Add-on offers a handy way to access this). When you get it as low as you can, you are at best focus. The other way if you have an electronic focuser setup is to let the software do it for you. A great program is FocusMax that works with many systems under the ASCOM routine. Other systems, like my CDK12.5, have their own routines (in the case of Planewave, their PWI3 program, which also controls the OTA fans and dew heater system). Previously I did my focusing manually, but now use PWI3 with the CDK. Whatever tool you use, you want your focus as crisp as possible. My Learnings page shows what you get if you don't do this right.

The other setup item I recommend using is to dither your exposures. A program like MaximDL makes dithering a breeze and you will appreciate having done so when you see how adding dithering helps eliminate hot pixels when you are stacking your images. And, if your images are undersampled, dithering allows you to access drizzle routines that are almost magical in how they imaprove an undersampled image.

Though I started out trying to capture up to 6 targets a night (a typical beginner’s mistake), you simply cannot do justice to more than one or two images a night. I currently shoot one image over two nights. The gains in SNR are more than worth it. And besides, I am not giving up the hobby any time soon so what's the rush.

Let’s spend some quality time talking about Flats (now would be a great time to slip over to the frig for a favorite libation; don’t worry, I’ll still be here when you get back). Again, on my “Learnings” page I show what happens if you do not use them. Flats cure two important flaws, vignetting at the edges of the image (actually a rather minor annoyance that can be remedied in other ways) and dust donuts marring the frame (a major headache that can ruin a set of otherwise excellent images). You can live without them, though using that logic, you can live without Dark frames as well. But if you are serious about getting everything you can out of your images, you really need to master this skill (and really, it’s not all that painful).

There are a lot of articles that deal with Flats but they did more to confuse me than to explain how to take Flats competently. More than likely my fault, but they often got lost in the science and not the process. They also tend to focus on the mysteries of Sky Flats. I am certain there are those who have mastered the technique and love Sky Flats, but they really require a level of art that is beyond me. I use the mechanical solution instead. I started by building my own contraption, using opaque “milk carton” plastic and a shielded hanging work lamp. I then built a Flat box using the design shown in the fabulous book by Richard Berry and James Burnell called the Handbook of Astronomical Image Processing. (As an aside, if you really want to understand the theory and physics behind astronomical imaging, this is the book to get and study. I am currently rereading it for about the fourth time. And, as an added bonus, you get a very nice processing program, AIPN4WIN, free. It’s a combination you should not pass up. You can find it on the Willmann-Bell website).

My home made contraptions worked after a fashion, but life got immeasurably easier when I stepped up to the Flat Man and Flat Man XL from Altinak. These are wonderful products that make Flats a breeze. With the smaller version I found an outdoor drain pipe at Lowes that just fit over my NP101is. I cut off the drain end, sanded it smooth, and taped the Flat Man onto the drain with a strip of Gorilla Tape. You can see a picture of the end product here. When it comes to my CDK 12.5 however, I needed to graduate to the Flat Man XL, which is 18 inches square. Notwithstanding the size difference, both operate the same way.

Altinak provides a very nice little program that quickly recognizes what Flat Man you have attached (a simple USB port for both, though the Flat Man XL also requires a separate power source). You simply punch “connect”, then “turn on” and you are ready. The best part is that the program allows you to regulate the brightness of the panels. Since graduating to the Flat Man, my Flats routine is as follows:

  1. After completing an image run, I hook up and turn on the Flat Man. If I have to rotate or refocus the CCD for my next image sequence, I take the Flats after each sequence. Otherwise, if I do not make any changes to the image train (CCD rotation or changing focus), I save my Flats until daylight makes capturing any more light images impossible (I hate wasting a minute of dark).
  2. I always do one filter at a time when taking Flats even though the Camera Add-0n lets me capture multiple sequences at once. Paranoid, I know, but it maximizes my control and minimizes having to redo a sequence after the fact.
  3. I like taking 3 second Flats. While this is hardly a hard and fast rule, it makes my life easier since I it allowed me to build my FlatDark library with 3 second Darks and it eliminates having to remember which filter used which exposure time when I go to put everything together (subtracting my master DarkFlat from the Flat exposures when building my master Flat). Note that the one place this does not work is with narrowband filters. Even with the Flat Man set at its highest setting, I still need 30 seconds or more to reach the desired range.
  4. I first take a sample (throw-away) image and test the photon count. Looking at a histogram or information window (Camera Add-on provides both which suits my needs perfectly), I am trying to get a count averaging between 18,000 and 24,000 counts. You could go higher or lower since you do not saturate the pixels until you get to over 65,000 counts, but you want to stay well below that due to linearity differences in CCDs (particularly ones with anti-blooming gates). This range gets you comfortably off the floor yet the count is low enough to keep within your CCD’s linear range (if you want to be more precise, there are routines to test your CCDs linearity range, but I have found my method to work perfectly fine).
  5. How, you may be asking, am I able to both lock in 3 sec Flats and yet get all of my filtered images to fall within the desired count range. That is where the Flat Man really shines. The control program allows you to adjust the panel brightness from as low as 1 to as high as 255. Except for narrowband Ha, OIII and SII filters, I never need to go any higher than around 100. As mentioned below, however, with narrowband filters, I need to set it all the way to 255 and then still need 10-20 second exposures to get in the range.
  6. Once I have found the right settings, I then take a series of 25 Flats for the filter in question to build my master Flat for that set of light frames. I repeat this process for each of the filters used on the series of image light frames.

Then, if it's the end of the second night, it’s time to pack up, drive home, and get a few hours of much needed sleep. I regularly try and sleep during imaging runs, but I am lucky to ever get more than an hour or two in a night of imaging. This has gotten easier, however. Since getting back to the US, I bought a trailer to haul my equipment to the site and tossed in a twin mattress to boot. That is living!

       

Next up, Part II - Image Pre-Processing