Astrophotography module (

Started by xaint, January 02, 2017, 07:37:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.



I've made a module called astro a couple of years ago, which I never published because of three reasons.

1: the source code is messy
2: it has never been tested thoroughly
3: it stayed in a highly experimental state

But finding it on a VM a couple of years later, I thought it may worth to share (in spite of the fact that the reasons listed above still apply :) )
Someone may find it useful or may improve it, who knows. :)

You can find the source code at the bottom somewhere.

Basically it's got three functions, which can help you setting up your EQ mount for astrophotography:

- camera alignment (by drawing a horizontal line :), really)
- polar alignment (D.A.R.V. or Drift Alignment by Robert Vice)
- star focusing using the half flux diameter formula
- bonus: you can also change the color scheme to dark red

The basic idea comes from a video on youtube (link is below), where the guy uses a laptop, and a software called BackyardEOS to do the drift alignment & star focusing, but carrying around a laptop with all the other gear can be a bit how ya doin'. Since we already have a nice intervalometer built into magic lantern, I thought it would be nice to have everything built into the camera.

Here's the video:

In order to do the drift alignment, basically you'd have to burn a star's trail into the image using a long exposure, which of course requires the shutter.

Using this module you don't have to release the shutter, it recognises the star (which is used for the alignment) at given points of the screen, then it draws some lines to show it's path.

Something like this:

As you can see, the star arrived a bit above the starting point, so you need to do some adjustments...

(But doing it in BackyardEOS is more precise though, cause you have a high res picture which can be analyzed much better)

And to get an idea, here's how the star focusing works:

Basically, the sharper the star is, the lower the HFD value and the higher the Max pixel value should be.

(by doing some quick tests I've noticed that sometimes the HFD value continues to go down even when we're going out of focus  :-[)

As I've said, it was a highly experimental thing...
Maybe I could fix the bugs, if I had some spare time, or I could just share the source..

If you're brave enough, you can give it a try, here's the module, compiled using the latest build.
I've only tried it on a 550D so be aware. Oh and do it on your own risk! :D

550D only: astro.rar

Here's the independent module (no custom menu, no telescope icon):
You'll find the functions inside the Focus menu.
(According to the compiler: Will load on:  500D, 50D, 550D, 5D2, 5D3, 600D, 60D, 650D, 700D, 7D, EOSM)

Should run on "all" cameras:
Never tested though...

You can find the source code here: source

What do you think? Share your opinion!



Went to try it, but compiled against an older version of the API, so wont load with the latest nightly :-(


Sick stuff @xaint and Thanks for holding this out over the years before sharing. Smart move!

Please make this capable with the latest API in order for us to test with the most recent builds.
5D3.113 | 5D3.123 | EOSM.203 | 7D.203 | 70D.112 | 100D.101 | EOSM2.* | 50D.109



Updated the link, forgot to add the autoexec.bin  ::) (550D only)
It should work now...



Not happy with link. I get adware and all it does is download a .rar file.


Nice xaint!

Maybe it will be interesting to share sources, to make versions for other camera models, test it, and also maybe to help in development.

For the FWHM algorithm, it's hard to get something relevant from the live view feed because of the debayering +/|| scaling (I tired without good results and a certain lack of knowledge to deal with the feed at 1:1 _in crop mode_ resolution). I'm interested by how do you manage that? :)
IMHO it's the most interesting feature because it's on the imaging device, and could be link with a robofocus to compensate the point between LP frames for example.


Very nice piece of work! Thanks!

Would be very happy to see how you made it !! (take a picture and process it or ...)

I am very interested in ways to help to focus near infinity : last holidays I spent two nights near the Gornergrat observatory in the Swiss Alps. In the cold and dark, a little too humid weather... I did not very well with focussing on the milky way... Still trying to get something (somewhat beautiful, certainly not correct) from the timelapse pictures taken (deconvolutions, ....)  :P  ... because it's too late!


The functions are in the Focus menu now, so maybe it'll work on other cameras.
(It worked for me with the latest nightly...)

Added the link above.



Tried again, still get the ad link, but I downloaded the module.

On my 5D3 I get an error "No info structure found(addr 0x0).



I'm using the latest ML builds (5D3) but can't use this module :-(

Could some kind person, who knows what there doing, update this module to run with the latest nighties :-)



Walter Schulz


I'm afraid I'm on 123 and need to stay there.


Nice works @xaint! Thanks a lot for share it :D

I normally use APT on Win PC for DARV but I'm often on the go, then it is nice to leave the PC at home.

It loads ok on 700D with the Latest nightly Build (2017-01-27 01:12)

It do not load on experimental magiclantern-manual_lens_info.2017Jan26.700D114 branch. It shows an "Old Api" "Wrong version (v6.0, expected 7.1) error
EOS 700D 1.1.5, EOS 500D


Quote from: garry23 on January 27, 2017, 03:47:23 PM
Could some kind person, who knows what there doing, update this module to run with the latest nighties :-)
We could easily, but not until the author posts his source code (as required by the terms of the GPL).



Any chance of answering dmilligan's 'hint'  ;)




Quote from: dmilligan on January 28, 2017, 04:53:52 PM
We could easily, but not until the author posts his source code (as required by the terms of the GPL).

Hey @dmilligan, 'thanks' for remembering..

You can find the source code here: source


Quote from: dmilligan on January 28, 2017, 04:53:52 PM
(as required by the terms of the GPL).

Not to start this argument but; wouldn't the GPL only cover this if it was a modification to ML? As this is a separate module in would be under whatever licence the author chooses.


At the very least, it's not possible to write a module without including GPL'd ML source code (such as header files).



It works on my 6Da and ML nightly 2016Dec19.6D116

just copied from astro.rar the to the sd card

[edit] tested the newest nightly build 2017Sep30.6D116, it loads astro modul, seems to be working, still no field test performed...


Dear all,
this module does not work on 1100D with the latest firmware.
I got always these errors:

tcc: error undefined symbol 'raw_lv_request'
tcc: error undefined symbol 'raw_lv_release'
failed to link modules

How can fix this issue?


I would LOVE to have this, however the all cameras link did not work properly. Any where else I can pull the Astro module from?


it is not part of the official ML repository.
guess there is no maintainer then who would keep it working whenever ML changed some internals.
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!