Skip to content

Commit

Permalink
Merge pull request #11 from lsst-camera-dh/LSSTTD-984_ts8_acq
Browse files Browse the repository at this point in the history
TS8 acquisition harnessed jobs
  • Loading branch information
jchiang87 authored May 31, 2017
2 parents c5f8aa9 + 82154cc commit 2e9b224
Show file tree
Hide file tree
Showing 45 changed files with 1,471 additions and 415 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,6 @@ target/

# Back-up files
*~

# jython
*$py.class
38 changes: 38 additions & 0 deletions harnessed_jobs/dark_raft_acq/v0/ccs_dark_raft_acq.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"""
Jython script to acquire dark exposure dataset (used to find bright defects and
to estimate dark current).
"""
from eo_acquisition import EOAcquisition, AcqMetadata, logger

class DarkAcquisition(EOAcquisition):
"""
EOAcquisition subclass to acquire dark exposure dataset.
"""
def __init__(self, seqfile, acq_config_file, metadata, subsystems,
ccd_names, logger=logger):
super(DarkAcquisition, self).__init__(seqfile, acq_config_file, "DARK",
metadata, subsystems, ccd_names,
logger=logger)

def run(self):
"""
Take the dark exposures.
"""
openShutter = False
actuateXed = False
image_type = "DARK"

for tokens in self.instructions:
exptime = float(tokens[1])
frame_count = int(tokens[2])
for seqno in range(frame_count):
self.image_clears()
self.bias_image(seqno)
self.take_image(seqno, exptime, openShutter, actuateXed,
image_type)

if __name__ == '__main__':
metadata = AcqMetadata(cwd=tsCWD, raft_id=UNITID, run_number=RUNNUM)
acq = DarkAcquisition(sequence_file, rtmacqcfgfile, metadata, subsystems,
ccd_names)
acq.run()
6 changes: 6 additions & 0 deletions harnessed_jobs/dark_raft_acq/v0/producer_dark_raft_acq.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
#!/usr/bin/env python
import os
from ccsTools import ccsProducer, CcsRaftSetup

ccsProducer('dark_raft_acq', 'ccs_dark_raft_acq.py',
ccs_setup_class=CcsRaftSetup,
sys_paths=(os.path.join(os.environ['IANDTJOBSDIR'], 'python'),))
7 changes: 2 additions & 5 deletions harnessed_jobs/dark_raft_acq/v0/validator_dark_raft_acq.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#!/usr/bin/env python
import lcatr.schema
from ccsTools import ccsValidator

results = []

lcatr.schema.write_file(results)
lcatr.schema.validate_file()
ccsValidator()
39 changes: 39 additions & 0 deletions harnessed_jobs/fe55_raft_acq/v0/ccs_fe55_raft_acq.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"""
Jython script to run Fe55 acquisitions at TS8.
"""
from eo_acquisition import EOAcquisition, AcqMetadata, logger

class Fe55Acquisition(EOAcquisition):
"""
EOAcquisition subclass to take the Fe55 dataset.
"""
def __init__(self, seqfile, acq_config_file, metadata, subsystems,
ccd_names, logger=logger):
super(Fe55Acquisition, self).__init__(seqfile, acq_config_file, "FE55",
metadata, subsystems, ccd_names,
logger=logger)

def run(self):
"""
Take the Fe55 data.
"""
openShutter = False
actuateXed = True
image_type = "FE55"

seqno = 0
for tokens in self.instructions:
exptime = float(tokens[1])
nframes = int(tokens[2])
for iframe in range(nframes):
self.image_clears()
self.bias_image(seqno)
self.take_image(seqno, exptime, openShutter, actuateXed,
image_type)
seqno += 1

