New [ and free! ] software to help taking flats alongside SGP Pro

Hi all

While I’ve been largely locked under clouds for a couple of months, I thought I’d write some software that I’ve been meaning to get around to for a while.

I use a standard LCD computer monitor for taking flats. I plug it in to my imaging laptop. I started off using a blank HTML page in a full-screen browser window to provide the uniform grey colour on the display but I needed to vary the brightness of the display for different filters.

So, I wrote some software that does it. The software is called Second Monitor Lightbox and is available free of charge from my site (

If you use a CCD or CMOS with filter wheel, it’ll link to the filter wheel via the ASCOM driver so that, once you’ve set the perfect brightness for each filter, it will change brightness automatically as the filter changes.

It also has a ‘preset’ mode for non-ASCOM set ups so that you can just re-call a pre-determined brightness to match a certain configuration (filter, binning, etc).

There’s a tutorial based around using SGP Pro on the site, so if you want to try it have a look through that.

When you install it, Windows will warn you that it’s from an Unknown Publisher. This is just because I don’t pay Microsoft an annual fee for a developer’s certificate. Just tell Windows to install it anyway - you may need to click ‘More information’ to get the option to go ahead.

Let me know what you think. I hope some of you will find it useful. I know it saves me a load of hassle at the end of a long session trying to get the right brightness level to give decent flats for each filter.

You can get it from here:



I love the creative altruism of the amateur astronomy community. I use SGP’s Flats Calibration Wizard, which works pretty well and saves the values in the Equipment Profile. Your offering seems like it does a similar thing with the added benefit of working with any light producing device, particularly an ordinary LCD! Can you add real-time ADU determination and brightness setting at the time of image capture? In fact, this would be a great feature to add to SGP’s sequencing process!

Thanks for sharing.


Hi Mel

Yeah, I love the community aspect, too. The help I’ve been given in the forums has been amazing.

SM Lightbox is designed to be used with the flats calibration wizard.

The reason I developed SML is that the difference in exposure between the broadband and narrowband filters meant that the flats calibration wizard might give me a sub-second exposure for the BB filters but a > 10 sec exposure for the NB filters. By varying the brightness of the display with SML I can equalise the exposure times.


1 Like

This is awesome! I will test out automating a sequence with it. I wonder if you can use a vb script to get the mount to move into a “flats” position (my monitor is set up like yours, sitting on a box looking up, needing the telescope to point straight downwards)


I always do my flats at the end of the session so I turn off the mount release the clutches and just swing the scope into position.

I use a CGE-Pro mount and do use a VB script to go park at my flat position. In SGP, I have a single BIAS frame I take before the flat sequence. So I have SGP run the VB script before the BIAS shot to move it into position. Works great.

1 Like

how i handled this was to define a custom park position (alt/az) in the AP driver; then i set the first event in the flat target to park the scope. the problem with this is that if you need another park position to safely close your dome, you’re out of luck.

overall SGP does need some enhancements in flat handling, especially where rotators are concerned.


Would you mind sharing that script, pmumbower? I could really use something like that, and know how to code, but haven’t seen any examples (haven’t really searched hard I guess) to reverse engineer for my purposes.

Yes that is my problem, else I would just use the park position (or figure a better way to mount my second monitor :wink: )

oh well… anyway i’d like to see that script too; vbs is kind of a mystery to me and i did take a crack at it and failed. i guess it would be nice to know how to run an ascom vbs script independently of SGP just so it can be debugged.


I haven’t tested this - no where near my astro kit at the moment - but couldn’t you set the RA and DEC of a vertical downward position on the target properties for the flats target and get SGP to slew to that before taking the flat exposures?

well the problem is that as the night goes by, the RA/DEC of some particular alt/az is changing… at 15 degrees per hour. i guess if you were absolutely sure the flats would start at some particular time then you could calculate what the ra/dec would be, but this is rather a kludge.

anyway, sgp needs to either 1) be able to take dawn/dusk sky flats (and calculate the time and pointing) or 2) allow the user to specify an alt/az before a flat target. ideally SGP would also remember the sky to mechanical rotator angle mapping, or simply allow mechanical angles to be set when shooting flats. IIRC if you try to take flats before a plate solve has occurred, then the angles are interpreted as mechanical angles; if you take flats after a plate solve has occurred, then the angles are interpreted as sky angles. i could be wrong about that though.


HomerPepsi /ste73 / Rob - I have attached the vbs script I use to park my scope at the correct position to take flats via my lightbox. It is saved as a .txt so I could upload it, but normally the extension is .vbs

Pretty simple to use really and it is via ASCOM so as long as your mount has a ASCOM driver, it should work along the same lines. Basically it connects to the mount, turns off the tracking and then slews to the Alt/AZ coordinates that is in the parked position, then it disconnects from the mount.

I also have another script that I run after taking flats that basically turns the mount tracking on.

lightboxpark.txt (188 Bytes)


Oh and for debugging this or any vbs script, you do not even need SGP running. Just need the mount and anything ASCOM device being controlled to be turned on and connected. Then you just double click the script. Once that is tweaked, I ran it SGP to make sure it runs well.

ok thanks, i will give the script a try. it’s similar to what i had, but my syntax must have been wrong.

i guess i would not have expected a .vbs file to just do something when clicked, but as mentioned i don’t know anything about windows :slight_smile:


I am not a vbs pro, but use it enough at work to stay out of trouble. If you have any questions or want me to take a peak at your script, I would be glad too.


thanks - all i really wanted to do is what your script does, so if i replace your alt/az with mine i should be good. it’s been raining here so i’ll have to wait a couple of days to try it out.

You would also need to change the mount object name if you do not have a Celestron. I think I recall you having a AP mount. So if you launch the ASCOM Profile Explore, look in the “Telescope Drivers” section. The exact name of the ASCOM object for your mount should be there. Put that in place of mine(ASCOM.Celestron.Telescope) on this line:

set Telescope = CreateObject(“ASCOM.Celestron.Telescope”)


right - thanks. i can’t remember offhand what an AP ‘telescope’ is called so i’ll look in the explorer.

Thank you, sir!