Re: Help for Scripting my AVI camera
Posted: Fri Apr 21, 2017 4:30 am
Hi Robin,
I am almost done with the entire 2017 Solar Eclipse program but I can not get the code you sent to work regarding the time/delay per the clock.
I get an error on line 5..... AttributeError: 'module' object has no attribute 'now' .
Also saw an error with datetime.combine ......AttributeError: 'module' object has no attribute 'combine'
I am probably doing something wrong with the code below you sent because I am just learning all of this. Can you steer me the right direction to get it to work? I typed it in exactly as you have it but changed the time in line 6 to be future by a couple minutes to see if the time.sleep delay works but it crashes early on in the code.
My goal was to have delay code in the beginning to wait until a certain clock time (11:59:30 AM) to execute my first Capture. Other places in the program I will need delay code for certain clock times as well. (3 places)
When I get this delay until clock is at time ##:##:## part working I will have the entire program finished for capturing the 2017 Solar Eclipse on August 21st using my 9MP Hi-Res camera. I will be sitting on the center line in western Tennessee recording the whole 3 hrs in 3 minute increments, 15 sec AVI's at high resolution HA with my Lunt Telescope. I will gladly share this program on here for all that could use it. It would only need slight modifications in times depending on where you are during the eclipse.
I will be making a complete movie from all my captured AVI frames after stacking and tweaking. It will be in Hi_Res color as well with tremendous surface detail and any prominence's and flares during the eclipse.
Thanks again, I look forward to hearing from you.
Dave
import datetime
import time
from datetime import date, time
now = datetime.now()
# Calculate the datetime representing 22:30 today -
later = datetime.combine(date.today(), time(22,30))
delay=(later-now).total_seconds()
time.sleep(delay)
I am almost done with the entire 2017 Solar Eclipse program but I can not get the code you sent to work regarding the time/delay per the clock.
I get an error on line 5..... AttributeError: 'module' object has no attribute 'now' .
Also saw an error with datetime.combine ......AttributeError: 'module' object has no attribute 'combine'
I am probably doing something wrong with the code below you sent because I am just learning all of this. Can you steer me the right direction to get it to work? I typed it in exactly as you have it but changed the time in line 6 to be future by a couple minutes to see if the time.sleep delay works but it crashes early on in the code.
My goal was to have delay code in the beginning to wait until a certain clock time (11:59:30 AM) to execute my first Capture. Other places in the program I will need delay code for certain clock times as well. (3 places)
When I get this delay until clock is at time ##:##:## part working I will have the entire program finished for capturing the 2017 Solar Eclipse on August 21st using my 9MP Hi-Res camera. I will be sitting on the center line in western Tennessee recording the whole 3 hrs in 3 minute increments, 15 sec AVI's at high resolution HA with my Lunt Telescope. I will gladly share this program on here for all that could use it. It would only need slight modifications in times depending on where you are during the eclipse.
I will be making a complete movie from all my captured AVI frames after stacking and tweaking. It will be in Hi_Res color as well with tremendous surface detail and any prominence's and flares during the eclipse.
Thanks again, I look forward to hearing from you.
Dave
import datetime
import time
from datetime import date, time
now = datetime.now()
# Calculate the datetime representing 22:30 today -
later = datetime.combine(date.today(), time(22,30))
delay=(later-now).total_seconds()
time.sleep(delay)