From 9c47686db810f7a3cfecec65b8f8f1ef639fc402 Mon Sep 17 00:00:00 2001 From: snyder18 Date: Mon, 30 Jul 2018 11:13:38 -0700 Subject: [PATCH 1/2] Made modifications to the xy stage acq to acquire dark frames automatically for each position. Minor addition to eo_acquisition for ease of dark frame acquisitions. --- harnessed_jobs/xy_stage_acq/v0/ccs_xy_stage_acq.py | 5 ++++- python/eo_acquisition.py | 10 ++++++++++ python/xy_stage_acquisition.py | 2 ++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/harnessed_jobs/xy_stage_acq/v0/ccs_xy_stage_acq.py b/harnessed_jobs/xy_stage_acq/v0/ccs_xy_stage_acq.py index 524b78f..677f83e 100644 --- a/harnessed_jobs/xy_stage_acq/v0/ccs_xy_stage_acq.py +++ b/harnessed_jobs/xy_stage_acq/v0/ccs_xy_stage_acq.py @@ -25,7 +25,7 @@ def run(self): self.bcount. """ # Move to initial (xoffset, yoffset) position. - self._moveTo(self.xoffset, self.yoffset) + self._moveTo(self.xoffset, self.yoffset) # Loop over image sequence. actuateXed = False @@ -50,6 +50,9 @@ def run(self): for i in range(self.imcount): self.take_image(seqno, exptime, openShutter, actuateXed, image_type, file_template=file_template) + # Take dark frame(s) + for i in range(self.dcount): + self.dark_image(seqno, exptime) # Take bias frame(s). for i in range(self.bcount): self.bias_image(seqno) diff --git a/python/eo_acquisition.py b/python/eo_acquisition.py index 51c5059..c4ff243 100644 --- a/python/eo_acquisition.py +++ b/python/eo_acquisition.py @@ -359,6 +359,16 @@ def bias_image(self, seqno, max_tries=3): self.take_image(seqno, exptime, openShutter, actuateXed, "BIAS", timeout=150, max_tries=max_tries) + def dark_image(self, seqno, exptime, max_tries=3): + """ + Take dark image + """ + openShutter = False + actuateXed = False + timeout = int(max(150, exptime + 20)) + self.take_image(seqno, exptime, openShutter, actuateXed, "DARK", + timeout=timeout, max_tries=max_tries) + def measured_flux(self, wl, seqno=0, fluxcal_time=2.): """ Compute the measured flux by taking an exposure at the diff --git a/python/xy_stage_acquisition.py b/python/xy_stage_acquisition.py index f18254f..2a02d9d 100644 --- a/python/xy_stage_acquisition.py +++ b/python/xy_stage_acquisition.py @@ -22,6 +22,8 @@ def __init__(self, seqfile, acq_config_file, acqname, metadata, self.bcount = int(self.eo_config.get('%s_BCOUNT' % acqname.upper(), default=1)) + self.dcount = int(self.eo_config.get('%s_DCOUNT' % acqname.upper(), + default=0)) self.imcount = int(self.eo_config.get('%s_IMCOUNT' % acqname.upper(), default=1)) self.xoffset = float(self.eo_config.get('%s_XOFFSET' % acqname.upper(), From c5fff4b78e9b1fdba9c2399aa16a2df8e7fc6e8b Mon Sep 17 00:00:00 2001 From: snyder18 Date: Wed, 1 Aug 2018 10:29:54 -0700 Subject: [PATCH 2/2] Made requested changes to whitespace. --- harnessed_jobs/xy_stage_acq/v0/ccs_xy_stage_acq.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/harnessed_jobs/xy_stage_acq/v0/ccs_xy_stage_acq.py b/harnessed_jobs/xy_stage_acq/v0/ccs_xy_stage_acq.py index 677f83e..514a7ca 100644 --- a/harnessed_jobs/xy_stage_acq/v0/ccs_xy_stage_acq.py +++ b/harnessed_jobs/xy_stage_acq/v0/ccs_xy_stage_acq.py @@ -25,7 +25,7 @@ def run(self): self.bcount. """ # Move to initial (xoffset, yoffset) position. - self._moveTo(self.xoffset, self.yoffset) + self._moveTo(self.xoffset, self.yoffset) # Loop over image sequence. actuateXed = False