Magic Lantern Forum

Developing Magic Lantern => Modules Development => Topic started by: xaint on January 02, 2017, 07:37:19 PM

Title: Astrophotography module (astro.mo)
Post by: xaint on January 02, 2017, 07:37:19 PM
Hello!

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.

(http://inthefield.uw.hu/ml/VRAM0.png)

(http://inthefield.uw.hu/ml/VRAM2.png)


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:
https://youtu.be/zQB6UnrTEEM?list=PLdSieE6m2qgtXhHODxebbiRg5INaL5IpF&t=1693 (https://youtu.be/zQB6UnrTEEM?list=PLdSieE6m2qgtXhHODxebbiRg5INaL5IpF&t=1693)

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:

(http://inthefield.uw.hu/ml/1.png)

(http://inthefield.uw.hu/ml/2.png)

(http://inthefield.uw.hu/ml/3.png)

(http://inthefield.uw.hu/ml/4.png)

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:

(http://inthefield.uw.hu/ml/starfocus.gif)

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 (http://www.mediafire.com/file/fz2yejcowf1en9z/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: astro.mo  (http://www.mediafire.com/file/aa3xq33ec01fa1g/astro.mo)
Never tested though...


You can find the source code here: source  (https://bitbucket.org/xaint/magic-lantern-astro-module/)


What do you think? Share your opinion!
Title: Re: Astrophotography module (astro.mo)
Post by: garry23 on January 02, 2017, 07:54:20 PM
@xaint

Went to try it, but compiled against an older version of the API, so wont load with the latest nightly :-(
Title: Re: Astrophotography module (astro.mo)
Post by: DeafEyeJedi on January 02, 2017, 07:58:05 PM
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.
Title: Re: Astrophotography module (astro.mo)
Post by: domasa on January 02, 2017, 08:24:57 PM
It looks great. Thank you!
Title: Re: Astrophotography module (astro.mo)
Post by: xaint on January 02, 2017, 10:31:50 PM
Updated the link, forgot to add the autoexec.bin  ::) (550D only)
It should work now...
Title: Re: Astrophotography module (astro.mo)
Post by: garry23 on January 02, 2017, 10:38:43 PM
@xaint

Not happy with link. I get adware and all it does is download a .rar file.
Title: Re: Astrophotography module (astro.mo)
Post by: SpcCb on January 03, 2017, 04:18:51 AM
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.
Title: Re: Astrophotography module (astro.mo)
Post by: BBA on January 03, 2017, 03:52:29 PM
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!
Title: Re: Astrophotography module (astro.mo)
Post by: xaint on January 04, 2017, 10:29:34 PM
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.
Title: Re: Astrophotography module (astro.mo)
Post by: garry23 on January 04, 2017, 10:33:57 PM
@xaint

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).

:(
Title: Re: Astrophotography module (astro.mo)
Post by: garry23 on January 27, 2017, 03:47:23 PM
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 :-)

Cheers

Garry
Title: Re: Astrophotography module (astro.mo)
Post by: Walter Schulz on January 27, 2017, 04:24:05 PM
You tried 1.1.3, too?
Title: Re: Astrophotography module (astro.mo)
Post by: garry23 on January 27, 2017, 04:42:06 PM
I'm afraid I'm on 123 and need to stay there.
Title: Re: Astrophotography module (astro.mo)
Post by: IBIRRU on January 28, 2017, 11:00:35 AM
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
Title: Re: Astrophotography module (astro.mo)
Post by: dmilligan on January 28, 2017, 04:53:52 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).
Title: Re: Astrophotography module (astro.mo)
Post by: garry23 on January 28, 2017, 05:29:38 PM
@xaint

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

Cheers

Garry
Title: Re: Astrophotography module (astro.mo)
Post by: xaint on February 06, 2017, 11:05:12 AM
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 (https://bitbucket.org/xaint/magic-lantern-astro-module/)
Title: Re: Astrophotography module (astro.mo)
Post by: ItsMeLenny on February 06, 2017, 12:40:08 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.
Title: Re: Astrophotography module (astro.mo)
Post by: dmilligan on February 06, 2017, 01:11:17 PM
At the very least, it's not possible to write a module without including GPL'd ML source code (such as header files).
Title: Re: Astrophotography module (astro.mo)
Post by: matt_chun on August 24, 2017, 06:01:57 PM
Does it work on 6D?
Title: Re: Astrophotography module (astro.mo)
Post by: nashhen on September 30, 2017, 02:33:25 PM
It works on my 6Da and ML nightly 2016Dec19.6D116

just copied from astro.rar the astro.mo 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...
Title: Re: Astrophotography module (astro.mo)
Post by: dareius on December 15, 2017, 10:05:29 PM
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?
Best
Title: Re: Astrophotography module (astro.mo)
Post by: cshell on December 31, 2017, 07:32:19 AM
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?
Title: Re: Astrophotography module (astro.mo)
Post by: Erik Krause on May 13, 2018, 07:54:23 PM
Why isn't astro.mo in the /modules folder on https://bitbucket.org/hudson/magic-lantern/src ?
Title: Re: Astrophotography module (astro.mo)
Post by: g3gg0 on May 14, 2018, 12:44:20 AM
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.
Title: Re: Astrophotography module (astro.mo)
Post by: waza57 on May 22, 2018, 01:15:02 AM
@xaint

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).

:(

   

You must try:
the name of module all in lowercase
report it in Makefile.modules.default

Code: [Select]
hg add astro.c then  :
Code: [Select]
hg commit -m "your message info" After this you can try to compile the module
Title: Re: Astrophotography module (astro.mo)
Post by: cshell on June 01, 2018, 08:02:06 AM
I finally got this working. Seems that my other computer had some type of protection on it not allowing the download. I’ve tested it on the last 2 builds for the 7D and plan to do the latest tonight. All I can say is thank u so much! I think it’s great!
Title: Re: Astrophotography module (astro.mo)
Post by: IBIRRU on September 20, 2018, 03:13:11 PM
@xaint
any chance to have an updated (working with actual ML builds) version of this module?  :)

Thanks
Title: Re: Astrophotography module (astro.mo)
Post by: a1ex on September 20, 2018, 04:10:55 PM
Actually I see the problem a bit in a slightly different direction: updating the main builds to the new backend, i.e. merging the lua_fix branch, but I need some help with testing (https://www.magiclantern.fm/forum/index.php?topic=14828.msg206309#msg206309).

Then, this module (and all others) should work in both main builds and experimental ones, i.e. you should be able to freely swap modules around.

Still need to sit down and take a closer look at this module; sorry for the delay.
Title: Re: Astrophotography module (astro.mo)
Post by: darlock on December 26, 2018, 04:40:47 PM
Very usefull module for 6d. 6d sensor had really low noise level.
Is it possible to include it to release pack?

Is it possible to transfer some  data from canon to external device via serial protocol?
Title: Re: Astrophotography module (astro.mo)
Post by: tignasse on January 04, 2019, 08:44:58 PM
It works on my 6Da and ML nightly 2016Dec19.6D116

just copied from astro.rar the astro.mo 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...


Hi,yes it works with 6D 1.1.6 with the last nightly build ,but the LV gain must be on 0 EV...
Title: Re: Astrophotography module (astro.mo)
Post by: 02keilj on January 09, 2019, 12:51:26 AM
Man I am so glad I decided to jump on the forums this morning. I am just about to head off camping and will be hiking up to a nice secluded area with 360 degree views for some astrophotography. I also just did a few modifications to my telescope EQ2 mount with motor drive so I can mount my DSLR.

I have installed the module on my 6D and it appears to have loaded correct so I will give it a bit of a go the next few nights (clear skies permitted) and report back with any successes/issues.


Title: Re: Astrophotography module (astro.mo)
Post by: dansawyeror on April 03, 2019, 02:44:16 PM
I would like to try this module on my M1, however I cannot download the source. Does anyone know where the source may be downloaded?
Title: Re: Astrophotography module (astro.mo)
Post by: Walter Schulz on April 03, 2019, 02:52:35 PM
No trouble here downloading from the location linked in first posting.
Title: Re: Astrophotography module (astro.mo)
Post by: scrax on April 03, 2019, 08:38:38 PM
I didn't noticed this module, seems interesting but there is only the code for the module, what is different in the 550D version? I suppose icons should be in ML code
Title: Re: Astrophotography module (astro.mo)
Post by: IBIRRU on July 05, 2019, 01:29:23 PM
There is a goog guy able to re-compile the module for Danne "crop_rec_4k_mlv_snd_isogain_1x3_presets_2019Apr02.700D115"?

Thanks  :)
Title: Re: Astrophotography module (astro.mo)
Post by: dfort on July 06, 2019, 03:43:42 AM
There is a goog guy able to re-compile...

I'm a goog guy. Check out my downloads page (https://bitbucket.org/daniel_fort/magic-lantern/downloads/).

Didn't have a chance to play around with it very much but l like the feature that turns the menus red. Doesn't work that great on the EOSM because the screen keeps refreshing. Turn on the module and navigate to the ML/Focus menu to see the new options.

(https://live.staticflickr.com/65535/48209098386_765b927210.jpg) (https://flic.kr/p/2gs5enu)
(Wait 30 minutes for your eyes to get used to the dark.  :P )

What I did was copy the source to a new branch (https://bitbucket.org/daniel_fort/magic-lantern/branch/astro_photography_module) -- branched off of lua_fix so it should compile for most cameras. Then I added the module to Danne's latest compiled for the 700D. Haven't played around with that much either. The module should work on other branches and maybe other cameras. IDK -- give it a try and have fun with it.

Would have been nice to discover this sooner. I recently went to Death Valley to see the Milky Way. This is what it looked like from Dante's View:

(https://live.staticflickr.com/65535/48189451021_8fa2339f30.jpg) (https://flic.kr/p/2gqkwTP)

That isn't the sunset on the horizon, it is the lights from Los Angeles. The lights from Las Vegas are even brighter there.
Title: Re: Astrophotography module (astro.mo)
Post by: IBIRRU on July 11, 2019, 08:18:48 PM
 :) :) Yes! You are a good guy! And all people involved in ML project are good guy!

Thanks a lot DFort.
I've just downloaded and installed, it seems to works without any problem.

I will play around next weekend (if not cloudy :-[)

Your picture is fantastic 

I'm trying to reduce all hardware to minimum and this module could be useful (I hope)