diff --git a/harnessed_jobs/rtm_aliveness_exposure/v0/ccs_rtm_aliveness_exposure.py b/harnessed_jobs/rtm_aliveness_exposure/v0/ccs_rtm_aliveness_exposure.py index 5862493..fe64e9e 100644 --- a/harnessed_jobs/rtm_aliveness_exposure/v0/ccs_rtm_aliveness_exposure.py +++ b/harnessed_jobs/rtm_aliveness_exposure/v0/ccs_rtm_aliveness_exposure.py @@ -17,7 +17,7 @@ def verify_rebs(ts8, logger=logger): "List the REBs that are attached." - rebs = ts8.synchCommand(10, "getREBDeviceNames").getResult() + rebs = ts8.synchCommand(10, "getREBDeviceNames") logger.info("%i REBs found:", len(rebs)) for reb in rebs: logger.info(" %s", reb) @@ -41,7 +41,7 @@ def setup_sequencer(ts8, sequence_file=sequence_file, nclears=10, ts8.synchCommand(10, command) command = 'exposeAcquireAndSave 100 False False ""' - logger.info(ts8.synchCommand(300, command).getResult()) + logger.info(ts8.synchCommand(300, command)) if __name__ == '__main__': if subsystems is None: diff --git a/harnessed_jobs/rtm_aliveness_power_on/v0/ccs_rtm_aliveness_power_on.py b/harnessed_jobs/rtm_aliveness_power_on/v0/ccs_rtm_aliveness_power_on.py index f2e0bd7..355aea2 100644 --- a/harnessed_jobs/rtm_aliveness_power_on/v0/ccs_rtm_aliveness_power_on.py +++ b/harnessed_jobs/rtm_aliveness_power_on/v0/ccs_rtm_aliveness_power_on.py @@ -48,7 +48,7 @@ def reb_power_on(ccs_sub, rebid, power_line, ccd_type, raise_exception=True): logger.info("*****************************************************") reb_device \ - = list(ccs_sub.ts8.synchCommand(10, 'getREBDevices').getResult())[rebid] + = list(ccs_sub.ts8.synchCommand(10, 'getREBDevices'))[rebid] # Power on the REB using the power-up sequence. (10.4.2.2, step 2) ccs_sub.rebps.synchCommand(10, 'sequencePower', power_line, True) @@ -104,8 +104,7 @@ def reb_power_on(ccs_sub, rebid, power_line, ccd_type, raise_exception=True): outfile = '/'.join((tsCWD, outfile)) logger.info('Writing powerOn output to %s', outfile) with open(outfile, 'w') as output: - output.write(str(ccs_sub.ts8.synchCommand(900, 'powerOn', - rebid).getResult())) + output.write(str(ccs_sub.ts8.synchCommand(900, 'powerOn', rebid))) os.chmod(outfile, 0664) logger.info("------ %s power-on complete ------\n", reb_slot) except java.lang.Exception as eobj: diff --git a/harnessed_jobs/rtm_aliveness_power_on/v0/validator_rtm_aliveness_power_on.py b/harnessed_jobs/rtm_aliveness_power_on/v0/validator_rtm_aliveness_power_on.py index bc338fb..e363ee6 100755 --- a/harnessed_jobs/rtm_aliveness_power_on/v0/validator_rtm_aliveness_power_on.py +++ b/harnessed_jobs/rtm_aliveness_power_on/v0/validator_rtm_aliveness_power_on.py @@ -30,7 +30,7 @@ plotter.plot() plt.savefig('%s_%s_%s.png' % (section, local_time, siteUtils.getUnitId())) - except StandardError as eobj: + except Exception as eobj: print("Exception caught while producing trending plot:") print(str(eobj)) print("continuing...") diff --git a/harnessed_jobs/ts8_cool_down/v0/ccs_ts8_cool_down.py b/harnessed_jobs/ts8_cool_down/v0/ccs_ts8_cool_down.py index df090b3..7b23b04 100644 --- a/harnessed_jobs/ts8_cool_down/v0/ccs_ts8_cool_down.py +++ b/harnessed_jobs/ts8_cool_down/v0/ccs_ts8_cool_down.py @@ -32,8 +32,8 @@ ts_state = 0 while ts_state == 0: try: - ts_state = ccs_sub.ts.synchCommand(10, "isTestStandReady").getResult() - ctemp = ccs_sub.cryo.synchCommand(20, "getTemp B").getResult() + ts_state = ccs_sub.ts.synchCommand(10, "isTestStandReady") + ctemp = ccs_sub.cryo.synchCommand(20, "getTemp B") logger.info("time = %s, temp = %f", time.time(), ctemp) except StandardError as eobj: logger.info("Exception caught while waiting for test stand ready state") @@ -44,4 +44,4 @@ # Final check of test stand readiness. reply = ready_state.get() -result = ccs_sub.ts.synchCommand(120, "goTestStand").getResult() +result = ccs_sub.ts.synchCommand(120, "goTestStand") diff --git a/harnessed_jobs/ts8_preflight_acq/v0/ccs_ts8_preflight_acq.py b/harnessed_jobs/ts8_preflight_acq/v0/ccs_ts8_preflight_acq.py index 9275760..eb6bd87 100644 --- a/harnessed_jobs/ts8_preflight_acq/v0/ccs_ts8_preflight_acq.py +++ b/harnessed_jobs/ts8_preflight_acq/v0/ccs_ts8_preflight_acq.py @@ -39,7 +39,7 @@ def run(self): wl = float(tokens[1]) exptime = float(tokens[2]) rwl = self.set_wavelength(wl) - filt = self.sub.mono.synchCommand(60, "getFilter").getResult() + filt = self.sub.mono.synchCommand(60, "getFilter") logger.info("Wavelength: %f; Filter: %f" % (rwl, filt)) time.sleep(4.) diff --git a/python/eo_acquisition.py b/python/eo_acquisition.py index c4ff243..acd9262 100644 --- a/python/eo_acquisition.py +++ b/python/eo_acquisition.py @@ -46,14 +46,14 @@ def hit_target_pressure(vac_sub, target, wait=5, tmax=7200, logger=logger): The logger object. """ tstart = time.time() - pressure = vac_sub.synchCommand(20, "readPressure").getResult() + pressure = vac_sub.synchCommand(20, "readPressure") while pressure > target or pressure < 0: logger.info("time = %s, pressure = %f", time.time(), pressure) if (time.time() - tstart) > tmax: raise RuntimeError("Exceeded allowed pump-down time for " + "target pressure %s" % target) time.sleep(wait) - pressure = vac_sub.synchCommand(20, "readPressure").getResult() + pressure = vac_sub.synchCommand(20, "readPressure") AcqMetadata = namedtuple('AcqMetadata', 'cwd raft_id run_number'.split()) @@ -226,7 +226,7 @@ def set_wavelength(self, wl): The desired wavelength in nm. """ command = "setWaveAndFilter %s" % wl - rwl = self.sub.mono.synchCommand(60, command).getResult() + rwl = self.sub.mono.synchCommand(60, command) self.sub.ts8.synchCommand(10, "setMonoWavelength", rwl) return rwl @@ -322,7 +322,7 @@ def take_image(self, seqno, exptime, openShutter, actuateXed, timeout = int(max(timeout, exptime + 20)) for itry in range(max_tries): try: - result = self.sub.ts8.synchCommand(timeout, command).getResult() + result = self.sub.ts8.synchCommand(timeout, command) return result except (StandardError, java.lang.Exception) as eobj: self.logger.info("EOAcquisition.take_image: try %i failed", @@ -408,7 +408,7 @@ def measured_flux(self, wl, seqno=0, fluxcal_time=2.): file_path = glob.glob(os.path.join(self.md.cwd, '*', fits_file))[0] command = "getFluxStats %s" % file_path flux_sum += \ - float(self.sub.ts8.synchCommand(10, command).getResult()) + float(self.sub.ts8.synchCommand(10, command)) return flux_sum/len(fits_files) def compute_exptime(self, target_counts, meas_flux): @@ -438,7 +438,7 @@ def getParallelHighConfig(self): get phi0, phi1, phi2 existing values of pclkHighP """ command = "printConfigurableParameters" - res = str(self.sub.ts8dac0.synchCommand(10, command).getResult()) + res = str(self.sub.ts8dac0.synchCommand(10, command)) m = re.search(r"pclkHighP: ([-\d]+\.\d+),", res) if not m: self.logger.info("m is None, res=%s", res) @@ -447,7 +447,7 @@ def getParallelHighConfig(self): if phi0 < 1.0: self.logger.info("ts8dac0.pclkHighP=%s < 1.0", phi0) return None - res = str(self.sub.ts8dac1.synchCommand(10, command).getResult()) + res = str(self.sub.ts8dac1.synchCommand(10, command)) m = re.search(r"pclkHighP: ([-\d]+\.\d+),", res) if not m: self.logger.info("m is None, res=%s", res) @@ -456,7 +456,7 @@ def getParallelHighConfig(self): if phi1 < 1.0: self.logger.info("ts8dac1.pclkHighP=%s < 1.0", phi1) return None - res = str(self.sub.ts8dac2.synchCommand(10, command).getResult()) + res = str(self.sub.ts8dac2.synchCommand(10, command)) m = re.search(r"pclkHighP: ([-\d]+\.\d+),", res) if not m: self.logger.info("m is None, res=%s", res) @@ -472,7 +472,7 @@ def getParallelLowConfig(self): get plo0, plo1, plo2 existing values of pclkLowP """ command = "printConfigurableParameters" - res = str(self.sub.ts8dac0.synchCommand(10, command).getResult()) + res = str(self.sub.ts8dac0.synchCommand(10, command)) m = re.search(r"pclkLowP: ([-\d]+\.\d+),", res) if not m: self.logger.info("m is None, res=%s", res) @@ -481,7 +481,7 @@ def getParallelLowConfig(self): if plo0 > 0.5: self.logger.info("ts8dac0.pclkLowP: %s > 0.5", plo0) return None - res = str(self.sub.ts8dac1.synchCommand(10, command).getResult()) + res = str(self.sub.ts8dac1.synchCommand(10, command)) m = re.search(r"pclkLowP: ([-\d]+\.\d+),", res) if not m: self.logger.info("m is None, res=%s", res) @@ -490,7 +490,7 @@ def getParallelLowConfig(self): if plo1 > 0.5: self.logger.info("ts8dac1.pclkLowP: %s > 0.5", plo1) return None - res = str(self.sub.ts8dac2.synchCommand(10, command).getResult()) + res = str(self.sub.ts8dac2.synchCommand(10, command)) m = re.search(r"pclkLowP: ([-\d]+\.\d+),", res) if not m: self.logger.info("m is None, res=%s", res) @@ -503,7 +503,7 @@ def getParallelLowConfig(self): def get_ccdtype(self): """ return ccdtype as a string""" - res = str(self.sub.ts8.synchCommand(10, "getCcdType").getResult()) + res = str(self.sub.ts8.synchCommand(10, "getCcdType")) if re.match(r"^e2v$", res): return "e2v" elif re.match(r"^itl$", res): @@ -518,13 +518,13 @@ def verify_sequencer_params(self): """ #- CleaningNummber = [0, 0, 0] res = str(self.sub.ts8.synchCommand(10, - "getSequencerParameter", "CleaningNumber").getResult()) + "getSequencerParameter", "CleaningNumber")) if not re.match(r"\[0, 0, 0\]", res): self.logger.info("SeqParam CleaningNumber:%s invalid", res) raise java.lang.Exception("Bad Sequencer: CleaningNumber=0 required") #- ClearCount = [1, 1, 1] res = str(self.sub.ts8.synchCommand(10, - "getSequencerParameter", "ClearCount").getResult()) + "getSequencerParameter", "ClearCount")) if not re.match(r"\[1, 1, 1\]", res): self.logger.info("SeqParam ClearCount:%s invalid", res) raise java.lang.Exception("Bad Sequencer: ClearCount=1 required") @@ -598,7 +598,7 @@ def ccd_clear(self, nclears): for _ in range(nclears): self.sub.ts8.synchCommand(10, "setSequencerStart", "Clear") self.sub.ts8.synchCommand(10, "startSequencer") - self.sub.ts8.synchCommand(10, "waitSequencerDone", 1000).getResult() + self.sub.ts8.synchCommand(10, "waitSequencerDone", 1000) self.sub.ts8.synchCommand(10, "setSequencerStart", "Bias") if ccdtype == 'e2v': if unipolar: @@ -670,7 +670,7 @@ def start_accumulation(self): running = False while not running: try: - running = self.sub.pd.synchCommand(20, "isAccumInProgress").getResult() + running = self.sub.pd.synchCommand(20, "isAccumInProgress") except StandardError as eobj: self.logger.info("PhotodiodeReadout.start_accumulation:") self.logger.info(str(eobj)) @@ -691,7 +691,7 @@ def write_readings(self, seqno, icount=1): result = self.sub.pd.synchCommand(1000, "readBuffer", pd_filename) self.logger.info("Photodiode readout accumulation finished at %f, %s", - time.time() - self._start_time, result.getResult()) + time.time() - self._start_time, result) return pd_filename diff --git a/python/rebCurrentLimits.py b/python/rebCurrentLimits.py index 1464d83..33ea657 100644 --- a/python/rebCurrentLimits.py +++ b/python/rebCurrentLimits.py @@ -70,7 +70,7 @@ def check_rebps_limits(self, rebid, enforce_lower_limits=True, for limits in self.values(): ps_channel_name = 'REB%d.%s' % (rebid, limits.reb_ps_name) ps_current = self.rebps.synchCommand(10, 'readChannelValue', - ps_channel_name).getResult() + ps_channel_name) self.logger.info("%s: %s mA", ps_channel_name, ps_current) if ((enforce_lower_limits and ps_current < limits.low_lim) or ps_current > limits.high_lim): @@ -101,10 +101,10 @@ def check_comparative_ranges(self, rebid, raise_exception=True): continue ps_channel_name = 'REB%d.%s' % (rebid, limits.reb_ps_name) ps_current = self.rebps.synchCommand(10, 'readChannelValue', - ps_channel_name).getResult() + ps_channel_name) reb_channel_name = 'R00.Reb%d.%s' % (rebid, channel_name) reb_current = self.ts8.synchCommand(10, 'readChannelValue', - reb_channel_name).getResult() + reb_channel_name) if abs(ps_current - reb_current) > limits.comp_range: message \ = "Currents for %s and %s lie outside comparative range." \