if __name__ == '__main__':
metadata = AcqMetadata(cwd=tsCWD, raft_id=UNITID, run_number=RUNNUM)
acq = Fe55Acquisition(sequence_file, rtmacqcfgfile, metadata, subsystems,
ccd_names)
acq.run()
6 changes: 6 additions & 0 deletions harnessed_jobs/fe55_raft_acq/v0/producer_fe55_raft_acq.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
#!/usr/bin/env python
import os
from ccsTools import ccsProducer, CcsRaftSetup

ccsProducer('fe55_raft_acq', 'ccs_fe55_raft_acq.py',
ccs_setup_class=CcsRaftSetup,
sys_paths=(os.path.join(os.environ['IANDTJOBSDIR'], 'python'),))
7 changes: 2 additions & 5 deletions harnessed_jobs/fe55_raft_acq/v0/validator_fe55_raft_acq.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#!/usr/bin/env python
import lcatr.schema
from ccsTools import ccsValidator

results = []

lcatr.schema.write_file(results)
lcatr.schema.validate_file()
ccsValidator()
57 changes: 57 additions & 0 deletions harnessed_jobs/flat_pair_raft_acq/v0/ccs_flat_pair_raft_acq.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
"""
Jython script to run flat pair acquisitions at TS8.
"""
from eo_acquisition import EOAcquisition, PhotodiodeReadout, AcqMetadata, logger

class FlatAcquisition(EOAcquisition):
"""
EOAcquisition subclass to take the flat pair dataset.
"""
def __init__(self, seqfile, acq_config_file, metadata, subsystems,
ccd_names, logger=logger):
super(FlatAcquisition, self).__init__(seqfile, acq_config_file, "FLAT",
metadata, subsystems, ccd_names,
logger=logger)
self.imcount = 2

def run(self):
"""
Take the flat pair sequence, reading the target signal levels
from the configuration file.
"""
openShutter = True
actuateXed = False
image_type = "FLAT"

# Get measured flux at current wavelength for exposure time
# calculation.
meas_flux = self.measured_flux(self.wl) # e-/pixel/second
self.logger.info("flat_pair_acq: measured flux =", meas_flux)

# Loop over exposure pairs.
for seqno, tokens in enumerate(self.instructions):
self.image_clears()
self.bias_image(seqno)

# Compute exposure time in ms to obtain the desired signal level.
target_counts = float(tokens[1]) # e-/pixel
exptime = self.compute_exptime(target_counts, meas_flux)

# Create photodiode readout handler.
pd_readout = PhotodiodeReadout(exptime, self)

# Take a pair of exposures (self.imcount = 2).
for icount in range(self.imcount):
self.image_clears()
file_template = '${CCDSerialLSST}_${testType}_%07.2fs_${imageType}%d_${RunNumber}_${timestamp}.fits' % (exptime, icount+1)
pd_readout.start_accumulation()
fits_files = self.take_image(seqno, exptime, openShutter,
actuateXed, image_type,
file_template=file_template)
pd_readout.get_readings(fits_files, seqno, icount)

if __name__ == '__main__':
metadata = AcqMetadata(cwd=tsCWD, raft_id=UNITID, run_number=RUNNUM)
acq = FlatAcquisition(sequence_file, rtmacqcfgfile, metadata, subsystems,
ccd_names)
acq.run()
6 changes: 6 additions & 0 deletions harnessed_jobs/flat_pair_raft_acq/v0/producer_flat_pair_raft_acq.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
#!/usr/bin/env python
import os
from ccsTools import ccsProducer, CcsRaftSetup

ccsProducer('flat_pair_raft_acq', 'ccs_flat_pair_raft_acq.py',
ccs_setup_class=CcsRaftSetup,
sys_paths=(os.path.join(os.environ['IANDTJOBSDIR'], 'python'),))
7 changes: 2 additions & 5 deletions harnessed_jobs/flat_pair_raft_acq/v0/validator_flat_pair_raft_acq.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#!/usr/bin/env python
import lcatr.schema
from ccsTools import ccsValidator

results = []

lcatr.schema.write_file(results)
lcatr.schema.validate_file()
ccsValidator()
42 changes: 42 additions & 0 deletions harnessed_jobs/ppump_raft_acq/v0/ccs_ppump_raft_acq.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
"""
Jython script to run the pocket-pumping acquisition at TS8.
"""
from eo_acquisition import EOAcquisition, AcqMetadata, logger

class PPumpAcquisition(EOAcquisition):
"""
EOAcquisition subclass to take the pocket-pumping dataset.
"""
def __init__(self, seqfile, acq_config_file, metadata, subsystems,
ccd_names, logger=logger):
super(PPumpAcquisition, self).__init__(seqfile, acq_config_file,
"TRAP", metadata, subsystems,
ccd_names, logger=logger)

def run(self):
"""
Take the pocket-pumping data.
"""
openShutter = True
actuateXed = False
image_type = "PPUMP"

wl = float(self.eo_config.get("PPUMP_WL", 550))
meas_flux = self.measured_flux(wl)
seqno = 0
for tokens in self.instructions:
exptime = float(tokens[1])
nframes = int(tokens[2])
shifts = int(tokens[3])
for iframe in range(nframes):
self.image_clears()
self.bias_image(seqno)
self.take_image(seqno, exptime, openShutter, actuateXed,
image_type)
seqno += 1

if __name__ == '__main__':
metadata = AcqMetadata(cwd=tsCWD, raft_id=UNITID, run_number=RUNNUM)
acq = PPumpAcquisition(sequence_file, rtmacqcfgfile, metadata, subsystems,
ccd_names)
acq.run()
6 changes: 6 additions & 0 deletions harnessed_jobs/ppump_raft_acq/v0/producer_ppump_raft_acq.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
#!/usr/bin/env python
import os
from ccsTools import ccsProducer, CcsRaftSetup

ccsProducer('ppump_raft_acq', 'ccs_ppump_raft_acq.py',
ccs_setup_class=CcsRaftSetup,
sys_paths=(os.path.join(os.environ['IANDTJOBSDIR'], 'python'),))
7 changes: 2 additions & 5 deletions harnessed_jobs/ppump_raft_acq/v0/validator_ppump_raft_acq.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#!/usr/bin/env python
import lcatr.schema
from ccsTools import ccsValidator

results = []

lcatr.schema.write_file(results)
lcatr.schema.validate_file()
ccsValidator()
47 changes: 47 additions & 0 deletions harnessed_jobs/qe_raft_acq/v0/ccs_qe_raft_acq.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
"""
Jython script for acquisition of QE dataset.
"""
from eo_acquisition import EOAcquisition, PhotodiodeReadout, AcqMetadata, logger

class QEAcquisition(EOAcquisition):
"""
EOAcquisition subclass to take QE dataset.
"""
def __init__(self, seqfile, acq_config_file, metadata, subsystems,
ccd_names, logger=logger):
super(QEAcquisition, self).__init__(seqfile, acq_config_file, "LAMBDA",
metadata, subsystems, ccd_names,
logger=logger)

def run(self):
"""
Take a sequence of flats as a function of wavelength,
recomputing the exposure needed to get the desired signal
level at each wavelength.
"""
openShutter = True
actuateXed = False
image_type = "FLAT"

for seqno, tokens in enumerate(self.instructions):
self.image_clears()
self.bias_image(seqno)

wl = float(tokens[1])
target_counts = float(tokens[2])
meas_flux = self.measured_flux(wl)
exptime = self.compute_exptime(target_counts, meas_flux)

pd_readout = PhotodiodeReadout(exptime, self)
self.image_clears()
file_template = '${CCDSerialLSST}_${testType}_${imageType}_%4.4d_${RunNumber}_${timestamp}.fits' % int(wl)
pd_readout.start_accumulation()
fits_files = self.take_image(seqno, exptime, openShutter, actuateXed,
image_type, file_template=file_template)
pd_readout.get_readings(fits_files, seqno, 1)

