Jump to content

  •  

CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.

Photo

New Canon+Magic Lantern script: "Eclipse Magic" - Generate and execute a full sequence of varied exposures spanning all eclipse phases.

  • Please log in to reply
67 replies to this topic

#1 grnbrg

grnbrg

    Vostok 1

  • *****
  • topic starter
  • Posts: 129
  • Joined: 01 Mar 2017
  • Loc: Winnipeg, Canada

Posted 19 June 2017 - 09:25 PM

For those Canon users who are familiar with the Magic Lantern firmware enhancement software who are looking for a "set and forget" (other than removing and replacing the filter at the appropriate time) solution, I have written the following script.  It:

  • Calculates the intervals to take an arbitrary number of partial phase images, both in the C1-C2 and C3-C4 periods.
  • Includes a configurable "margin" time, so that the first and last interval images are "interesting".
  • Allows for exposure bracketing of the partial phase images.  Configurable number of brackets and f-stops.
  • Fires a configurable "burst" of images at C2 and C3.  Depending on your camera's buffer, you can adjust how far before C2 and C3 this burst starts, so that you can be sure of coverage.
  • During totality, will run through a configurable range of exposures as many times as possible.  Minimum and maximum shutter speed, as well as the f-stop step size can be specified.
  • Image times are calculated based on clock time, not by intervals between shots, which means that if you need to restart the camera (to change a battery, late setup, or other issue) the sequence will begin to execute at whatever image is appropriate for the current time.
  • Has a test mode, which will run through a given sequence (starting at 00:00:00 when the camera powers on) without activating the shutter.

To use it, you'll need a supported Canon body, and (unfortunately) the beta "lua_fix" build of Magic Lantern.  The "burst mode" function call is not yet supported in the mainline versions.  Just open the script on a computer, fill in the constants (contact times, bracketing options and exposure details) near the top, and then save it to the "/ML/scripts" directory of your camera media.  The just run the "Eclipse Magic" script from the appropriate ML menu tab.

http://www.grnbrg.or...lipse_magic.lua

 
grnbrg


  • Mad MikeE, Plane, LarsMalmgren and 2 others like this

#2 Walter Schulz

Walter Schulz

    Lift Off

  • -----
  • Posts: 3
  • Joined: 20 Jun 2017

Posted 20 June 2017 - 01:01 PM

Found your post via google and took the liberty to link it in ML forum: http://www.magiclant...19734.msg186033

Then a1ex put it on ML's twitter account: https://twitter.com/...129735670771713

 

Created account to thank you for sharing your LUA script!

Wish you a clear sky!


Edited by Walter Schulz, 20 June 2017 - 01:04 PM.

  • grnbrg likes this

#3 grnbrg

grnbrg

    Vostok 1

  • *****
  • topic starter
  • Posts: 129
  • Joined: 01 Mar 2017
  • Loc: Winnipeg, Canada

Posted 20 June 2017 - 07:20 PM

Having just had time to do a full "put the telescope at the tripod, do a full series focused on the sun, and see what happens" test.... smile.gif

I'd like to point out that the posted script is at version 1.0.0, and I probably should have waited a bit before posting. But I was excited.

Although the script works reasonably well, there is at least 1 timing bug, and at least 1 display bug. There are also some optimizations and improvements that I have in mind.

I'm certainly looking for feedback, but watch this space. There will be improved versions posted shortly.




grnbrg.

Edited by grnbrg, 20 June 2017 - 07:21 PM.


#4 grnbrg

grnbrg

    Vostok 1

  • *****
  • topic starter
  • Posts: 129
  • Joined: 01 Mar 2017
  • Loc: Winnipeg, Canada

Posted 20 June 2017 - 11:59 PM

New, bugfixed edition: eclipse_magic.lua


grnbrg.

#5 SteveInNZ

SteveInNZ

    Viking 1

  • *****
  • Posts: 803
  • Joined: 07 Oct 2007
  • Loc: Auckland, New Zealand

Posted 21 June 2017 - 04:28 PM

I've used ML a little in the past but didn't really get into it and eventually uninstalled it.

I downloaded the lua_fix version for my 100D/SL1, installed it and ran your script. It was easy to setup and all went well.

One thing that quickly became apparent is that the SL1 will only buffer 6 RAWs before it virtually grinds to a halt. Is it possible/feasible to select between jpg & RAW within the script ? Given the options, I'd prefer to have many jpg's of Bailey's Beads but slower RAWs for totality.

 

Steve.



#6 grnbrg

grnbrg

    Vostok 1

  • *****
  • topic starter
  • Posts: 129
  • Joined: 01 Mar 2017
  • Loc: Winnipeg, Canada

