forked from CamHD-Analysis/CamHD_motion_metadata
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake_all_timelapses.py
More file actions
executable file
·47 lines (35 loc) · 1.23 KB
/
make_all_timelapses.py
File metadata and controls
executable file
·47 lines (35 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env python3
import subprocess
#scenes = ['d2_p0_z0']
scenes = [ 'd2_p0_z0',
'd2_p1_z0',
'd2_p2_z0',
'd2_p3_z0',
'd2_p4_z0',
'd2_p5_z0',
'd2_p6_z0',
'd2_p7_z0',
'd2_p8_z0' ]
def execute(command):
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, encoding='utf-8')
while True:
output = process.stdout.readline()
if output == '' and process.poll() is not None:
break
if output:
print(output.strip())
rc = process.poll()
return rc
# lines_iterator = iter(popen.stdout.readline, b"")
# while popen.poll() is None:
# for line in lines_iterator:
# nline = line.rstrip()
# print(nline.decode("latin"), end = "\r\n",flush =True) # yield line
for scene in scenes:
print("Downloading images for %s" % scene)
execute(['./retrieve_frames.py', '--scene-tag', scene,
'--log', 'INFO',
'--lazycache-url', "http://localhost:8080/v1/org/oceanobservatories/rawdata/files/"])
execute(['./create_timelapse.py', '--scene-tag', scene,
'--log', 'INFO',
'--prores'])