if __name__ == '__main__':
metadata = AcqMetadata(cwd=tsCWD, raft_id=UNITID, run_number=RUNNUM)
acq = QEAcquisition(sequence_file, rtmacqcfgfile, metadata, subsystems,
ccd_names)
acq.run()
6 changes: 6 additions & 0 deletions harnessed_jobs/qe_raft_acq/v0/producer_qe_raft_acq.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
#!/usr/bin/env python
import os
from ccsTools import ccsProducer, CcsRaftSetup

ccsProducer('qe_raft_acq', 'ccs_qe_raft_acq.py',
ccs_setup_class=CcsRaftSetup,
sys_paths=(os.path.join(os.environ['IANDTJOBSDIR'], 'python'),))
7 changes: 2 additions & 5 deletions harnessed_jobs/qe_raft_acq/v0/validator_qe_raft_acq.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#!/usr/bin/env python
import lcatr.schema
from ccsTools import ccsValidator

results = []

lcatr.schema.write_file(results)
lcatr.schema.validate_file()
ccsValidator()
56 changes: 56 additions & 0 deletions harnessed_jobs/sflat_raft_acq/v0/ccs_sflat_raft_acq.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
"""
Jython script to run superflat acquisitions at TS8.
"""
from eo_acquisition import EOAcquisition, PhotodiodeReadout, AcqMetadata,\
logger

class SuperFlatAcquisition(EOAcquisition):
"""
EOAcquisition subclass to take the flat pair dataset.
"""
def __init__(self, seqfile, acq_config_file, metadata, subsystems,
ccd_names, logger=logger):
super(SuperFlatAcquisition, self).__init__(seqfile, acq_config_file,
"SFLAT", metadata,
subsystems, ccd_names,
logger=logger)

def run(self):
"""
Take superflat datasets at the wavelength and signal values
specified in the configuration file.
"""
openShutter = True
actuateXed = False
image_type = "FLAT"

seqno = 0
for tokens in self.instructions:
wl = float(tokens[1])
target_flux = float(tokens[2])
nframes = int(tokens[3])
test_type = "SFLAT_%3.3d" % wl
if target_flux < 1e4:
flux_level = 'L'
else:
flux_level = 'H'
meas_flux = self.measured_flux(wl)
exptime = self.compute_exptime(target_flux, meas_flux)
pd_readout = PhotodiodeReadout(exptime, self)
for iframe in range(nframes):
self.image_clears()
self.bias_image(seqno)
file_template = '${CCDSerialLSST}_${testType}_${imageType}_%s%3.3d_${timestamp}.fits' % (flux_level, seqno+1)
pd_readout.start_accumulation()
fits_files = self.take_image(seqno, exptime, openShutter,
actuateXed, image_type,
test_type=test_type,
file_template=file_template)
pd_readout.get_readings(fits_files, seqno, 1)
seqno += 1

if __name__ == '__main__':
metadata = AcqMetadata(cwd=tsCWD, raft_id=UNITID, run_number=RUNNUM)
acq = SuperFlatAcquisition(sequence_file, rtmacqcfgfile, metadata,
subsystems, ccd_names)
acq.run()
6 changes: 6 additions & 0 deletions harnessed_jobs/sflat_raft_acq/v0/producer_sflat_raft_acq.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
#!/usr/bin/env python
import os
from ccsTools import ccsProducer, CcsRaftSetup

ccsProducer('sflat_raft_acq', 'ccs_sflat_raft_acq.py',
ccs_setup_class=CcsRaftSetup,
sys_paths=(os.path.join(os.environ['IANDTJOBSDIR'], 'python'),))
7 changes: 2 additions & 5 deletions harnessed_jobs/sflat_raft_acq/v0/validator_sflat_raft_acq.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#!/usr/bin/env python
import lcatr.schema
from ccsTools import ccsValidator

results = []

lcatr.schema.write_file(results)
lcatr.schema.validate_file()
ccsValidator()
Loading

0 comments on commit 2e9b224

Please sign in to comment.