Long-Exposure Continuous Shooting (for star trails or other uses) - page 2 - Completed and Working Scripts - CHDK Forum  

Long-Exposure Continuous Shooting (for star trails or other uses)

  • 39 Replies
  • 25474 Views
Re: Long-Exposure Continuous Shooting (for star trails or other uses)
« Reply #10 on: 22 / July / 2013, 12:06:40 »
Advertisements
Hmm, well I tried modifying the scrip by inserting the red words...

if(b>9999) then b=b-9999 -- starts from 1 again
set_iso_real( 80 )
set_tv96_direct( expVAL[a] )
press("shoot_full") -- holds shutter down in continuous mode
repeat sleep(10) until get_exp_count()==b
end

It gave no error but simply resulted in a quick
Code: [Select]
***STARTED***
***FINISHED***
and no pictures taken.  Can you tell I know nothing about writing scripts? (But I'm willing to learn.  :) )

*

Offline reyalp

  • ******
  • 14121
Re: Long-Exposure Continuous Shooting (for star trails or other uses)
« Reply #11 on: 22 / July / 2013, 16:46:28 »
...
It gave no error but simply resulted in a quick
Code: [Select]
***STARTED***
***FINISHED***
and no pictures taken.  Can you tell I know nothing about writing scripts? (But I'm willing to learn.  :) )
That script will do nothing if the b is less than 9999, since you've put the entire body inside the if statement.
What you probably want is
Code: [Select]
if(b>9999) then
 b=b-9999
end

You can probably find some beginner Lua tutorials on the web, it's used for many things other than CHDK.
Don't forget what the H stands for.

Re: Long-Exposure Continuous Shooting (for star trails or other uses)
« Reply #12 on: 22 / July / 2013, 18:00:51 »
But reyalp, I had made those changes as mentioned above but it still didn't work.   ???

Should there be spaces in between some of the statements.

Such as:

'if (b>9999)' rather than 'if(b>9999)'

??

Re: Long-Exposure Continuous Shooting (for star trails or other uses)
« Reply #13 on: 22 / July / 2013, 19:31:04 »
I fixed the two syntax errors in the @parameters section.
Code: [Select]
--[[
@title Long-Exposure Continuous Shooting
@param a Exposure Time (Seconds)
@default a 10
@range a 1 60
@param b Number of Shots
@default b 10
@range b 0 9999
]]

--This is an array of TV96 values for exposure times 1-60 seconds.
--It is indexed by the exposure time in seconds.
expVAL = {0, -96, -152, -192, -223, -248, -270, -288, -304, -319, -332, -344, -355, -366, -375, -384, -392, -400, -408, 415, -422, -428, -434, -440, -446, -451, -456, -462, -466, -471, -476, -480, -484, -488, -492, -496, -500, -504, -507, -511, -514, -518, -521, -524, -527, -530, -533, -536, -539, -542, -545, -547, -550, -552, -555, -558, -560, -562, -565, -567}
--This is the main part of the script.
--MUST BE IN CONTINUOUS DRIVE MODE
if(b>0)then
  b=b+get_exp_count()
end
if(b>9999) then b=b-9999 end -- starts from 1 again
print("exp:",expVAL[a])
sleep(2000)
set_iso_real( 80 )
set_tv96_direct( expVAL[a] )
press("shoot_full") -- holds shutter down in continuous mode
repeat sleep(10) until get_exp_count()==b
It mostly works as long as you have the camera set to Continuous shooting mode.   

However, in testing on two different camera models,  I noticed that it sometimes does not set the shutter time correctly.  I get 1/20 of a second rather than 5 seconds for example- the correct exposure was 1/20 so the camera is shooting without the override.. 

If I immediately rerun the script,  it shoots with a 5 second exposure on the second try and every subsequent try.  Changing the shutter time sometimes causes it to shoot at 1/20 the first time and then back to the new time after that. 

Strange.
« Last Edit: 22 / July / 2013, 19:40:04 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline reyalp

  • ******
  • 14121
Re: Long-Exposure Continuous Shooting (for star trails or other uses)
« Reply #14 on: 22 / July / 2013, 21:39:49 »
But reyalp, I had made those changes as mentioned above but it still didn't work.
So, there were even more problems.
Quote
Should there be spaces in between some of the statements.
http://www.lua.org/manual/5.1/

edit to be slightly more helpful:

In general, whitespace doesn't mater in Lua, unless it is necessary to distinguish keyword or variable names
Code: [Select]
if(b>9999)then
if ( b > 9999) then
if b>9999 then
are all equally valid.
Code: [Select]
ifb>9999then
isn't, because it would be trying to compare something called ifb to 9999then (which isn't even a valid name)

If you do something like that, you would generally get an error of some kind rather than the script just not doing anything.
« Last Edit: 22 / July / 2013, 21:58:21 by reyalp »
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 14121
Re: Long-Exposure Continuous Shooting (for star trails or other uses)
« Reply #15 on: 22 / July / 2013, 21:40:49 »
If I immediately rerun the script,  it shoots with a 5 second exposure on the second try and every subsequent try.  Changing the shutter time sometimes causes it to shoot at 1/20 the first time and then back to the new time after that. 
I would expect this has something to do with the fact it doesn't pre-shoot, just does shoot_full immediately.
Don't forget what the H stands for.

Re: Long-Exposure Continuous Shooting (for star trails or other uses)
« Reply #16 on: 22 / July / 2013, 21:56:52 »
I would expect this has something to do with the fact it doesn't pre-shoot, just does shoot_full immediately.
I tried this :
Code: [Select]
press("shoot_half")
repeat sleep(50) until get_shooting() == true
set_iso_real( 80 )
set_tv96_direct( expVAL[a] )
press("shoot_full")
repeat sleep(10) until get_exp_count()==b
release("shoot_full")
release("shoot_half")
but it did not override  the exposure time at all ???
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 14121
Re: Long-Exposure Continuous Shooting (for star trails or other uses)
« Reply #17 on: 22 / July / 2013, 21:59:29 »

but it did not override  the exposure time at all ???
The override functions need to be called before half_shoot.
Don't forget what the H stands for.


Re: Long-Exposure Continuous Shooting (for star trails or other uses)
« Reply #18 on: 22 / July / 2013, 22:16:30 »
The override functions need to be called before half_shoot.
Thanks - I always get confused about that.  Seems like the half_shoot is where the camera decides on the exposure and focus settings,  so you'd want to insert the overrides after that?
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Long-Exposure Continuous Shooting (for star trails or other uses)
« Reply #19 on: 22 / July / 2013, 22:23:12 »
That seems to be better.  First time I ran the script it shot at 1/20 rather than 10 seconds.  But now I can't repeat that.  Might be confounded at this point with whatever philmoz found in the script parameters "bug".
Code: [Select]
--[[
@title Long-Exposure Continuous Shooting
@param a Exposure Time (Seconds)
@default a 10
@range a 1 60
@param b Number of Shots
@default b 10
@range b 0 9999
]]

--This is an array of TV96 values for exposure times 1-60 seconds.
--It is indexed by the exposure time in seconds.
expVAL = {0, -96, -152, -192, -223, -248, -270, -288, -304, -319, -332, -344, -355, -366, -375, -384, -392, -400, -408, 415, -422, -428, -434, -440, -446, -451, -456, -462, -466, -471, -476, -480, -484, -488, -492, -496, -500, -504, -507, -511, -514, -518, -521, -524, -527, -530, -533, -536, -539, -542, -545, -547, -550, -552, -555, -558, -560, -562, -565, -567}
--This is the main part of the script.
--MUST BE IN CONTINUOUS DRIVE MODE
if(b>0)then
  b=b+get_exp_count()
end
if(b>9999) then b=b-9999 end -- starts from 1 again
print("exp:",expVAL[a])
sleep(2000)
set_iso_real( 80 )
set_tv96_direct( expVAL[a] )
press("shoot_half")
repeat sleep(50) until get_shooting() == true
press("shoot_full")
repeat sleep(10) until get_exp_count()==b
release("shoot_full")
release("shoot_half")
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal