diff --git a/src/aare/daq/daq.py b/src/aare/daq/daq.py index 2efb1ae7..29e6893a 100644 --- a/src/aare/daq/daq.py +++ b/src/aare/daq/daq.py @@ -2104,74 +2104,6 @@ class AareDAQ: self.__cfg.state_busy = False raise - def __rotation(self, request: RotationScanRequest) -> CompletedRotationScan: - omega_start = self.omega - status = self.status - - if request.exp_time_s < 0.004: - logger.warning("Exposure time too short for PXII rotation scan") - request.exp_time_s = 0.004 - total_time = request.exp_time_s * request.steps - if self.sample is not None and self.sample.db_id is not None: - self.__aare.create_rotation_run(self.sample, request, status) - - if not self.__cfg.simulated_detector: - try: - self.__jfjoch.wait_till_running(timeout=60.0) - except Exception as e: - self._raise_if_critical_jfjoch_detector_error(e, command="wait_till_running") - raise - try: - if request.screening: - self.__devs.aerotech.screening_scan( - rotation_deg=request.steps * request.incr_omega_deg, - wedge_deg=request.wedge_omega_deg, - time_sec=total_time, - steps=request.steps, - run_async=True, - ) - else: - self.__devs.aerotech.rotation_scan( - rotation_deg=request.steps * request.incr_omega_deg, - time_sec=total_time, - start_pos_deg=request.start_omega_deg, - run_async=True, - ) - - # Is this for helical scans...? do we do smargon scans? - if request.start is not None and request.end is not None: - smargon_time_step = request.exp_time_s / float(request.steps) - pos_step = (request.end.sh_mm - request.start.sh_mm) * ( - 1.0 / float(request.steps) - ) - - for i in range(request.steps): - self.__devs.smargon.target = SmargonCoordinate( - sh_mm=request.start.sh_mm + pos_step * i - ) - time.sleep(smargon_time_step) - - self.__devs.aerotech.wait_till_done(timeout=int(round(total_time + 60, 0))) - self.__devs.aerotech_omega = omega_start - - if self.__cfg.simulated_detector: - logger.warning("Detector in simulation mode, returning fake zero rotation result.") - return self._build_fake_rotation_result(request) - else: - try: - scan_result = self.__jfjoch.wait_till_done(60) - except Exception as e: - self._raise_if_critical_jfjoch_detector_error(e, command="wait_till_done") - raise - return CompletedRotationScan(request=copy.deepcopy(request), result=scan_result) - - except JFJochCommunicationError as e: - logger.error(f"Exception during rotation scan related to JFJoch: {e}") - raise - except Exception as e: - logger.error(f"Exception during rotation scan: {e}") - raise - def measure_rotation(self, request: RotationScanRequest) -> CompletedRotationScan: """ Execute a rotation scan.