Exposure bracketing time lapse (not HDR) question. - Script Writing - CHDK Forum

Exposure bracketing time lapse (not HDR) question.

  • 15 Replies
  • 6658 Views
Exposure bracketing time lapse (not HDR) question.
« on: 21 / July / 2008, 12:38:54 »
Advertisements
Hello again,

I'm planning of making some light intensity measurements of the upcoming partial solar eclipse. Besides using a photodiode for actual measurements, I'd like to take a digital photo sequence with constant exposure settings to discover the drop in the intensity.

Any ideas how to get started in writing this kind of script? I want the script to bracket the shutter speed for 3 or 5 shots, wait for a specified time and bracket again etc, not to bracket the exposures from single raw files.

I think scripts like this might already exist?

*

Offline wontolla

  • ****
  • 413
  • S3 & G9 & A720
Re: Exposure bracketing time lapse (not HDR) question.
« Reply #1 on: 21 / July / 2008, 19:04:03 »
I don't know if the term "bracketing" can be used when "constant" exposure/shutterSpeed is desired, but is not important.
What you want is a number of shots every couple of minutes, right?

From the top of my head (and the basic interval script from the wiki):

Code: (c) [Select]
@title Interval Eclipse
@param a Shoot count
@default a 5
@param b Interval (Minutes)
@default b 1
@param c Interval (Seconds)
@default c 30

t=b*60000+c*1000
if t<1000 then let t=1000

print "Time between shots:", t*a/60000; "min", t*a%60000/1000; "sec"

sleep 1000

:repete
for n=1 to a
    print "Shoot", n, "of", a
    shoot
    sleep 1000
next n

sleep t
goto "repete"

end

It should work, although I didn't test it. (Default: It will take 5 shots every 1.5 minutes until manually cancelled).

BTW, I've heard that exposing the camera's sensor to direct sun light can damage it. Not to mention you should be careful with your own eyes when dealing with eclipses too!

*

Offline fbonomi

  • ****
  • 469
  • A570IS SD1100/Ixus80
    • Francesco Bonomi
Re: Exposure bracketing time lapse (not HDR) question.
« Reply #2 on: 22 / July / 2008, 06:08:33 »
that's an eclipse I surely won't get in Italy :-)

vostok, I don't exactly understand what you want to obtain:


1) a video showing the day getting darker and then brighter again
2) a graph of luminositygoing down and up
3) what else???


1) a video showing the day getting darker and then brighter again
I don't kow where you are located, but if you are not near totality (and you don't see a very strong eclipse) this can be VERY difficoult, as other factors will change luminosity more than the eclipse.

I mean, if you have a 30% eclipse starting at 8:00 in the morning and ending at 10:00, you have two main factors changing luminosity:
- the day that progresses, with the sun rising over the horizon
- the eclipse
Which one is stronger??

anyway, if this is what you want to obtain I would do the following:

- before the eclipse starts, shoot a test frame. See what exposition data the camera used (for example, f/4 1/100s)
- put the camera in manual mode, set those values (f/4 1/100s) manually. The camera will now shoot always with those values.
- use the basic intervalometer script, and just tell the camera to shoot one shot every X seconds. The frames will all be exposed identically, and you hopefully should have your result.

The risk is that if for example you start at 8 in the morning, at 10 in the morning everything will be over-exposed.

You could then be more ambitious and do (for example) 5 movies each one with a different exposure.

The idea is to use custom auto-timer mode (a standard feature of your camera, probably) and say to your camera to always take 5 shots. Then, use "bracketing in continuous mode" (a CHDK feature) saying for example to bracket 2 EV.

In this mode, every time you take a shot your camera will take 5 shots with a wide range of exposures: 0, +2EV, -2EV, +4EV, -4EV.

then, follow the steps I said before and you will have a LOT of pictures, that are divided in 5 series with different exposures:

0001 0EV
0002 +2EV
0003 -2EV
0004 +4EV
0005 -4 EV

