Commit d7ad5f88 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

minor change in shebang

parent ae1964a1
#!/usr/bin/python #!/usr/bin/env python
from __future__ import division from __future__ import division
from __future__ import print_function from __future__ import print_function
''' '''
# Copyright (C) 2015, Elphel.inc. # Copyright (C) 2015, Elphel.inc.
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
...@@ -95,11 +95,11 @@ if ((not acquisition_parameters["bayer"] is None) and ...@@ -95,11 +95,11 @@ if ((not acquisition_parameters["bayer"] is None) and
ibayer ^= 1 ibayer ^= 1
if int (acquisition_parameters["flip_y"]): if int (acquisition_parameters["flip_y"]):
ibayer ^= 2 ibayer ^= 2
acquisition_parameters["bayer"] = str(ibayer) acquisition_parameters["bayer"] = str(ibayer)
#restart compressor #restart compressor
communicate(PORT, "compressor_control all 1 None None None None None") communicate(PORT, "compressor_control all 1 None None None None None")
cmd_str = "jpeg_acquire_write %s %s %s %s %s %s %s %s %s %s %s %s %s"%( cmd_str = "jpeg_acquire_write %s %s %s %s %s %s %s %s %s %s %s %s %s"%(
str(acquisition_parameters["file_path"]), str(acquisition_parameters["file_path"]),
str(acquisition_parameters["channel"]), str(acquisition_parameters["channel"]),
...@@ -117,7 +117,7 @@ cmd_str = "jpeg_acquire_write %s %s %s %s %s %s %s %s %s %s %s %s %s"%( ...@@ -117,7 +117,7 @@ cmd_str = "jpeg_acquire_write %s %s %s %s %s %s %s %s %s %s %s %s %s"%(
gains_exp_changed = False gains_exp_changed = False
geometry_changed = False geometry_changed = False
#change gains/exposure if needed #change gains/exposure if needed
if ((not acquisition_parameters["gain_r"] is None) or if ((not acquisition_parameters["gain_r"] is None) or
(not acquisition_parameters["gain_gr"] is None) or (not acquisition_parameters["gain_gr"] is None) or
(not acquisition_parameters["gain_gb"] is None) or (not acquisition_parameters["gain_gb"] is None) or
(not acquisition_parameters["gain_b"] is None) or (not acquisition_parameters["gain_b"] is None) or
...@@ -134,7 +134,7 @@ if ((not acquisition_parameters["gain_r"] is None) or ...@@ -134,7 +134,7 @@ if ((not acquisition_parameters["gain_r"] is None) or
communicate(PORT, gstr) communicate(PORT, gstr)
#change flips if needed #change flips if needed
if ((not acquisition_parameters["flip_x"] is None) or if ((not acquisition_parameters["flip_x"] is None) or
(not acquisition_parameters["flip_yr"] is None)): (not acquisition_parameters["flip_yr"] is None)):
geometry_changed = True geometry_changed = True
fstr = "set_sensor_flipXY %s %s %s %s"%( fstr = "set_sensor_flipXY %s %s %s %s"%(
...@@ -143,7 +143,7 @@ if ((not acquisition_parameters["flip_x"] is None) or ...@@ -143,7 +143,7 @@ if ((not acquisition_parameters["flip_x"] is None) or
str(acquisition_parameters["flip_y"]), str(acquisition_parameters["flip_y"]),
str(acquisition_parameters["verbose"])) str(acquisition_parameters["verbose"]))
communicate(PORT, fstr) communicate(PORT, fstr)
#How many bad/non modified frames are to be skipped (just a guess) #How many bad/non modified frames are to be skipped (just a guess)
skip_frames = 0 skip_frames = 0
if geometry_changed: if geometry_changed:
skip_frames = 2 skip_frames = 2
...@@ -153,10 +153,10 @@ if (str(acquisition_parameters["channel"])[0].upper() == 'A'): ...@@ -153,10 +153,10 @@ if (str(acquisition_parameters["channel"])[0].upper() == 'A'):
channel_mask = 0x0f channel_mask = 0x0f
else: else:
channel_mask = 1 << int(acquisition_parameters["channel"]) channel_mask = 1 << int(acquisition_parameters["channel"])
skip_str= "skip_frame %d"%(channel_mask) skip_str= "skip_frame %d"%(channel_mask)
for i in range(skip_frames): for i in range(skip_frames):
communicate(PORT, skip_str) communicate(PORT, skip_str)
# Now - get that image # Now - get that image
reply = communicate(PORT,cmd_str) reply = communicate(PORT,cmd_str)
if (acquisition_parameters["cmode"] =="5"): if (acquisition_parameters["cmode"] =="5"):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment