Closedown

This commit is contained in:
x03daop
2017-08-23 11:25:21 +02:00
parent 8a1ef7fe96
commit 99cb0fdbdb
10 changed files with 10 additions and 330 deletions

View File

@@ -1,3 +1,3 @@
reinit=60
scan_guard=10
#scan_guard=10
#monitoring=5

View File

@@ -1,28 +0,0 @@
"""
exit slit test scan
"""
POSITIONERS = (ExitSlit)
SENSORS = (SampleCurrent, RefCurrent, AuxCurrent, MachineCurrent)
STARTPOS = (-10.0)
ENDPOS = (200.0)
STEPS = 10.0
LATENCY = 0.1
DWELL = 1.0
value = DWELL * 10.0
SampleCurrentAveraging.write(value)
RefCurrentAveraging.write(value)
AuxCurrentAveraging.write(value)
def trig():
wait_beam()
caput("X03DA-OP-10ADC:TRG.PROC", 1)
lscan(POSITIONERS, SENSORS, STARTPOS, ENDPOS, STEPS, LATENCY, before_read=trig, after_read=after_readout)
STARTPOS = (200.0)
ENDPOS = (-10.0)
STEPS = -10.0
lscan(POSITIONERS, SENSORS, STARTPOS, ENDPOS, STEPS, LATENCY, before_read=trig, after_read=after_readout)

View File

@@ -1,28 +0,0 @@
"""
exit slit calibration scan
manual settings: photon energy 800 eV (G1200), FE = 1 x 1
"""
POSITIONERS = (ExitSlitY)
SENSORS = (SampleCurrent, RefCurrent, AuxCurrent, MachineCurrent)
STARTPOS = (-0.5)
ENDPOS = (1.5)
STEPS = 0.01
LATENCY = 0.1
DWELL = 1.0
value = DWELL * 10.0
SampleCurrentAveraging.write(value)
RefCurrentAveraging.write(value)
AuxCurrentAveraging.write(value)
SampleCurrentGain.write("L, 10^7")
RefCurrentGain.write("L, 10^9")
AuxCurrentGain.write("L, 10^8")
def trig():
wait_beam()
caput("X03DA-OP-10ADC:TRG.PROC", 1)
lscan(POSITIONERS, SENSORS, STARTPOS, ENDPOS, STEPS, LATENCY, before_read=trig, after_read=after_readout)

View File

@@ -1,45 +0,0 @@
"""
Focusing mirror Rx scan
to center the beam on the monochromator grating
Rx = -20...+20
set the front end to 0.5 x 0.5, exit slit to 25, photon energy to 1500
"""
import math
# adjust the following parameters
STARTPOS = (-5.0)
ENDPOS = (+5.0)
STEPS = 0.01
LATENCY = 1.0
DWELL = 1.0
ENDSCAN = False
MOTORS = [FocusXRot]
SENSORS = [SampleCurrent, RefCurrent, MachineCurrent, OpticsCameraCentroidX, OpticsCameraSigmaX]
RELATIVE = False
value = DWELL * 10.0
SampleCurrentAveraging.write(value)
RefCurrentAveraging.write(value)
SampleCurrentGain.write("L, 10^9")
RefCurrentGain.write("L, 10^9")
# front end size includes offset!
FrontendHSize.write(1.0)
FrontendVSize.write(0.9)
ExitSlit.write(25.0)
adjust_sensors()
set_adc_averaging()
def trig():
wait_beam()
caput("X03DA-OP-10ADC:TRG.PROC", 1)
try:
lscan(MOTORS, SENSORS, STARTPOS, ENDPOS, STEPS, LATENCY, RELATIVE, before_read=trig, after_read = after_readout)
finally:
if ENDSCAN:
after_scan()

View File

@@ -1,34 +0,0 @@
"""
Focusing mirror Ry scan
set scan parameters below, move the mirror to the center position.
set analyser parameters separately!
"""
import math
# adjust the following parameters
DISTANCE = 0.08
STEPS = 40
LATENCY = 0.5
ENDSCAN = False
MOTORS = [FocusYRot]
SENSORS = [Counts, SampleCurrent, RefCurrent, MachineCurrent, OpticsCameraCentroidX, OpticsCameraSigmaX]
STARTPOS = (-DISTANCE / 2.0)
ENDPOS = (DISTANCE / 2.0)
RELATIVE = True
adjust_sensors()
set_adc_averaging()
def trig_sensors():
wait_beam()
#trig_scienta()
caput("X03DA-OP-10ADC:TRG.PROC", 1)
try:
lscan(MOTORS, SENSORS, STARTPOS, ENDPOS, STEPS, LATENCY, RELATIVE, before_read=trig_sensors, after_read = after_readout)
finally:
if ENDSCAN:
after_scan()

View File

@@ -1,63 +0,0 @@
"""
front end calibration scans
RefCurrent: RMU
AuxCurrent: not connected
"""
import time
SENSORS = (RefCurrent, AuxCurrent, MachineCurrent)
STARTPOS = (-1.5)
ENDPOS = (+1.5)
STEPS = 0.01
LATENCY = 1.0
DWELL = 1.0
def trig():
wait_beam()
caput("X03DA-OP-10ADC:TRG.PROC", 1)
value = DWELL * 10.0
SampleCurrentAveraging.write(value)
RefCurrentAveraging.write(value)
AuxCurrentAveraging.write(value)
RefCurrentGain.write("L, 10^7")
AuxCurrentGain.write("L, 10^7")
FrontendHSize.write(2.0)
FrontendVSize.write(2.0)
ExitSlit.write(25.0)
caput("X03DA-PGM:ronbeta.A", -87.0)
caput("X03DA-PGM:rontheta.A", +87.0)
#MonoBeta.waitValueInRange(-87.01, -86.99, 100000)
#MonoTheta.waitValueInRange(+86.99, +87.01, 100000)
POSITIONERS = (FrontendBladeUp)
FrontendBladeDown.write(-2.0)
lscan(POSITIONERS, SENSORS, STARTPOS, ENDPOS, STEPS, LATENCY, before_read=trig, after_read=after_readout)
POSITIONERS = (FrontendBladeDown)
FrontendBladeUp.write(+2.0)
lscan(POSITIONERS, SENSORS, STARTPOS, ENDPOS, STEPS, LATENCY, before_read=trig, after_read=after_readout)
FrontendHSize.write(2.0)
FrontendVSize.write(2.0)
time.sleep(10.0)
STARTPOS = (-4.0)
ENDPOS = (+4.0)
STEPS = 0.1
POSITIONERS = (FrontendBladeRing)
FrontendBladeWall.write(-4.0)
lscan(POSITIONERS, SENSORS, STARTPOS, ENDPOS, STEPS, LATENCY, before_read=trig, after_read=after_readout)
POSITIONERS = (FrontendBladeWall)
FrontendBladeRing.write(+4.0)
lscan(POSITIONERS, SENSORS, STARTPOS, ENDPOS, STEPS, LATENCY, before_read=trig, after_read=after_readout)
FrontendHSize.write(0.0)
FrontendVSize.write(0.0)

View File

@@ -1,33 +0,0 @@
"""
TEST: OTF scan for mono calibration
under development - does not run yet
tasks:
- find out positioner of beta angle and set up device (must be of motor class).
- load table of scan positions.
- add outer theta loop.
"""
MOTORS = (MonoBeta)
SENSORS = (SampleCurrent, RefCurrent, MachineCurrent)
STARTPOS = (beta1)
ENDPOS = (beta2)
TIME = 120.0 # seconds
STEPS = 1000
RELATIVE = False
ENDSCAN = False
adjust_sensors()
set_adc_averaging()
def trig_sensors():
caput("X03DA-OP-10ADC:TRG.PROC", 1)
try:
wait_beam()
cscan(MOTORS, SENSORS, STARTPOS, ENDPOS, STEPS, time = TIME, relative = RELATIVE, before_read = trig_sensors)
finally:
if ENDSCAN:
after_scan()

View File

