hook_shoot.set(10000)hook_raw.set(10000)
set_tv96_direct(tv)
press('shoot_half')repeat sleep(10) until get_shooting() == true
if cont then press'shoot_full_only'end
for shot=1,ui_shots do
if not cont then press('shoot_full_only') end
hook_shoot.wait_ready()
if ui_darks then close_shutter() end
if not cont then release('shoot_full_only') end
sleep(interval - et)
hook_shoot.continue()
hook_raw.wait_ready() set_tv96_direct(tv) hook_raw.continue()
end
hook_shoot.set(10000)
hook_raw.set(10000)
press('shoot_full_only')
if dark_frame then close_shutter()
release('shoot_full_only')
Code: [Select]hook_shoot.wait_ready()-Here we wait until just before the shutter opens *I'm going to say 'before the electronic shutter opens' which means before the pixels are reset (discharged to 0v) in preparation for accumulating charge from light
Code: [Select]if ui_darks then close_shutter() end-If you want to shoot a dark frame, close the mechanical shutter at this point. This only makes sense if it means to close the mechanical shutter, before opening the electronic shutter. It also implies that normally, the mechanical shutter is open at this point, which then implies that the sensor is reset globally and immediately, so there's no rolling shutter problem here.
-Start to end the shot. Normally the exposure would finish and save automatically at this point, however:Code: [Select]sleep(interval - et)-Manually wait as part of the Tv. This delay would be in addition to the Tv value set before the shot.
Code: [Select]hook_shoot.continue()-Finish the shot.
Code: [Select]hook_raw.wait_ready() set_tv96_direct(tv) hook_raw.continue()-Stop just before saving the pic, set the Tv, then finish saving the pic. I believe the purpose of this is because of the sequence of the loop; to prepare the Tv for the *next* shot (the first first shot's Tv was set before the loop). However if that's the case, I don't see why set_tv isn't at the very end.
Code: [Select]hook_shoot.set(10000)-you need this to enable the shooting hook, to have control over exposure time
-you need this to enable the raw (saving) hook, it seems the only purpose is to set the Tv for the next shot (so this is optional)
Code: [Select]press('shoot_half')repeat sleep(10) until get_shooting() == true-let the camera set other values, based on Tv time (must be in 'P' mode)
-The mecha shutter is open, a pic is taken with electronic shutter, then the pic is analyzed to adjust exposure
Code: [Select] press('shoot_full_only') --Press the shoot button. Doesn't start accumulating light yet, due to shoot hook enabled.
--- only for dark frames ---Code: [Select] hook_shoot.wait_ready() -wait until just before the electronic shutter opens. You only need this for dark frames.
Code: [Select] release('shoot_full_only') -Not sure why this has to go here, it seems you could release the button at any convenient time?
-Electronically reset the pixels and start accumulating light, wait for TvCode: [Select] sleep(interval - et) -add in additional Tv hereCode: [Select] hook_shoot.continue() -close the mecha shutter, then start the pixel readout (close the electronic shutter)
Questions:-Do I need hook_shoot.wait_ready() if I'm not taking a dark frame?
-Does the mecha shutter have to be closed in the hook? I have my own script where it seems I can close the shutter before press("shoot_full")
-Is set_tv only in the raw hook, because that's the only way to change it during continuous mode?
-Does release('shoot_full_only') actually open the electronic shutter, even though it doesn't seem to make sense?
-Does there seem any way to do a double exposure? Being able to open/close the mecha shutter while the electronic shutter is open would be great, or flashing twice while shutter is open.
Thanks so much for a complete and clear answer. When I can get to this, I'd like to test out what I've learned and then write an article on the wiki, plus take some cool double exposure pics.
A few other investigations come to mind, like measuring the speed of script,
calibrating Tv against tick(),
--[[@chdk_version 1.4.0--]]--test Tv timingfunction init() require'hookutil'--import hook utils hook_shoot.set(10000)--enable hooks hook_raw.set(10000)endfunction time_shot(tv_direct,dark_sub) set_raw_nr(dark_sub)--enable or disable dark frame subtraction, which doubles time over 2sec set_tv96_direct(tv_direct)--set the time as a tv direct value, where 0=1sec press('shoot_half')--do preshot and wait until shooting settings are ready repeat sleep(10) until get_shooting() == true press('shoot_full_only') hook_shoot.wait_ready() release('shoot_full_only')--convenient place to put this t0=get_tick_count()--start timer just before shot hook_shoot.continue()--exposure starts here hook_raw.wait_ready() t1=get_tick_count() hook_raw.continue() return t0,t1end--attempt to find shutter time relative to ticks, and overheadoff=1on=2--set two different times here, which vary by --orders of magnitude more than 10 millisecondstv_sec_1=16--short shot time in secondstv_sec_2=32--long shot time in secondstv96_1=usec_to_tv96(tv_sec_1*1000000)tv96_2=usec_to_tv96(tv_sec_2*1000000)init()--prepare hooksmeasured_start_1,measured_end_1=time_shot(0,off)--dummy shot due to weird bugmeasured_start_1,measured_end_1=time_shot(tv96_1,off)--short shotmeasured_start_3,measured_end_3=time_shot(tv96_1,on)--shoot short with dark submeasured_start_2,measured_end_2=time_shot(tv96_2,off)--long shotprint("Measured timings")print(measured_start_1,measured_end_1)print(measured_start_2,measured_end_2)print(measured_start_3,measured_end_3)
Started by Aket « 1 2 ... 21 22 » Feature Requests
Started by Mushin General Chat
Started by CanonCOMPACT Feature Requests
Started by boboche General Help and Assistance on using CHDK stable releases
Started by FREE Spirit « 1 2 » Feature Requests