Added fast pulse picker shutter
This commit is contained in:
Binary file not shown.
BIN
__pycache__/channels_minimal.cpython-39.pyc
Normal file
BIN
__pycache__/channels_minimal.cpython-39.pyc
Normal file
Binary file not shown.
BIN
__pycache__/pp_shutter.cpython-39.pyc
Normal file
BIN
__pycache__/pp_shutter.cpython-39.pyc
Normal file
Binary file not shown.
@ -5,12 +5,12 @@
|
|||||||
# BS channels
|
# BS channels
|
||||||
|
|
||||||
# TODO: JF settings regarding raw conversion, compression, etc.
|
# TODO: JF settings regarding raw conversion, compression, etc.
|
||||||
detectors = [
|
detectors_min = [
|
||||||
# "JF16T03V01",
|
# "JF16T03V01",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
channels = []
|
channels_min = ["SARFE10-PSSS059:SPECTRUM_Y"]
|
||||||
|
|
||||||
pvs = []#pvs_slits + pv_channels + smaract_channels
|
pvs_min = ['SARFE10-PBPG050:PHOTON-ENERGY-PER-PULSE-AVG']#pvs_slits + pv_channels + smaract_channels
|
||||||
|
@ -23,12 +23,16 @@ from slic.core.scanner import Scanner
|
|||||||
from slic.core.device.simpledevice import SimpleDevice
|
from slic.core.device.simpledevice import SimpleDevice
|
||||||
|
|
||||||
from slic.devices.general.motor import Motor
|
from slic.devices.general.motor import Motor
|
||||||
|
from slic.devices.general.shutter import Shutter
|
||||||
|
from slic.devices.xoptics.pulsepicker import PulsePicker
|
||||||
from slic.utils import devices, Marker, as_shortcut
|
from slic.utils import devices, Marker, as_shortcut
|
||||||
from slic.utils import Channels, Config, Elog, Screenshot, PV
|
from slic.utils import Channels, Config, Elog, Screenshot, PV
|
||||||
from slic.core.acquisition.fakeacquisition import FakeAcquisition
|
from slic.core.acquisition.fakeacquisition import FakeAcquisition
|
||||||
|
|
||||||
from channels import detectors, channels, pvs
|
from channels import detectors, channels, pvs
|
||||||
from spreadsheet import overview
|
from spreadsheet import overview
|
||||||
|
from channels_minimal import detectors_min, channels_min, pvs_min
|
||||||
|
from pp_shutter import PP_Shutter
|
||||||
|
|
||||||
# DEVICES
|
# DEVICES
|
||||||
## example devices and adjustables
|
## example devices and adjustables
|
||||||
@ -56,9 +60,11 @@ def test_attenuator():
|
|||||||
|
|
||||||
## Undulator
|
## Undulator
|
||||||
import undulator
|
import undulator
|
||||||
|
|
||||||
undulators = undulator.Undulators()
|
undulators = undulator.Undulators()
|
||||||
|
|
||||||
|
# Shutter
|
||||||
|
shutter = PP_Shutter("SARES30-LTIM01-EVR0:RearUniv0-Ena-SP",name="Cristallina pulse picker shutter") # Shutter buttton when using the pulse picker
|
||||||
|
pulsepicker = PulsePicker("SAROP31-OPPI151","SARES30-LTIM01-EVR0:Pul3", name="Cristallina X-ray pulse picker OPPI151")
|
||||||
|
|
||||||
## Slits
|
## Slits
|
||||||
from slic.devices.xoptics import slits
|
from slic.devices.xoptics import slits
|
||||||
@ -84,9 +90,9 @@ pgroup = "p20443" # commissioning Wavefront Sensor August 2022 (active)
|
|||||||
daq = SFAcquisition(
|
daq = SFAcquisition(
|
||||||
instrument,
|
instrument,
|
||||||
pgroup,
|
pgroup,
|
||||||
default_channels=channels,
|
default_channels=channels_min ,
|
||||||
default_pvs=pvs,
|
default_pvs=pvs_min,
|
||||||
default_detectors=detectors,
|
default_detectors=detectors_min,
|
||||||
rate_multiplicator=1,
|
rate_multiplicator=1,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -96,7 +102,7 @@ daq = SFAcquisition(
|
|||||||
# scan = Scanner(scan_info_dir=f"/sf/{instrument}/data/{pgroup}/res/scan_info", default_acquisitions=[daq], condition=None)
|
# scan = Scanner(scan_info_dir=f"/sf/{instrument}/data/{pgroup}/res/scan_info", default_acquisitions=[daq], condition=None)
|
||||||
|
|
||||||
# Run the scan only when gas monitor value larger than 10uJ (and smaller than 2000uJ):
|
# Run the scan only when gas monitor value larger than 10uJ (and smaller than 2000uJ):
|
||||||
check_intensity_gas_monitor = PVCondition("SARFE10-PBPG050:PHOTON-ENERGY-PER-PULSE-US", vmin=10, vmax=2000, wait_time=0.5, required_fraction=0.8)
|
check_intensity_gas_monitor = PVCondition("SARFE10-PBPG050:PHOTON-ENERGY-PER-PULSE-US", vmin=10, vmax=2000, wait_time=0.5, required_fraction=0.8) # required fraction defines ammount of data recorded to save the step and move on to the next one
|
||||||
|
|
||||||
scan = Scanner(default_acquisitions=[daq],condition = check_intensity_gas_monitor)
|
scan = Scanner(default_acquisitions=[daq],condition = check_intensity_gas_monitor)
|
||||||
gui = GUI(scan, show_goto=True, show_spec=True)
|
gui = GUI(scan, show_goto=True, show_spec=True)
|
||||||
|
29
pp_shutter.py
Normal file
29
pp_shutter.py
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
from slic.core.adjustable import PVAdjustable
|
||||||
|
from slic.utils import typename
|
||||||
|
|
||||||
|
|
||||||
|
class PP_Shutter:
|
||||||
|
"""Class for when pulse picker is used as a shutter. Opening and closing is done with turning on and off the event reciever universal output ON and OFF."""
|
||||||
|
def __init__(self, ID,name="X-ray Pulse Picker Shutter"):
|
||||||
|
self.ID = ID
|
||||||
|
self.name = name or ID
|
||||||
|
pvname_setvalue = ID
|
||||||
|
pvname_readback = ID
|
||||||
|
self._adj = PVAdjustable(pvname_setvalue, pvname_readback, accuracy=0, internal=True)
|
||||||
|
|
||||||
|
def close(self):
|
||||||
|
self._adj.set_target_value(0).wait()
|
||||||
|
|
||||||
|
def open(self):
|
||||||
|
self._adj.set_target_value(1).wait()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def status(self):
|
||||||
|
state = self._adj.get_current_value()
|
||||||
|
if state is None:
|
||||||
|
return "not connected"
|
||||||
|
return "open" if state else "closed"
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
tn = typename(self)
|
||||||
|
return f"{tn} \"{self.name}\" is {self.status}"
|
Reference in New Issue
Block a user