@@ -1,71 +0,0 @@
"""
photon flux spectrum
SampleCurrent: diode
RefCurrent: RMU
AuxCurrent: not connected
"""
import time
# G600 full spectrum
#STARTPOS = (50.0)
#ENDPOS = (1100.0)
#STEPS = 10.0
#LATENCY = 5.0
#DWELL = 1.0
# G1200 full spectrum
#STARTPOS = (100.0)
#ENDPOS = (2000.0)
#STEPS = 25.0
#LATENCY = 5.0
#DWELL = 1.0
# carbon edge
STARTPOS = (270.0)
ENDPOS = (310.0)
STEPS = 0.5
LATENCY = 1.0
DWELL = 1.0
# G600 1x1 reference sscan_2268 (elog:119)
#SampleCurrentGain.write("L, 10^7")
#RefCurrentGain.write("L, 10^9")
#FrontendHSize.write(1.5)
#FrontendVSize.write(1.4)
#ExitSlit.write(100.0)
# G600 1x1 reference sscan_2268 (elog:119)
SampleCurrentGain.write("L, 10^5")
RefCurrentGain.write("L, 10^7")
FrontendHSize.write(6.5)
FrontendVSize.write(10.4)
ExitSlit.write(100.0)
# G1200 1x1 reference sscan_2264 (elog:114)
#SampleCurrentGain.write("L, 10^8")
#RefCurrentGain.write("L, 10^9")
#FrontendHSize.write(1.5)
#FrontendVSize.write(1.4)
#ExitSlit.write(100.0)
# G1200 6x10 reference sscan_2266 (elog:116)
#SampleCurrentGain.write("L, 10^6")
#RefCurrentGain.write("L, 10^8")
#FrontendHSize.write(6.5)
#FrontendVSize.write(10.4)
#ExitSlit.write(100.0)
def trig():
wait_beam()
caput("X03DA-OP-10ADC:TRG.PROC", 1)
value = DWELL * 10.0
SampleCurrentAveraging.write(value)
RefCurrentAveraging.write(value)
POSITIONERS = (Eph)
SENSORS = (SampleCurrent, RefCurrent, MachineCurrent)
lscan(POSITIONERS, SENSORS, STARTPOS, ENDPOS, STEPS, LATENCY, before_read=trig, after_read=after_readout)

View File

@@ -7,7 +7,7 @@ manual settings: photon energy 800 eV (G1200), FE = 1 x 1
POSITIONERS = (ExitSlitY)
SENSORS = (SampleCurrent, RefCurrent, AuxCurrent, MachineCurrent)
STARTPOS = (-0.5)
ENDPOS = (1.5)
ENDPOS = (1.0)
STEPS = 0.01
LATENCY = 0.1
DWELL = 1.0

View File

@@ -13,13 +13,9 @@ IMPLEMENTED:
* Beam loss: Repeat the last Scienta measurement when the beam is restored.
* Beam loss: Close/open the station shutter.
* Beam loss: Independent low and high trip levels.
* Beam loss: Beam loss actions are done only if beamline operation is set to "unattended"
* Beam loss: Beam can be okay only if beamline is "attended" or "unattended"
* Beam loss: Closed absorber or front end shutter will also trigger a beam loss
PLANNED:
* Update the data folder and file names according to the current date.
* Serve operation parameters as EPICS channels
TODO:
@@ -31,9 +27,8 @@ Created:
Copyright:
(c) 2013 Paul Scherrer Institut
$Id: scan_guard.py 43 2015-10-07 16:38:05Z muntwiler_m $
"""
import time
import logging
import epicsPV
@@ -803,17 +798,6 @@ class ScanGuard(object):
@ringcurrent_dead_band.setter
def ringcurrent_dead_band(self, value):
self._ringcurrent.dead_band = value
@property
def unattended_only(self):
"""
Scan guard is active during unattended operation only
"""
return self._beamline_mode.device_active
@unattended_only.setter
def unattended_only(self, value):
self._beamline_mode.device_active = value
def connect(self):
for monitor in self.monitors:
@@ -845,10 +829,6 @@ class ScanGuard(object):
self.test_start_seconds = time.time()
self.running = True
if self.unattended_only:
logging.info("guard active in unattended operation mode only")
else:
if self.test:
logging.info("test mode. simulated beam loss in %g seconds.", self.test_time_seconds)
@@ -907,14 +887,12 @@ def main():
def main():
nll = logging.INFO
logging.basicConfig(format="%(asctime)s %(levelname)s: %(message)s", level=nll)
logging.basicConfig(format="%(asctime)s %(levelname)s: %(message)s", level=nll)
logging.info("PEARL Scan Guard")
logging.info("version 1.1.3")
guard = ScanGuard()
guard.ringcurrent_trip_lo = 390.0
guard.ringcurrent_trip_hi = 410.0
guard.ringcurrent_dead_band = 1.0
guard.ringcurrent_trip_hi = 410.0
guard.ringcurrent_dead_band = 1.0
# True = block acquisition while beam is down, False = do not block (e.g. for He lamp measurements)
@@ -928,7 +906,11 @@ def main():
guard.mainloop()
except KeyboardInterrupt:
logging.info("scan guard aborted by user")
except:
except:
print sys.exc_info()[1]
print "guard shutting down - measurements enabled"
global beam_ok
beam_ok = True