Posted 21 June 2017 - 05:14 PM



One thing that quickly became apparent is that the SL1 will only buffer 6 RAWs before it virtually grinds to a halt. Is it possible/feasible to select between jpg & RAW within the script ? Given the options, I'd prefer to have many jpg's of Bailey's Beads but slower RAWs for totality.

That's a good idea, and quite easy.  I'll add it tonight or tomorrow.  I'm also looking at the burst of images over the Baily's Beads times again, and may make some changes.  The burst mode is  good, but it might be better to have exposures spread out over 6-8 seconds.  A rapid-fire string of single exposures might be better.  That said, the scripting support in Magic Lantern is still pretty new, and I've been seeing lockups when trying to do too much, too quickly....  smile.gif

 

 

Edit:  Huh.  Actually, it doesn't look there are any references to image quality changes in the API at all.  You can make manual changes while the script is running, but it doesn't look like i can flip between RAW and JPG programmatically.  I'll suggest it, but development moves slowly, and I it's highly unlikely to see that feature in time....

 

 

 

grnbrg.


Edited by grnbrg, 21 June 2017 - 05:47 PM.


#7 SteveInNZ

SteveInNZ

    Viking 1

  • *****
  • Posts: 803
  • Joined: 07 Oct 2007
  • Loc: Auckland, New Zealand

Posted 21 June 2017 - 06:41 PM

That's OK. It was worth asking.

I haven't decided what setup I'll use for what bits yet so I'm looking at all the options.

 

Steve.



#8 grnbrg

grnbrg

    Vostok 1

  • *****
  • topic starter
  • Posts: 129
  • Joined: 01 Mar 2017
  • Loc: Winnipeg, Canada

Posted 05 July 2017 - 11:17 PM

Updated to 1.2.1: http://www.grnbrg.or...lipse_magic.lua
  • Improved calculation of the time to the nearest second.
  • Fixed the intervals for the partial phase images.
  • Added filter alarms
  • Allow for non-symmetric burst times across C2 and C3. (ie: 5 seconds before C2 to 3 seconds after)
  • In addition to varying the shutter speed during the totality sequence, also vary ISO.
  • Optionally prompt user to turn off LiveView, which causes a crash with some body and shutter speed combinations.
Also, since I last posted this script, the Magic Lantern devs have released another set of "lua_fix" experimental builds at https://builds.magic...xperiments.html, including a build for the Canon 70D, which was previously unavailable.