0006 0EV
0007 +2EV
0008 -2EV
0009 +4EV
00010 -4 EV

0011 0EV
0012 +2EV
....

if you only use the frames 0001, 0006, 0011 etc (only frames ending in 1 or 6) you have the "standard movie"

If that movie is overexposed, you can use frames 0003, 0008, 0013 etc (only frames ending in 3 and 8 ) to get a darker movie (-2EV)

Using frames 0005, 0010, 0015 etc (only frames ending in 5 and 10) to get an even darker movie (-4EV)

Hopefully, one of these movies will work well!

(Remember to test in advance so that you have enough card space and battery duration!)

2) a graph of the luminosity
In this case, my bv_log script measures luminance every about 10 seconds, and (just for reference) shoots a picture every about 10 minutes:
Code: [Select]
@title Brightness log

rem brightness log
rem reads brightness information every 10 seconds and logs it to pr_screen.txt
rem Plus, shoots a photo every 10 minutes
rem please run with following settings
rem MODE: AUTO
rem flash: off
rem Image size: S (the smallest)

print_screen 1

print "Start Brightness Log"

rem loop counter
p=0

:loop

press "shoot_half"
sleep 1000
get_bv96 B
get_sv96 S
get_av96 A
get_tv96 T
release "shoot_half"
print p,B,S,A,T

if (p%60=0) then shoot

p=p+1

sleep 9000

goto "loop"

If you need more exact timing the script can be changed to be absolutely exact in timing (as long as the camera clock is exact)

This script collects data in a text file called PR_SCREEN.TXT and then you can graph this data easily (for example in excel), obtaining something like this graph:

« Last Edit: 22 / July / 2008, 06:10:56 by fbonomi »

Re: Exposure bracketing time lapse (not HDR) question.
« Reply #3 on: 29 / July / 2008, 03:15:34 »
Thanks for the thorough explanation! I'm aware of the magnitudes of the dips of intensity of light during this eclipse, and that's exactly why I was looking for something more than a normal time lapse. However there's only a 1EV drop here in Finland, and luckily the eclipse takes place around noon.

You could then be more ambitious and do (for example) 5 movies each one with a different exposure.

I may not have asked my question very clearly, but that was exactly what I was after. I was planning to draw the light curve afterwards in e.g. Matlab by calculating averages of the images, but the possibility of measuring luminance in-camera sounds interesting. So thank you for the tips, I'll now try to get this stuff working before friday!


*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Exposure bracketing time lapse (not HDR) question.
« Reply #4 on: 29 / July / 2008, 03:58:03 »
To answer to the original question, wound't any time lapse / intervalometer script be able to do this if you set the Canon custom timer mode to shoot a 5 images and CHDK continuous mode bracketing to alter exposure for each shot.

Re: Exposure bracketing time lapse (not HDR) question.
« Reply #5 on: 29 / July / 2008, 04:01:20 »
Ok so a couple of immediate questions arise.. :)

The idea is to use custom auto-timer mode (a standard feature of your camera, probably) and say to your camera to always take 5 shots. Then, use "bracketing in continuous mode" (a CHDK feature) saying for example to bracket 2 EV.

If you mean to use the cameras built-in timelapse function, that's not versatile enough. In my A620, I think, only sequences of 10 frames can be taken, and the interval set between 0 and 30 seconds. That's why I'm looking for a script.

Also, how does the bracketing in continuous mode work? Does it take 5 photos with different settings, or just process one RAW file in 5 different ways? The latter is not what I'm after. What I'm looking for in some pseudo-like code is:

Code: [Select]
every n seconds do
  take shot
  take -1ev shot
  take +1ev shot
end

with the 1ev variations done preferrably by changing the shutter speed in (for example) 1ev increments.

--

Something about the brightness log code as well. I think I understand what's going on with the print screen stuff, but what are the values B,S,A,T collected in the file? How does one implement exact time stamping for the code? Is there a way just to print a time stamp from the camera clock, instead of the p index?


