--[[
@title MLapser
@param d Shots per Dark Frame
@default d 50
--]]
-- close mechanical shutter
function closeshutter()
if (call_event_proc(closeproc) == -1) then
print("closeshutter failed")
end
end
-- open mechanical shutter
function openshutter()
if (call_event_proc(openproc) == -1) then
print("openshutter failed")
end
end
--print_screen(1)
if (type(call_event_proc) ~= "function" ) then
error("your CHDK does not support native calls")
end
bi=get_buildinfo()
if bi.os=="vxworks" then
closeproc="CloseMShutter"
openproc="OpenMShutter"
if (call_event_proc("InitializeAdjustmentFunction") == -1) then
error("InitAdjFunc failed")
end
elseif bi.os=="dryos" then
closeproc="CloseMechaShutter"
openproc="OpenMechaShutter"
if (call_event_proc("Mecha.Create") == -1) then
error("Mecha.Create failed")
end
else
error("Unknown OS:" .. bi.os)
end
npic=0
press("shoot_half")
while(not get_shooting())do sleep(100) end
repeat
dark=(npic%d==0)
npic=npic+1
print(npic,dark)
if(dark)then
closeshutter()
end
ecnt=get_exp_count()
press("shoot_full_only")
repeat
sleep(20)
until(get_exp_count()~=ecnt)
release("shoot_full_only")
if(dark)then
openshutter()
end
sleep(10)
until false
Here's my script for shooting the meteor shower, with automatic dark frames, derived from the fudgey script. I used the native call compiled version that blackhole provided (thanks again!)
The G1X has full manual control, but you can also set up any camera with the CHDK Enhanced Photo Operations from the main menu. You need to set ISO, shutter speed, aperture (widest for night shots), and focus. If you don't, the script uses the automatic values from the first picture. That may or may not work the way you want. It's best to take some test pictures until you see what you want, and then use those values. I'm thinking of trying 60 second shutter speed and ISO 100 to start, and adjust from there. Also, be sure to turn off dark frames in the RAW menu. The G1X has native RAW, so I don't need to use the CHDK version raw, except to turn off auto dark frames.
I used the "shoot_full_only" button for each shot, which holds exposure and focus between shots. It also saves about 1 second of the delay between shots since it doesn't measure the brightness each time. get_shooting() is always true this way, so the only way I could figure out how to tell when the picture is done was to wait for the exposure count to change. It seems to work.
--[[
@title ShLapser
--]]
press("shoot_half")
while(not get_shooting())do sleep(100) end
repeat
ecnt=get_exp_count()
press("shoot_full_only")
repeat
sleep(20)
until(get_exp_count()~=ecnt)
release("shoot_full_only")
sleep(10)
until false
If you just want to shoot as fast as possible so you won't miss any meteors, without worrying about automatic dark frames, or native calls, try the above script. You can shoot a dark frame at the beginning and end manually, with the lens cap on or lens covered somehow.