Skip to content

Commit

Permalink
Merge pull request #25 from lsst-camera-dh/LSSTTD-1485
Browse files Browse the repository at this point in the history
Lssttd 1485
  • Loading branch information
youtsumi authored Sep 3, 2020
2 parents 866253d + d30a4d4 commit 0edadf1
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
13 changes: 13 additions & 0 deletions examples/persistence.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[ACQUIRE]
persistence

[PERSISTENCE]
ANNOTATION=Just half
LOCATIONS=R02,R03,R04,R12,R13,R14,R22,R23,R24,R32,R33,R34,R42,R43,R44
BCOUNT= 3 # number of bias frames per persistence set
WL= SDSSi # wavelength filter
ND= empty
PERSISTENCE= 4000 5 0.0 0.0 # signal(e-), number of darks after flat, exposure time, time(sec) between darks
FILTERCONFIG = /gpfs/slac/lsst/fs2/u1/devel/ccs/bot-eotest-configs/Run4/filter.cfg


34 changes: 32 additions & 2 deletions lib/acquire.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,35 @@ def take_images(self):
self.set_filters(nd_filter, wl_filter)
self.take_bias_plus_image(exposure, expose_command, symlink_image_type='flat_%s_%s' % (wl_filter, e_per_pixel))

class PersistenceTestCoordinator(FlatFieldTestCoordinator):
''' A TestCoordinator for all tests that involve taking persitence with the flat field generator '''
def __init__(self, options):
super(PersistenceTestCoordinator, self).__init__(options, "BOT_PERSISTENCE", "FLAT")
self.bcount = options.getInt('bcount', 10)
self.wl_filter = options.get('wl')
self.nd_filter= options.get('nd')
self.persistence= options.getList('persistence')

def take_images(self):
e_per_pixel, n_of_dark, exp_of_dark, t_btw_darks= self.persistence[0].split()
e_per_pixel = float(e_per_pixel)
exposure = self.compute_exposure_time(self.nd_filter, self.wl_filter, e_per_pixel)
self.set_filters(self.nd_filter, self.wl_filter)

# bias acquisitions
self.take_bias_images(self.bcount)

# dark acquisition
expose_command = lambda: bot_bench.openShutter(exposure)
image_name, file_list = super(PersistenceTestCoordinator, self).take_image(exposure, expose_command, "FLAT", symlink_image_type='flat_%s'% (self.wl_filter))

# dark acquisition
self.use_photodiodes = False
for i in range(int(n_of_dark)):
time.sleep(float(t_btw_darks))
super(PersistenceTestCoordinator, self).take_image(float(exp_of_dark), lambda: time.sleep(float(exp_of_dark)), image_type="DARK")
return (image_name, file_list)

class Fe55TestCoordinator(FlatFieldTestCoordinator):
def __init__(self, options):
super(Fe55TestCoordinator, self).__init__(options, 'FE55_FLAT', 'FE55')
Expand Down Expand Up @@ -443,8 +472,9 @@ def do_fe55(options):
tc.take_images()

def do_persistence(options):
#TODO: Implement this
print "persistence called %s" % options
print "Persistence called %s" % options
tc = PersistenceTestCoordinator(options)
tc.take_images()

def do_sflat(options):
print "superflat called %s" % options
Expand Down

0 comments on commit 0edadf1

Please sign in to comment.