I'm quite happy with this version of the script. All of the ideas I've had (that didn't prove to be unsupported by the scripting engine) have been implemented. Unless I have (or someone requests) a bright idea, there might be some minor bug fixes, but that's it.

That said, if you think your life would be easier if the script did something that it currently does not.... Let me know! If it's possible, then I can probably add it.



(Brian) grnbrg.

#9 grnbrg

grnbrg

    Vostok 1

  • *****
  • topic starter
  • Posts: 129
  • Joined: 01 Mar 2017
  • Loc: Winnipeg, Canada

Posted 09 July 2017 - 10:27 PM

Updated to 1.3.0 -- http://www.grnbrg.or...lipse_magic.lua
  • Changed the startup timing loop to be more accurate if the script is started close to a second boundary. (The average offset of 999ms and 1ms is 1ms, not 500ms)
  • Corrected an error in wait_until() -- Used div, where modulus was correct, and had the tick_offset correction wrong. Don't code while tired. Thanks to matman730 for pointing out this goof.
  • Improved the configuration comments around TestBeepNoShutter. They apparently weren't clear as I thought.
Regarding test mode -- if TestBeepNoShutter is set to 1, the contact times are times offset from the start of the script, otherwise they are clock time. For example:
 


If C1 is set to 10:30:00 (ie: 10:30:00 am), and the current time on the camera is set to 08:20:00 (ie: 8:20:00 am), then:

If TestBeepNoShutter is set to 1, then the script will start demonstrating eclipse exposures in ten hours and thirty minutes.

If TestBeepNoShutter is set to 0, the script will start taking actual exposures in two hours and ten minutes (ie: at 10:30:00).




grnbrg.

#10 grnbrg

grnbrg

    Vostok 1

  • *****
  • topic starter
  • Posts: 129
  • Joined: 01 Mar 2017
  • Loc: Winnipeg, Canada

Posted 10 July 2017 - 07:59 PM

Today, I discovered an obscure menu setting that is the source of an issue I have had...

 

I really want to be able to run the script with Live View active -- LV locks the mirror up, eliminating vibration due to mirror slap.  BUT....  I found that, when LV was active, my shutter speed was limited to between 1/4000th and 1/30th of a second -- anything outside that range crashed the script.  I was told this was a limitation of the hardware.

 

It turns out that it is only a limitation of movie mode.  And if you turn off the ability to shoot video, you can run Live View, and have the full range of shutter speeds (1/8000th through 30 seconds) available!  Basically, you go into the (Canon) menu, under LiveView prefs, and change the first option to "Stills Only".  ("Stills+Movie" limits the shutter speed.)

 

Full shutter range in Live View!!

 

Detailed instructions can be found near the top of this Canon page.

 

I will see if I can test for this setting programmatically in the script, and throw an error.

 

 

 

grnbrg.


  • kbev likes this

#11 grnbrg

grnbrg

    Vostok 1

  • *****
  • topic starter
  • Posts: 129
  • Joined: 01 Mar 2017
  • Loc: Winnipeg, Canada

Posted 18 July 2017 - 10:30 PM

Update to 1.5.0 -- Eclipse Magic
  • Make it optional to hide the console during script running, and allow the delay before and after the next image to be configured.
  • Shutter shock reduction: Add a configurable (in milliseconds) delay before an exposure where the shutter speed is within a (also configurable) range.
  • Add a mid-eclipse section. This is a short section around the max eclipse point to optionally try for some earthshine exposures.
  • Set the aperture on program start.
I also tried to get the script to change the file prefix from the standard "IMG_" prefix to something different for various phases of the eclipse, but couldn't get it working reliably, so I scrapped it. Sorry.

Also, I checked with one of the Magic Lantern devs about having the script change the image quality settings, to allow JPG during the C2 and C3 bursts, and RAW at other times. Apparently the way the Canon firmware handles those settings has some significant technical issues, and as such won't be available to scripts any time soon, if ever. frown.gif

Hope people find the script useful. If you have questions feel free to email me, or ask them here.



grnbrg.

#12 AstroLabs

AstroLabs

    Sputnik

  • *****
  • Posts: 48
  • Joined: 12 Sep 2010
  • Loc: Idaho

Posted 18 July 2017 - 11:01 PM

Thanks Brian, for offering this.  Have tried several times to download the newer Canon 70D build but each time I get an error message that closes the program.  Is there sometime I'm missing with the download?  Thanks again Gary

 

"No suitable decoder module:
VLC does not support the audio or video format "undf". Unfortunately there is no way for you to fix this."

 

I extracted the zip file and get the above message.



#13 grnbrg

grnbrg

    Vostok 1

  • *****
  • topic starter
  • Posts: 129
  • Joined: 01 Mar 2017
  • Loc: Winnipeg, Canada

Posted 18 July 2017 - 11:14 PM

Thanks Brian, for offering this.  Have tried several times to download the newer Canon 70D build but each time I get an error message that closes the program.  Is there sometime I'm missing with the download?  Thanks again Gary
 
"No suitable decoder module:
VLC does not support the audio or video format "undf". Unfortunately there is no way for you to fix this."
 
I extracted the zip file and get the above message.


What are you doing, step by step?

Installing Magic Lantern is pretty much:
  • Open the distribution zip file
  • Copy the files from the zip file to the root of your camera's memory chip
  • From the Canon menu, run "upgrade firmware", which runs the tiny firmware file included in the zipfile, which I believe just sets a flag in the camera's NVRAM, telling it to load the software binaries in the ML directory on the card
  • Reboot the camera
  • Press the "Trash" button to access the ML menus.
  • Edit: You'll need to go into the ML menu, and enable the "lua" module in the "Modules" menu tab, and then reboot again.
The other possibility is that your firmware does not match the version the ML software was built against. The current "lua_fix" experimental build for the 70D requires the latest Canon 70D firmware (version 1.1.2) be installed.



grnbrg.

Edited by grnbrg, 18 July 2017 - 11:17 PM.


#14 grnbrg

grnbrg

    Vostok 1

  • *****
  • topic starter
  • Posts: 129
  • Joined: 01 Mar 2017
  • Loc: Winnipeg, Canada

Posted 18 July 2017 - 11:31 PM

Just a note -- in another thread, it was pointed out that at least some Canon bodies do not disable their mirrors during Live View -- the 500D and 1100D have been confirmed to have this behaviour.

So, as always... Test your setup, and adapt to the results. If LV doesn't lock the mirror on your body, enabling it during the script run isn't going to do anything more than waste your batteries.



grnbrg.

#15 AstroLabs

AstroLabs

    Sputnik

  • *****
  • Posts: 48
  • Joined: 12 Sep 2010
  • Loc: Idaho

Posted 19 July 2017 - 08:07 AM

I decided to try ML on my T2i since the build is older and well established.  Got it installed and working fine.  Will attempt

to use your script and do some testing.  Thanks again



#16 Plane

Plane

    Explorer 1

  • -----
  • Posts: 97
  • Joined: 09 Dec 2009

Posted 27 July 2017 - 11:34 AM

Hi,

 

I tested the script on 6D. A problem raises when calling camera.burst(burst_count).

 

attempt to call a nil value (field 'burst')

 

Which build should I use in order to have this support?

 

I looked up ML's lua api website and this function is indeed there. 

 

Thanks!



#17 grnbrg

grnbrg

    Vostok 1

  • *****
  • topic starter
  • Posts: 129
  • Joined: 01 Mar 2017
  • Loc: Winnipeg, Canada

Posted 27 July 2017 - 11:40 AM



Hi,

 

I tested the script on 6D. A problem raises when calling camera.burst(burst_count).

 

attempt to call a nil value (field 'burst')

 

Which build should I use in order to have this support?

 

I looked up ML's lua api website and this function is indeed there.

Are you using the correct experimental build?

 

For the 6D, it would be https: //builds.magiclantern. fm/jenkins/job/lua_fix/410/artifact/platform/6D.116/magiclantern-lua_fix.2017Jul06.6D116.zip, downloaded from http: //builds.magiclantern .fm/experiments.html.

 

The script uses lua features that are not yet in the main builds.

 

 

 

grnbrg.


Edited by grnbrg, 27 July 2017 - 11:41 AM.


#18 Plane

Plane

    Explorer 1

  • -----
  • Posts: 97
  • Joined: 09 Dec 2009

Posted 27 July 2017 - 02:31 PM

Hi,

 

Thanks, I've figured that out!



#19 ranger10x

ranger10x

    Lift Off

  • -----
  • Posts: 11
  • Joined: 12 Oct 2009
  • Loc: Houston

Posted 03 August 2017 - 01:24 PM

Sorry for ignorance on using Magic Lantern since I never used it before.  I would love to add this on my Canon T2i for the eclipse but my only problem I'm not sure how to install ML along with the eclipse script.  I have the eclipse script from this forum version 1.5 which was a copy and paste to Notepad.  Not sure if that was correct or not.  Can somebody help on how to install ML along with the eclipse script?  Thanks all!



#20 OrtKapolei

OrtKapolei

    Lift Off

  • -----
  • Posts: 2
  • Joined: 11 Jun 2017

Posted 03 August 2017 - 08:24 PM

Hi grnbrg,

 

I just tested the Eclipse LUA on my 6D & T3i just to take landscape using Experimental ML.  It seems to work fine.  However, I set it to take 30 sets between C1 & C2 and C3 & C4.  My 2 batteries in the grip for each camera did not last until the end of C4.  I used Live View.  I will probably have to bring it down to 20 shots.  I also would love to get a shot before C1 and after C4.  What is a trick to do that?  Do I just change C1 time to earlier and C4 to later?  Sincerely,



#21 grnbrg

grnbrg

    Vostok 1

  • *****
  • topic starter
  • Posts: 129
  • Joined: 01 Mar 2017
  • Loc: Winnipeg, Canada

Posted 03 August 2017 - 10:01 PM

Sorry for ignorance on using Magic Lantern since I never used it before.  I would love to add this on my Canon T2i for the eclipse but my only problem I'm not sure how to install ML along with the eclipse script.  I have the eclipse script from this forum version 1.5 which was a copy and paste to Notepad.  Not sure if that was correct or not.  Can somebody help on how to install ML along with the eclipse script?  Thanks all!


First, download the beta "lua_fix" ML branch package that corresponds to your camera body and firmware from https://builds.magic...xperiments.html

Install guide: https://builds.magic...xperiments.html User guide: http://wiki.magiclantern.fm/userguide

You'll need to enable the "lua" plugin, in the Magic Lantern plugins menu.

Edit the first few pages of the camera script in Notepad, and change it to suit your needs -- contact points, exposure settings, etc.

Save the customized script to the camera memory card, in the ..../ML/Scripts directory

Power up the camera, and there will be a scripts tab in the ML menu. Run the "Eclipse Magic" script from there.



Test, test, test. No part of the running of the script should be a surprise, or unexpected.



grnbrg.
  • ranger10x likes this

#22 grnbrg

grnbrg

    Vostok 1

  • *****
  • topic starter
  • Posts: 129
  • Joined: 01 Mar 2017
  • Loc: Winnipeg, Canada

Posted 03 August 2017 - 10:08 PM

Hi grnbrg,
 
I just tested the Eclipse LUA on my 6D & T3i just to take landscape using Experimental ML.  It seems to work fine.  However, I set it to take 30 sets between
C1 & C2 and C3 & C4.  My 2 batteries in the grip for each camera did not last until the end of C4.  I used Live View.  I will probably have to bring it down
to 20 shots. 

I also would love to get a shot before C1 and after C4.  What is a trick to do that?  Do I just change C1 time to earlier and C4 to later?


Do you have a spare set of batteries? I'd wait for one of the last pre-totality partials to be exposed, and do a battery swap. Power the camera back up, and re-start the script. It will pick up where it left off, and schedule the next exposure at the correct time.

If you want a shot of the full solar disk, before and after the eclipse, I would set PartialMarginTime to 0.  You could also move C1 and C4 slightly, but that's probably unnecessary.

 

 

grnbrg.

 

Edit:  If you're just taking wide angle shots, you might leave LiveView off -- the only reason to have it running is to reduce vibration due to mirror slap, and that is unlikely to be an issue at a short focal length.  You might also take the lens off, and with LV on, fire a few frames.  The 6D will be fine, but the T3i may actually drop and pull up the mirror for every frame, at which point LV is pointless.


Edited by grnbrg, 03 August 2017 - 10:12 PM.


#23 ranger10x

ranger10x

    Lift Off

  • -----
  • Posts: 11
  • Joined: 12 Oct 2009
  • Loc: Houston

Posted 04 August 2017 - 09:21 PM

 

Sorry for ignorance on using Magic Lantern since I never used it before.  I would love to add this on my Canon T2i for the eclipse but my only problem I'm not sure how to install ML along with the eclipse script.  I have the eclipse script from this forum version 1.5 which was a copy and paste to Notepad.  Not sure if that was correct or not.  Can somebody help on how to install ML along with the eclipse script?  Thanks all!


First, download the beta "lua_fix" ML branch package that corresponds to your camera body and firmware from https://builds.magic...xperiments.html

Install guide: https://builds.magic...xperiments.html User guide: http://wiki.magiclantern.fm/userguide

You'll need to enable the "lua" plugin, in the Magic Lantern plugins menu.

Edit the first few pages of the camera script in Notepad, and change it to suit your needs -- contact points, exposure settings, etc.

Save the customized script to the camera memory card, in the ..../ML/Scripts directory

Power up the camera, and there will be a scripts tab in the ML menu. Run the "Eclipse Magic" script from there.



Test, test, test. No part of the running of the script should be a surprise, or unexpected.



grnbrg.

 

Thank you for responding and the directions.  I got ML and your eclipse script installed on my Canon T2i and tested it out by just changing the time on the Camera with the Shutter going off and it worked great.  Now thinking about using it on my Canon 6d.  Now I have two Cameras on two scopes and with this script I can just sit back with a beer and enjoy the eclipse.  Great work!  I was trying to find out how to control two cameras from one Laptop but with this script no need using a laptop.



#24 ranger10x

ranger10x

    Lift Off

  • -----
  • Posts: 11
  • Joined: 12 Oct 2009
  • Loc: Houston

Posted 05 August 2017 - 06:23 PM

Thanks for the help.  I have the script on both my Canon 6d and my Canon T2i and tested both by adjusting the time on the Cameras and let the Shutter go off.  Worked for my purpose.  The only diffence that I saw was the Canon 6d did not give me the audio warnings like the Canon T2i did.  Anything that I need to do with the 6d?  The diffence in the script was that I asked for 17 pictures of the partial eclipse with the 6d while the Canon T2i I just left it at the default.

 

Update:  I verified that the beep sound was enabled on my 6d and performed a test again in the same configuration except I lower the partial eclipse pictures to 14.  Just prior to C2 still did not hear the beeping warning both prior or after C2.  Not a game changer to me but it was a nice feature.  There was around 4 minutes on my last C1 picture and the start of C2.


Edited by ranger10x, 05 August 2017 - 07:58 PM.


#25 grnbrg

grnbrg

    Vostok 1

  • *****
  • topic starter
  • Posts: 129
  • Joined: 01 Mar 2017
  • Loc: Winnipeg, Canada

Posted 05 August 2017 - 09:27 PM

I did most of the writing and debugging with a 5DmkII, which beeps quite happily. I only discovered today that my 70D is silent.

I think it's just a feature that's not available on all bodies.



grnbrg.


CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.


Recent Topics






Cloudy Nights LLC
Cloudy Nights Sponsor: Astronomics