diff --git a/csaxs_bec/bec_ipython_client/plugins/cSAXS/filter_transmission.py b/csaxs_bec/bec_ipython_client/plugins/cSAXS/filter_transmission.py index b7a4015b..3ca0f475 100644 --- a/csaxs_bec/bec_ipython_client/plugins/cSAXS/filter_transmission.py +++ b/csaxs_bec/bec_ipython_client/plugins/cSAXS/filter_transmission.py @@ -203,45 +203,9 @@ class cSAXSFilterTransmission: # Only allow fil_trans < 1 when DMM is in THROUGH (both) # and CCM energy > 1 keV. fil_trans(1) is always allowed. # ------------------------------------------------------- - if transmission < 1.0: - try: - dmm_trans = float(epics_get("X12SA-OP-DMM-EMLS-3010:THRU")) - except Exception: - dmm_trans = -1 - try: - dmm_rot = float(epics_get("X12SA-OP-DMM-EMLS-3030:THRU")) - except Exception: - dmm_rot = -1 - try: - ccm_energy = float(epics_get("X12SA-OP-CCM1:ENERGY-GET")) - except Exception: - ccm_energy = -1 - - allowed = (dmm_trans == 1) and (dmm_rot == 1) and (ccm_energy > 1) - - if not allowed: - print("\n⚠️ SAFETY WARNING: Reducing transmission (< 1) typically requires:") - print(" - DMM translation in THROUGH (THRU == 1)") - print(" - DMM rotation in THROUGH (THRU == 1)") - print(" - CCM energy > 1 keV") - print("\nCurrent state:") - print(f" DMM translation THRU : {dmm_trans}") - print(f" DMM rotation THRU : {dmm_rot}") - print(f" CCM energy (keV) : {ccm_energy}") - - # Ask user (default = NO) - if hasattr(self, "OMNYTools") and hasattr(self.OMNYTools, "yesno"): - proceed = self.OMNYTools.yesno( - "Conditions not satisfied. Proceed anyway?", - default="n", - ) - else: - # Safe fallback - proceed = False - - if not proceed: - print("Aborted. Transmission unchanged.") - return None + if transmission < 1.0 and not self._attenuation_allowed(): + print("Aborted. Transmission unchanged.") + return None # --- Energy handling (EPICS only) --- if energy_kev is None: