Skip to content

Commit

Permalink
Merge pull request #30 from lsst-camera-dh/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
tony-johnson authored Nov 2, 2020
2 parents c2bd195 + 4abe77b commit e2b8854
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 12 deletions.
14 changes: 11 additions & 3 deletions lib/acquire.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,12 @@ def set_filters(self, nd_filter, wl_filter):
bot_bench.setColorFilter(wl_filter)

def take_image(self, exposure, expose_command, image_type=None, symlink_image_type=None):
if self.use_photodiodes and not self.noop:
use_pd = self.use_photodiodes and not self.noop
if use_pd:
pd_readout = PhotodiodeReadout(exposure)
pd_readout.start_accumulation()
image_name, file_list = super(FlatFieldTestCoordinator, self).take_image(exposure, expose_command, image_type, symlink_image_type)
if self.use_photodiodes and not self.noop:
if use_pd:
# TODO: Why does this need the last argument - in fact it is not used?
pd_readout.write_readings(file_list.getCommonParentDirectory().toString(),image_name.toString().split('_')[-1],image_name.toString().split('_')[-2])
return (image_name, file_list)
Expand Down Expand Up @@ -419,6 +420,7 @@ def take_images(self):
readRows = fp.fp.getSequencerParameter("ReadRows")
postRows = fp.fp.getSequencerParameter("PostRows")
scanMode = fp.fp.isScanEnabled()
idleFlushTimeout = fp.fp.getSequencerParameter("idleFlushTimeout")
print "Initial sequencer parameters"

print "preCols=" , preCols
Expand All @@ -431,6 +433,7 @@ def take_images(self):
print "postRows=" , postRows

print "scanMode=" , scanMode
print "idleFlushTimeout=" , idleFlushTimeout

# set up scan mode
fp.fp.sequencerConfig().submitChanges(
Expand All @@ -444,10 +447,13 @@ def take_images(self):
"readRows": self.readrows,
"postRows": self.postrows,
"overRows": self.overrows,
"scanMode": True
"scanMode": True,
"idleFlushTimeout": -1
}
)
fp.fp.commitBulkChange()
if idleFlushTimeout != -1:
fp.clear()

exposure = 1.0
expose_command = lambda: time.sleep(exposure)
Expand All @@ -470,6 +476,8 @@ def take_images(self):
# Restore settings
fp.fp.dropAllChanges()

if idleFlushTimeout != -1:
fp.clear()

def do_bias(options):
print "bias called %s" % options
Expand Down
29 changes: 20 additions & 9 deletions lib/bot_bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import time

bb = CCS.attachProxy("bot-bench")
MAX_EXPOSURE = 999.0

def sanityCheck():
state = bb.getState()
Expand All @@ -32,15 +33,25 @@ def setSpotFilter(filter):
def openShutter(exposure):
sanityCheck()
print "Open shutter for %s seconds" % exposure
print "Actual open time to tell the shutter is %d mili seconds" % int(1000*exposure*(1.-5/800.))
a=time.time()
bb.ProjectorShutter().exposure(Duration.ofMillis(int(1000*exposure*(1.-5/800.))))
b=time.time()
time.sleep(0.03*exposure)
c=time.time()
bb.ProjectorShutter().waitForClosed()
d=time.time()
print ("{} sec for open exposure, {} sec for a sleeping, {} sec for waitForClosed".format(b-a, c-b, d-c))
if exposure<=MAX_EXPOSURE:
print "Actual open time to tell the shutter is %d mili seconds" % int(1000*exposure*(1.-5/800.))
a=time.time()
bb.ProjectorShutter().exposure(Duration.ofMillis(int(1000*exposure*(1.-5/800.))))
b=time.time()
time.sleep(0.03*exposure)
c=time.time()
bb.ProjectorShutter().waitForClosed()
d=time.time()
print ("{} sec for open exposure, {} sec for a sleeping, {} sec for waitForClosed".format(b-a, c-b, d-c))
else:
a=time.time()
bb.ProjectorShutter().openShutter()
b=time.time()
time.sleep(exposure)
c=time.time()
bb.ProjectorShutter().closeShutter()
d=time.time()
print ("{} sec for manual exposure, {} sec for close, {} total elapsed".format(exposure, d-c, d-a))
print "Shutter closed"

def openFe55Shutter(exposure):
Expand Down

0 comments on commit e2b8854

Please sign in to comment.