Re: Exposure bracketing time lapse (not HDR) question.
« Reply #6 on: 29 / July / 2008, 04:10:14 »
To answer to the original question, wound't any time lapse / intervalometer script be able to do this if you set the Canon custom timer mode to shoot a 5 images and CHDK continuous mode bracketing to alter exposure for each shot.

That's what I was wondering in my previous reply I wrote while you posted. Does the bracketing mode work in the way I want, ie. take several Tv-bracketed shots with just a single shutter button press?

If it does, can that be combined with fbonomi's brightness measuring script? I seem to need another camera. :)

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Exposure bracketing time lapse (not HDR) question.
« Reply #7 on: 29 / July / 2008, 05:15:04 »
That's what I was wondering in my previous reply I wrote while you posted. Does the bracketing mode work in the way I want, ie. take several Tv-bracketed shots with just a single shutter button press?

It does take more than 1 shot with single shutter press, if your camera does that (even) without CHDK. And CHDK overrides really do change the exposure settings for each shot, even for custom timer. If in doubt, see exif MakerNotes section in the jpegs; the camera stores the actual exposure settings there (the "standard" exif tag show false values when using CHDK overrides).

If it does, can that be combined with fbonomi's brightness measuring script? I seem to need another camera. :)

I think he probably already ment that. His post was kind of long so I didn't read it thorougly and failed to notice he already suggested doing it this way. So I'm assuming the script already works with it. It logs the measurement info to a text file AND shoots. And if you set CHDK overrides and Canon custom timer properly, you get bracketed shots.


Re: Exposure bracketing time lapse (not HDR) question.
« Reply #8 on: 29 / July / 2008, 06:01:05 »
It does take more than 1 shot with single shutter press, if your camera does that (even) without CHDK. And CHDK overrides really do change the exposure settings for each shot, even for custom timer. If in doubt, see exif MakerNotes section in the jpegs; the camera stores the actual exposure settings there (the "standard" exif tag show false values when using CHDK overrides).

If it does, can that be combined with fbonomi's brightness measuring script? I seem to need another camera. :)

I think he probably already ment that. His post was kind of long so I didn't read it thorougly and failed to notice he already suggested doing it this way. So I'm assuming the script already works with it. It logs the measurement info to a text file AND shoots. And if you set CHDK overrides and Canon custom timer properly, you get bracketed shots.


Getting a bit confused, I haven't tested the Canon custom timer and don't have my camera at hand (having it here would probably answer my questions). Do you mean I would have to set the Canon built-in timer to e.g. 3 shots with 0 second intervals and configure CHDK's bracketing options to get several bracketed frames with the script only emulating the button press once? The script says it should be run in AUTO-mode, is this valid for my case?

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Exposure bracketing time lapse (not HDR) question.
« Reply #9 on: 29 / July / 2008, 07:27:54 »
Getting a bit confused, I haven't tested the Canon custom timer and don't have my camera at hand (having it here would probably answer my questions). Do you mean I would have to set the Canon built-in timer to e.g. 3 shots with 0 second intervals and configure CHDK's bracketing options to get several bracketed frames with the script only emulating the button press once?

Yes. The script "shoot" command behaves pretty much as if it was yourself pressing and releasing the shutter, therefore the custom timer and bracketing kick in as well if enabled.

The script says it should be run in AUTO-mode, is this valid for my case?

Yes, that's the mode dial position. Remember to disable flash, though. I'd use P with auto ISO and custom white balance to better compare the shots (unless you are going to ditch the JPEGs and only use RAWs, in that case WB doesn't matter at all).

Note that the script will not give you a constant sampling rate since it just sleeps a constant time after shooting, and the shooting takes a variable time. You'll have to either fix the script to use get_tick_count for the delay (like some "accurate" intervalometer scripts do) or dig the datestamps out of jpeg filenames or exif tags and plot xy.

 

Related Topics