This commit is contained in:
2023-05-01 11:28:04 +02:00
parent 3a83f3cf34
commit abe3bcb19c
265 changed files with 28663 additions and 1295 deletions

BIN
script/test/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,759 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration xmlns="http://www.psi.ch/~ebner/models/scan/1.0" numberOfExecution="1" failOnSensorError="true">
<data format="txt" fileName="XAS_V_L1677_CN"/>
<variable name="K" value="0.0" description="Buffer K spacing for EXAFS k-spacing scans "/>
<variable name="N_cycles" value="0.0" description="Buffer N_cycles for EXAFS k-spacing scans "/>
<variable name="NINT" value="0.0" description="Counter for file number of Moche files"/>
<scan>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ShellAction" command="/sls/X07MB/data/settings/Scripts/GUI_X07MB/X_X07MB_fda_file_to_EPICS.sh ${FILENAME}" checkExitValue="false"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ShellAction" command="/sls/X07MB/data/settings/Scripts/GUI_X07MB/X_X07MB_fda_write_header.py &amp;" checkExitValue="false"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X07MB-OP2:START-CSMPL" value="0" operation="put" type="String" delay="0.05"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X07MB-SITORO:StopAll" value="1" operation="put" type="String" delay="0.05"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X07MB-SITORO:CollectMode" value="0" operation="put" type="String" delay="0.05"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X07MB-SITORO:CollectMode" value="0" operation="put" type="String" delay="0.05"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X07MB-SITORO:PresetReal" value="0" operation="put" type="String" delay="0.05"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X07MB-OP2:TOTAL-CYCLES" value="2" operation="put" type="String" delay="0.05"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X07MB-OP2:SMPL" value="1" operation="put" type="String" delay="0.7"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X07MB-ES1-PP2:VO5" value="0" operation="put" type="String" delay="0.01"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X07MB-OP-WV1:WT_SET" value="1" operation="put" type="String" delay="0.05"/>
<dimension zigzag="false" dataGroup="false">
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RegionPositioner" name="X07MB-OP-MO:E-SET" readback="X07MB-OP-MO:E-GET" settlingTime="0.2" id="Energy">
<region>
<preAction xsi:type="ChannelAction" channel="X07MB-OP2:TOTAL-CYCLES" value="5"/>
<start>5365.0</start>
<end>5460.0</end>
<stepSize>2.0</stepSize>
</region>
<region>
<preAction xsi:type="ChannelAction" channel="X07MB-OP2:TOTAL-CYCLES" value="5"/>
<start>5461.0</start>
<end>5520.0</end>
<stepSize>0.3</stepSize>
</region>
<region>
<preAction xsi:type="ChannelAction" channel="X07MB-OP2:TOTAL-CYCLES" value="5.0"/>
<start>3.83209893521</start>
<end>15.0</end>
<stepSize>0.05</stepSize>
<function>
<mapping xsi:type="VariableParameterMapping" name="K" variable="K_v"/>
<mapping xsi:type="ChannelParameterMapping" channel="X07MB-OP2:TOTAL-CYCLES" type="Double" variable="N_Cycles"/>
<script>
def calculate(parameter):
nc=N_Cycles.getValue()
nc=nc*1.01
N_Cycles.setValue(nc)
E_0=5465.0
h=6.626e-34
m=9.109e-31
k=parameter*1e10
K_v=k*1e-10
hk=(h/(2.*3.1415926))*k
E_joule=hk*hk / (2.*m)
E_eV=E_joule/1.6021e-19+E_0
return E_eV
</script>
</function>
</region>
</positioner>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X07MB-SITORO:EraseStart" value="1" operation="putq" type="String" timeout="1000.0" delay="0.075"/>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X07MB-OP2:SMPL" value="1" operation="put" type="String" timeout="1000.0" delay="0.1"/>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X07MB-OP2:SMPL-DONE" value="1" operation="wait" type="Integer" timeout="1000.0" delay="0.03"/>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X07MB-SITORO:StopAll" value="1" operation="put" type="String" timeout="1000.0" delay="0.05"/>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X07MB-SITORO:mca1.READ" value="1" operation="putq" type="String" timeout="1000.0" delay="0.05"/>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X07MB-SITORO:mca2.READ" value="1" operation="putq" type="String" timeout="1000.0" delay="0.05"/>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X07MB-SITORO:mca3.READ" value="1" operation="putq" type="String" timeout="1000.0" delay="0.05"/>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X07MB-SITORO:mca4.READ" value="1" operation="putq" type="String" timeout="1000.0" delay="0.05"/>
<guard>
<condition channel="ACOAU-ACCU:OP-MODE" value="6" type="Integer"/>
<condition channel="X07MA-FE-PH1:CLOSE4BL" value="1" type="Integer"/>
</guard>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-ES-MA1:ScanX.VAL" id="ScanX_set"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-ES-MA1:ScanY.VAL" id="ScanY_set"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-OP-SH2:size.VAL" id="SL2_hor_set"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-OP-SV2:size.VAL" id="SL2_vert_set"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-ES-RONTEC:TRX.VAL" id="DET_set"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-OP-MO:E-SET" id="Energy_set"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-OP-MO:BEAM-OFS" id="Mono_offset"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="ARIDI-PCT:CURRENT" id="I_SLS"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-OP2-SAI_07:MEAN" id="I0_KEITHLEY1"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-OP-KEITH1:setGain" id="KEITHLEY1_GAIN"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-OP2-SAI_08:MEAN" id="I1_KEITHLEY2"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-OP-KEITH2:setGain" id="KEITHLEY2_GAIN"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-OP2-SAI_06:MEAN" id="KEITHLEY3"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-OP-KEITH3:setGain" id="KEITHLEY3_GAIN"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-OP2-SAI_01:MEAN" id="KEITHLEY4_TEY"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-OP-KEITH4:setGain" id="KEITHLEY4_GAIN"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:mca1.R0" id="D1_PKa"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:mca1.R1" id="D1_VKa"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:mca1.R2" id="D1_FeKa"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:mca2.R0" id="D2_PKa"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:mca2.R1" id="D2_VKa"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:mca2.R2" id="D2_FeKa"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:mca3.R0" id="D3_PKa"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:mca3.R1" id="D3_VKa"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:mca3.R2" id="D3_FeKa"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:mca4.R0" id="D4_PKa"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:mca4.R1" id="D4_VKa"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:mca4.R2" id="D4_FeKa"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:dxp1:InputCountRate" id="D1_ICR"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:dxp1:OutputCountRate" id="D1_OCR"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:mca1.ELTM" id="DD1_ELTM"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:mca1.ERTM" id="DD1_ERTM"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:mca1.DTIM" id="DD1_DTIM"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:dxp2:InputCountRate" id="D2_ICR"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:dxp2:OutputCountRate" id="D2_OCR"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:mca2.ELTM" id="DD2_ELTM"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:mca2.ERTM" id="DD2_ERTM"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:mca2.DTIM" id="DD2_DTIM"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:dxp3:InputCountRate" id="D3_ICR"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:dxp3:OutputCountRate" id="D3_OCR"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:mca3.ELTM" id="DD3_ELTM"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:mca3.ERTM" id="DD3_ERTM"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:mca3.DTIM" id="DD3_DTIM"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:dxp4:InputCountRate" id="D4_ICR"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:dxp4:OutputCountRate" id="D4_OCR"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:mca4.ELTM" id="DD4_ELTM"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:mca4.ERTM" id="DD4_ERTM"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X07MB-SITORO:mca4.DTIM" id="DD4_DTIM"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ArrayDetector" arraySize="2048" name="X07MB-SITORO:mca1.VAL" id="Spec_1"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ArrayDetector" arraySize="2048" name="X07MB-SITORO:mca2.VAL" id="Spec_2"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ArrayDetector" arraySize="2048" name="X07MB-SITORO:mca3.VAL" id="Spec_3"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ArrayDetector" arraySize="2048" name="X07MB-SITORO:mca4.VAL" id="Spec_4"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Timestamp" id="TimeStamp"/>
</dimension>
<dimension>
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ArrayPositioner" name="X07MB-ES-MA1:ScanX.VAL" readback="X07MB-ES-MA1:ScanX.RBV" id="ScanX">
<positions> -9.705</positions>
</positioner>
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ArrayPositioner" name="X07MB-ES-MA1:ScanY.VAL" readback="X07MB-ES-MA1:ScanY.RBV" id="ScanY">
<positions> -21.5176</positions>
</positioner>
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ArrayPositioner" name="X07MB-OP-SH2:size.VAL" readback="X07MB-OP-SH2:size.RBV" id="SL2_hor">
<positions> 1.0</positions>
</positioner>
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ArrayPositioner" name="X07MB-OP-SV2:size.VAL" readback="X07MB-OP-SV2:size.RBV" id="SL2_vert">
<positions> 1.0</positions>
</positioner>
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ArrayPositioner" name="X07MB-ES-RONTEC:TRX.VAL" readback="X07MB-ES-RONTEC:TRX.RBV" id="DET">
<positions> 70.0</positions>
</positioner>
</dimension>
<postAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X07MB-OP2:START-CSMPL" value="1" operation="put" type="String" delay="0.1"/>
<postAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ShellAction" command="/sls/X07MB/data/settings/Scripts/GUI_X07MB/X_X07MB_write_filename_to_file.sh ${FILENAME} &amp;" exitValue="0"/>
<postAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X07MB-OP2:START-CSMPL" value="1" operation="put" type="String" delay="0.1"/>
<postAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X07MB-OP-WV1:WT_SET" value="0" operation="put" type="String" delay="0.1"/>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D1_TrueICR">
<mapping xsi:type="IDParameterMapping" refid="D1_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D1_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD1_ERTM" variable="d"/>
<script>import math
def process(b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR) &lt;&gt; 0:
box = TrueICR
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D2_TrueICR">
<mapping xsi:type="IDParameterMapping" refid="D2_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D2_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD2_ERTM" variable="d"/>
<script>import math
def process(b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR) &lt;&gt; 0:
box = TrueICR
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D3_TrueICR">
<mapping xsi:type="IDParameterMapping" refid="D3_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D3_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD3_ERTM" variable="d"/>
<script>import math
def process(b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR) &lt;&gt; 0:
box = TrueICR
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D4_TrueICR">
<mapping xsi:type="IDParameterMapping" refid="D4_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D4_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD4_ERTM" variable="d"/>
<script>import math
def process(b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR) &lt;&gt; 0:
box = TrueICR
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D1_PKa_corr">
<mapping xsi:type="IDParameterMapping" refid="D1_PKa" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="D1_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D1_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD1_ERTM" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D2_PKa_corr">
<mapping xsi:type="IDParameterMapping" refid="D2_PKa" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="D2_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D2_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD2_ERTM" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D3_PKa_corr">
<mapping xsi:type="IDParameterMapping" refid="D3_PKa" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="D3_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D3_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD3_ERTM" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D4_PKa_corr">
<mapping xsi:type="IDParameterMapping" refid="D4_PKa" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="D4_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D4_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD4_ERTM" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="PKa_sum_cps">
<mapping xsi:type="IDParameterMapping" refid="D1_PKa_corr" variable="D1_PKa_corr"/>
<mapping xsi:type="IDParameterMapping" refid="D2_PKa_corr" variable="D2_PKa_corr"/>
<mapping xsi:type="IDParameterMapping" refid="D3_PKa_corr" variable="D3_PKa_corr"/>
<mapping xsi:type="IDParameterMapping" refid="D4_PKa_corr" variable="D4_PKa_corr"/>
<script>import math
def process(D1_PKa_corr , D2_PKa_corr , D3_PKa_corr , D4_PKa_corr):
SUM_DET = 0.
SUM_DET = SUM_DET + D1_PKa_corr
SUM_DET = SUM_DET + D2_PKa_corr
SUM_DET = SUM_DET + D3_PKa_corr
SUM_DET = SUM_DET + D4_PKa_corr
return SUM_DET</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D1_VKa_corr">
<mapping xsi:type="IDParameterMapping" refid="D1_VKa" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="D1_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D1_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD1_ERTM" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D2_VKa_corr">
<mapping xsi:type="IDParameterMapping" refid="D2_VKa" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="D2_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D2_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD2_ERTM" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D3_VKa_corr">
<mapping xsi:type="IDParameterMapping" refid="D3_VKa" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="D3_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D3_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD3_ERTM" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D4_VKa_corr">
<mapping xsi:type="IDParameterMapping" refid="D4_VKa" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="D4_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D4_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD4_ERTM" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="VKa_sum_cps">
<mapping xsi:type="IDParameterMapping" refid="D1_VKa_corr" variable="D1_VKa_corr"/>
<mapping xsi:type="IDParameterMapping" refid="D2_VKa_corr" variable="D2_VKa_corr"/>
<mapping xsi:type="IDParameterMapping" refid="D3_VKa_corr" variable="D3_VKa_corr"/>
<mapping xsi:type="IDParameterMapping" refid="D4_VKa_corr" variable="D4_VKa_corr"/>
<script>import math
def process(D1_VKa_corr , D2_VKa_corr , D3_VKa_corr , D4_VKa_corr):
SUM_DET = 0.
SUM_DET = SUM_DET + D1_VKa_corr
SUM_DET = SUM_DET + D2_VKa_corr
SUM_DET = SUM_DET + D3_VKa_corr
SUM_DET = SUM_DET + D4_VKa_corr
return SUM_DET</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D1_FeKa_corr">
<mapping xsi:type="IDParameterMapping" refid="D1_FeKa" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="D1_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D1_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD1_ERTM" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D2_FeKa_corr">
<mapping xsi:type="IDParameterMapping" refid="D2_FeKa" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="D2_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D2_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD2_ERTM" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D3_FeKa_corr">
<mapping xsi:type="IDParameterMapping" refid="D3_FeKa" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="D3_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D3_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD3_ERTM" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D4_FeKa_corr">
<mapping xsi:type="IDParameterMapping" refid="D4_FeKa" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="D4_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D4_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD4_ERTM" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="FeKa_sum_cps">
<mapping xsi:type="IDParameterMapping" refid="D1_FeKa_corr" variable="D1_FeKa_corr"/>
<mapping xsi:type="IDParameterMapping" refid="D2_FeKa_corr" variable="D2_FeKa_corr"/>
<mapping xsi:type="IDParameterMapping" refid="D3_FeKa_corr" variable="D3_FeKa_corr"/>
<mapping xsi:type="IDParameterMapping" refid="D4_FeKa_corr" variable="D4_FeKa_corr"/>
<script>import math
def process(D1_FeKa_corr , D2_FeKa_corr , D3_FeKa_corr , D4_FeKa_corr):
SUM_DET = 0.
SUM_DET = SUM_DET + D1_FeKa_corr
SUM_DET = SUM_DET + D2_FeKa_corr
SUM_DET = SUM_DET + D3_FeKa_corr
SUM_DET = SUM_DET + D4_FeKa_corr
return SUM_DET</script>
</manipulation>
</scan>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Energy" y="D1_ICR D2_ICR D3_ICR D4_ICR D1_TrueICR D2_TrueICR D3_TrueICR D4_TrueICR" title="ICR "/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Energy" y="D1_OCR D2_OCR D3_OCR D4_OCR" title="OCR "/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Energy" y="D1_VKa" title="D1_VKa"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Energy" y="D2_VKa" title="D2_VKa"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Energy" y="D3_VKa" title="D3_VKa"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Energy" y="D4_VKa" title="D4_VKa"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Energy" y="D1_VKa_corr" title="D1_VKa_corr"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Energy" y="D2_VKa_corr" title="D2_VKa_corr"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Energy" y="D3_VKa_corr" title="D3_VKa_corr"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Energy" y="D4_VKa_corr" title="D4_VKa_corr"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Energy" y="I0_KEITHLEY1" title="KEITHLEY1 (I0)=f(Energy)"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Energy" y="I1_KEITHLEY2" title="KEITHLEY2 (I1)=f(Energy)"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Energy" y="KEITHLEY3" title="KEITHLEY3=f(Energy)"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Energy" y="KEITHLEY4_TEY" title="KEITHLEY4_TEY=f(Energy)"/>
</configuration>

22
script/test/BugJep2.py Normal file
View File

@@ -0,0 +1,22 @@
writables=inp
readables= (sin,out)
start = 0
end =40
steps =50
latency=0.2
relative=False
passes=1
zigzag=False
latency_ms=int(latency*1000)
writables=to_list(string_to_obj(writables))
readables=to_list(string_to_obj(readables))
#start=to_list(start)
#end=to_list(end)
if type(steps) is float or is_list(steps):
steps = to_list(steps)
scan = scans.LineScan(writables,readables, start, end , steps, relative, latency_ms, int(passes), zigzag)
processScanPars(scan, pars)
scan.start()
ret= scan.getResult()

733
script/test/BugPhenix.xml Normal file
View File

@@ -0,0 +1,733 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration xmlns="http://www.psi.ch/~ebner/models/scan/1.0" numberOfExecution="1" failOnSensorError="true">
<data format="txt" fileName="XAS_V_L1677_CN"/>
<variable name="K" value="0.0" description="Buffer K spacing for EXAFS k-spacing scans "/>
<variable name="N_cycles" value="0.0" description="Buffer N_cycles for EXAFS k-spacing scans "/>
<variable name="NINT" value="0.0" description="Counter for file number of Moche files"/>
<scan>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ShellAction" command="/bin/ls" checkExitValue="false"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ShellAction" command="/bin/ls" checkExitValue="false"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Output" value="0" operation="put" type="String" delay="0.05"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Output" value="1" operation="put" type="String" delay="0.05"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Output" value="0" operation="put" type="String" delay="0.05"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Output" value="0" operation="put" type="String" delay="0.05"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Output" value="0" operation="put" type="String" delay="0.05"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Output" value="2" operation="put" type="String" delay="0.05"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Output" value="1" operation="put" type="String" delay="0.07"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Output" value="0" operation="put" type="String" delay="0.01"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Output" value="1" operation="put" type="String" delay="0.05"/>
<dimension zigzag="false" dataGroup="false">
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RegionPositioner" name="TESTIOC:TESTCALCOUT:Input" readback="TESTIOC:TESTCALCOUT:Input" settlingTime="0.3" id="Energy">
<region>
<preAction xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Output" value="1"/>
<start>1.0</start>
<end>2.0</end>
<stepSize>0.2</stepSize>
</region>
<region>
<preAction xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Output" value="1"/>
<start>2.0</start>
<end>3.0</end>
<stepSize>0.3</stepSize>
</region>
<region>
<start>4.0</start>
<end>5.0</end>
<stepSize>0.4</stepSize>
</region>
</positioner>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Output" value="1" operation="put" type="String" timeout="1000.0" delay="0.1"/>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Output" value="1" operation="wait" type="Integer" timeout="1000.0" delay="0.03"/>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Output" value="1" operation="put" type="String" timeout="1000.0" delay="0.05"/>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Output" value="1" operation="putq" type="String" timeout="1000.0" delay="0.05"/>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Output" value="1" operation="putq" type="String" timeout="1000.0" delay="0.05"/>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Output" value="1" operation="putq" type="String" timeout="1000.0" delay="0.05"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="ScanX_set"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="ScanY_set"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="SL2_hor_set"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="SL2_vert_set"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="DET_set"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="Energy_set"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="Mono_offset"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="I_SLS"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="I0_KEITHLEY1"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="KEITHLEY1_GAIN"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="I1_KEITHLEY2"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="KEITHLEY2_GAIN"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="KEITHLEY3"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="KEITHLEY3_GAIN"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="KEITHLEY4_TEY"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="KEITHLEY4_GAIN"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="D1_PKa"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="D1_VKa"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="D1_FeKa"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="D2_PKa"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="D2_VKa"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="D2_FeKa"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="D3_PKa"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="D3_VKa"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="D3_FeKa"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="D4_PKa"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="D4_VKa"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="D4_FeKa"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="D1_ICR"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="D1_OCR"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="DD1_ELTM"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="DD1_ERTM"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="DD1_DTIM"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="D2_ICR"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="D2_OCR"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="DD2_ELTM"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="DD2_ERTM"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="DD2_DTIM"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="D3_ICR"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="D3_OCR"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="DD3_ELTM"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="DD3_ERTM"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="DD3_DTIM"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="D4_ICR"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="D4_OCR"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="DD4_ELTM"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="DD4_ERTM"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="DD4_DTIM"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ArrayDetector" arraySize="10" name="TESTIOC:TESTWF2:MyWF" id="Spec_1"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ArrayDetector" arraySize="10" name="TESTIOC:TESTWF2:MyWF" id="Spec_2"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ArrayDetector" arraySize="10" name="TESTIOC:TESTWF2:MyWF" id="Spec_3"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ArrayDetector" arraySize="10" name="TESTIOC:TESTWF2:MyWF" id="Spec_4"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Timestamp" id="TimeStamp"/>
</dimension>
<dimension>
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ArrayPositioner" name="TESTIOC:TESTCALCOUT:Output" readback="TESTIOC:TESTCALCOUT:Output" id="ScanX">
<positions> 1.0</positions>
</positioner>
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ArrayPositioner" name="TESTIOC:TESTCALCOUT:Output" readback="TESTIOC:TESTCALCOUT:Output" id="ScanY">
<positions> 1.0</positions>
</positioner>
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ArrayPositioner" name="TESTIOC:TESTCALCOUT:Output" readback="TESTIOC:TESTCALCOUT:Output" id="SL2_hor">
<positions> 1.0</positions>
</positioner>
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ArrayPositioner" name="TESTIOC:TESTCALCOUT:Output" readback="TESTIOC:TESTCALCOUT:Output" id="SL2_vert">
<positions> 1.0</positions>
</positioner>
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ArrayPositioner" name="TESTIOC:TESTCALCOUT:Output" readback="TESTIOC:TESTCALCOUT:Output" id="DET">
<positions> 1.0</positions>
</positioner>
</dimension>
<postAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Output" value="1" operation="put" type="String" delay="0.1"/>
<postAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ShellAction" command="/bin/ls" exitValue="0"/>
<postAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Output" value="1" operation="put" type="String" delay="0.1"/>
<postAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Output" value="0" operation="put" type="String" delay="0.1"/>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D1_TrueICR">
<mapping xsi:type="IDParameterMapping" refid="D1_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D1_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD1_ERTM" variable="d"/>
<script>import math
def process(b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR) &lt;&gt; 0:
box = TrueICR
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D2_TrueICR">
<mapping xsi:type="IDParameterMapping" refid="D2_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D2_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD2_ERTM" variable="d"/>
<script>import math
def process(b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR) &lt;&gt; 0:
box = TrueICR
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D3_TrueICR">
<mapping xsi:type="IDParameterMapping" refid="D3_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D3_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD3_ERTM" variable="d"/>
<script>import math
def process(b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR) &lt;&gt; 0:
box = TrueICR
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D4_TrueICR">
<mapping xsi:type="IDParameterMapping" refid="D4_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D4_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD4_ERTM" variable="d"/>
<script>import math
def process(b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR) &lt;&gt; 0:
box = TrueICR
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D1_PKa_corr">
<mapping xsi:type="IDParameterMapping" refid="D1_PKa" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="D1_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D1_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD1_ERTM" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D2_PKa_corr">
<mapping xsi:type="IDParameterMapping" refid="D2_PKa" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="D2_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D2_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD2_ERTM" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D3_PKa_corr">
<mapping xsi:type="IDParameterMapping" refid="D3_PKa" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="D3_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D3_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD3_ERTM" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D4_PKa_corr">
<mapping xsi:type="IDParameterMapping" refid="D4_PKa" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="D4_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D4_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD4_ERTM" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="PKa_sum_cps">
<mapping xsi:type="IDParameterMapping" refid="D1_PKa_corr" variable="D1_PKa_corr"/>
<mapping xsi:type="IDParameterMapping" refid="D2_PKa_corr" variable="D2_PKa_corr"/>
<mapping xsi:type="IDParameterMapping" refid="D3_PKa_corr" variable="D3_PKa_corr"/>
<mapping xsi:type="IDParameterMapping" refid="D4_PKa_corr" variable="D4_PKa_corr"/>
<script>import math
def process(D1_PKa_corr , D2_PKa_corr , D3_PKa_corr , D4_PKa_corr):
SUM_DET = 0.
SUM_DET = SUM_DET + D1_PKa_corr
SUM_DET = SUM_DET + D2_PKa_corr
SUM_DET = SUM_DET + D3_PKa_corr
SUM_DET = SUM_DET + D4_PKa_corr
return SUM_DET</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D1_VKa_corr">
<mapping xsi:type="IDParameterMapping" refid="D1_VKa" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="D1_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D1_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD1_ERTM" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D2_VKa_corr">
<mapping xsi:type="IDParameterMapping" refid="D2_VKa" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="D2_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D2_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD2_ERTM" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D3_VKa_corr">
<mapping xsi:type="IDParameterMapping" refid="D3_VKa" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="D3_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D3_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD3_ERTM" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D4_VKa_corr">
<mapping xsi:type="IDParameterMapping" refid="D4_VKa" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="D4_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D4_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD4_ERTM" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="VKa_sum_cps">
<mapping xsi:type="IDParameterMapping" refid="D1_VKa_corr" variable="D1_VKa_corr"/>
<mapping xsi:type="IDParameterMapping" refid="D2_VKa_corr" variable="D2_VKa_corr"/>
<mapping xsi:type="IDParameterMapping" refid="D3_VKa_corr" variable="D3_VKa_corr"/>
<mapping xsi:type="IDParameterMapping" refid="D4_VKa_corr" variable="D4_VKa_corr"/>
<script>import math
def process(D1_VKa_corr , D2_VKa_corr , D3_VKa_corr , D4_VKa_corr):
SUM_DET = 0.
SUM_DET = SUM_DET + D1_VKa_corr
SUM_DET = SUM_DET + D2_VKa_corr
SUM_DET = SUM_DET + D3_VKa_corr
SUM_DET = SUM_DET + D4_VKa_corr
return SUM_DET</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D1_FeKa_corr">
<mapping xsi:type="IDParameterMapping" refid="D1_FeKa" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="D1_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D1_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD1_ERTM" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D2_FeKa_corr">
<mapping xsi:type="IDParameterMapping" refid="D2_FeKa" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="D2_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D2_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD2_ERTM" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D3_FeKa_corr">
<mapping xsi:type="IDParameterMapping" refid="D3_FeKa" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="D3_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D3_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD3_ERTM" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="D4_FeKa_corr">
<mapping xsi:type="IDParameterMapping" refid="D4_FeKa" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="D4_ICR" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="D4_OCR" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="DD4_ERTM" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = -1.0
return box
if (ICR) == 0:
box = -2.0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
try:
TrueICR = ICR * math.exp(TestICR * DeadTime)
except:
TrueICR = -10.
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=-3.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="FeKa_sum_cps">
<mapping xsi:type="IDParameterMapping" refid="D1_FeKa_corr" variable="D1_FeKa_corr"/>
<mapping xsi:type="IDParameterMapping" refid="D2_FeKa_corr" variable="D2_FeKa_corr"/>
<mapping xsi:type="IDParameterMapping" refid="D3_FeKa_corr" variable="D3_FeKa_corr"/>
<mapping xsi:type="IDParameterMapping" refid="D4_FeKa_corr" variable="D4_FeKa_corr"/>
<script>import math
def process(D1_FeKa_corr , D2_FeKa_corr , D3_FeKa_corr , D4_FeKa_corr):
SUM_DET = 0.
SUM_DET = SUM_DET + D1_FeKa_corr
SUM_DET = SUM_DET + D2_FeKa_corr
SUM_DET = SUM_DET + D3_FeKa_corr
SUM_DET = SUM_DET + D4_FeKa_corr
return SUM_DET</script>
</manipulation>
</scan>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Energy" y="D1_ICR D2_ICR D3_ICR D4_ICR D1_TrueICR D2_TrueICR D3_TrueICR D4_TrueICR" title="ICR "/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Energy" y="D1_OCR D2_OCR D3_OCR D4_OCR" title="OCR "/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Energy" y="D1_VKa" title="D1_VKa"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Energy" y="D2_VKa" title="D2_VKa"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Energy" y="D3_VKa" title="D3_VKa"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Energy" y="D4_VKa" title="D4_VKa"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Energy" y="D1_VKa_corr" title="D1_VKa_corr"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Energy" y="D2_VKa_corr" title="D2_VKa_corr"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Energy" y="D3_VKa_corr" title="D3_VKa_corr"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Energy" y="D4_VKa_corr" title="D4_VKa_corr"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Energy" y="I0_KEITHLEY1" title="KEITHLEY1 (I0)=f(Energy)"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Energy" y="I1_KEITHLEY2" title="KEITHLEY2 (I1)=f(Energy)"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Energy" y="KEITHLEY3" title="KEITHLEY3=f(Energy)"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Energy" y="KEITHLEY4_TEY" title="KEITHLEY4_TEY=f(Energy)"/>
</configuration>

249
script/test/BugSuperXAS.xml Normal file
View File

@@ -0,0 +1,249 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration xmlns="http://www.psi.ch/~ebner/models/scan/1.0" numberOfExecution="1" failOnSensorError="true">
<data format="txt" fileName="Au_calib"/>
<scan>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Input" value="0" delay="0.1"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Input" value="0" operation="put" type="String" delay="0.1"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Input" value="0" operation="put" type="String" delay="0.1"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Input" value="0" delay="0.1"/>
<dimension zigzag="false" dataGroup="false">
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RegionPositioner" name="TESTIOC:TESTCALCOUT:Input" readback="TESTIOC:TESTCALCOUT:Input" settlingTime="0.3" doneDelay="0.3" asynchronous="false" id="posX">
<region>
<preAction xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Output" value="2" operation="put" type="Integer"/>
<start>-8.0</start>
<end>0.0</end>
<stepSize>1.2</stepSize>
</region>
</positioner>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Output" value="1" operation="putq" delay="0.1"/>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Output" value="1" operation="putq"/>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Output" value="1" delay="0.6"/>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Output" value="1" operation="wait" type="Integer" delay="0.2"/>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Output" value="1" delay="0.1"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="Fluo-Ketek1"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="SAI01-MEAN"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="SAI02-MEAN"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="SAI03-MEAN"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="Ring-current"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="IntegrTimeSet"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="IntegrTimeGet"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Timestamp" id="Timestamp"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="dead_time"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="Fluo-Ketek2"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="Sca1"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ScaICR1"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ScaOCR1"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ERTM1"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="Sca2"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ScaICR2"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ScaOCR2"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ERTM2"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="Sca3"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ScaICR3"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ScaOCR3"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ERTM3"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="Sca4"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ScaICR4"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ScaOCR4"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ERTM4"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="Sca5"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ScaICR5"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ScaOCR5"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ERTM5"/>
</dimension>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" returnArray="false" id="TrueFluoChannel1">
<mapping xsi:type="IDParameterMapping" refid="Sca1" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="ScaICR1" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="ScaOCR1" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="ERTM1" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = 0
return box
if (ICR) == 0:
box = 0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
TrueICR = ICR * math.exp(TestICR * DeadTime)
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=0.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" returnArray="false" id="TrueFluoChannel2">
<mapping xsi:type="IDParameterMapping" refid="Sca2" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="ScaICR2" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="ScaOCR2" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="ERTM2" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = 0
return box
if (ICR) == 0:
box = 0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
TrueICR = ICR * math.exp(TestICR * DeadTime)
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=0.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" returnArray="false" id="TrueFluoChannel3">
<mapping xsi:type="IDParameterMapping" refid="Sca3" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="ScaICR3" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="ScaOCR3" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="ERTM3" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = 0
return box
if (ICR) == 0:
box = 0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
TrueICR = ICR * math.exp(TestICR * DeadTime)
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=0.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" returnArray="false" id="TrueFluoChannel4">
<mapping xsi:type="IDParameterMapping" refid="Sca4" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="ScaICR4" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="ScaOCR4" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="ERTM4" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = 0
return box
if (ICR) == 0:
box = 0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
TrueICR = ICR * math.exp(TestICR * DeadTime)
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=0.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" returnArray="false" id="TrueFluoChannel5">
<mapping xsi:type="IDParameterMapping" refid="Sca5" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="ScaICR5" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="ScaOCR5" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="ERTM5" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = 0
return box
if (ICR) == 0:
box = 0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
TrueICR = ICR * math.exp(TestICR * DeadTime)
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=0.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" returnArray="false" id="TotalFluo">
<mapping xsi:type="IDParameterMapping" refid="TrueFluoChannel1" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="TrueFluoChannel2" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="TrueFluoChannel3" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="TrueFluoChannel4" variable="d"/>
<mapping xsi:type="IDParameterMapping" refid="TrueFluoChannel5" variable="e"/>
<script>import math
def process(a,b,c,d,e):
SUM_DET = 0.
SUM_DET = SUM_DET + a
SUM_DET = SUM_DET + b
SUM_DET = SUM_DET + c
SUM_DET = SUM_DET + d
SUM_DET = SUM_DET + e
return SUM_DET</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" returnArray="false" id="TotalFluoXAS">
<mapping xsi:type="IDParameterMapping" refid="TotalFluo" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="SAI01-MEAN" variable="d"/>
<script>import math
def process(c,d):
return c/d</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" returnArray="false" id="XAS-refer">
<mapping xsi:type="IDParameterMapping" refid="SAI01-MEAN" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="SAI02-MEAN" variable="b"/>
<script>import math
def process(a,b):
return math.log(math.fabs(a) /math.fabs(b))</script>
</manipulation>
</scan>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="posX" y="SAI01-MEAN" title=" I0"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="posX" y="SAI02-MEAN" title=" I1"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="posX" y="XAS-refer" title=" XAS-trans"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="posX" y="TotalFluoXAS" title="XAS-Fluo"/>
</configuration>

View File

@@ -0,0 +1,250 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration xmlns="http://www.psi.ch/~ebner/models/scan/1.0" numberOfExecution="1" failOnSensorError="true">
<data format="txt" fileName="Au_calib"/>
<scan>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X10DA-SITORO:CollectMode" value="0" delay="0.1"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X10DA-ES1:START-CSMPL" value="0" operation="put" type="String" delay="0.1"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X10DA-OP-MO3:KohzuModeBO.VAL" value="Auto" operation="put" type="String" delay="0.1"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X10DA-SITORO:PresetReal" value="0" delay="0.1"/>
<dimension zigzag="false" dataGroup="false">
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RegionPositioner" name="X10DA-ES1-MA1:TRX" readback="X10DA-ES1-MA1:TRX.VAL" settlingTime="0.3" doneDelay="0.3" asynchronous="false" id="posX">
<region>
<preAction xsi:type="ChannelAction" channel="X10DA-ES1:TOTAL-CYCLES" value="2" operation="put" type="Integer"/>
<start>-8.0</start>
<end>0.0</end>
<stepSize>0.2</stepSize>
</region>
</positioner>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X10DA-SITORO:EraseStart" value="1" operation="putq" delay="0.1"/>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X10DA-SITORO:Acquiring" value="Acquiring" operation="wait"/>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X10DA-ES1:SMPL" value="1" delay="0.6"/>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X10DA-ES1:SMPL-DONE" value="1" operation="wait" type="Integer" delay="0.2"/>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X10DA-SITORO:StopAll" value="1" delay="0.1"/>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X10DA-SITORO:Acquiring" value="Done" operation="wait"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="X10DA-SITORO:CNT1_R0" id="Fluo-Ketek1"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="X10DA-ES1-SAI_01:MEAN" id="SAI01-MEAN"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X10DA-ES1-SAI_02:MEAN" id="SAI02-MEAN"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X10DA-ES1-SAI_03:MEAN" id="SAI03-MEAN"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="ARIDI-PCT:CURRENT" id="Ring-current"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X10DA-ES1:TOTAL-CYCLES" id="IntegrTimeSet"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="X10DA-ES1:INTR-COUNT" id="IntegrTimeGet"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Timestamp" id="Timestamp"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="X10DA-SITORO:mca1.DTIM" id="dead_time"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="X10DA-SITORO:CNT2_R0" id="Fluo-Ketek2"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="X10DA-SITORO:mca1.R0" id="Sca1"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="X10DA-SITORO:dxp1:InputCountRate" id="ScaICR1"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="X10DA-SITORO:dxp1:OutputCountRate" id="ScaOCR1"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="X10DA-SITORO:mca1.ERTM" id="ERTM1"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="X10DA-SITORO:mca2.R0" id="Sca2"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="X10DA-SITORO:dxp2:InputCountRate" id="ScaICR2"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="X10DA-SITORO:dxp2:OutputCountRate" id="ScaOCR2"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="X10DA-SITORO:mca2.ERTM" id="ERTM2"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="X10DA-SITORO:mca3.R0" id="Sca3"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="X10DA-SITORO:dxp3:InputCountRate" id="ScaICR3"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="X10DA-SITORO:dxp2:OutputCountRate" id="ScaOCR3"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="X10DA-SITORO:mca3.ERTM" id="ERTM3"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="X10DA-SITORO:mca4.R0" id="Sca4"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="X10DA-SITORO:dxp4:InputCountRate" id="ScaICR4"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="X10DA-SITORO:dxp4:OutputCountRate" id="ScaOCR4"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="X10DA-SITORO:mca4.ERTM" id="ERTM4"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="X10DA-SITORO:mca5.R0" id="Sca5"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="X10DA-SITORO:dxp5:InputCountRate" id="ScaICR5"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="X10DA-SITORO:dxp5:OutputCountRate" id="ScaOCR5"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="X10DA-SITORO:mca5.ERTM" id="ERTM5"/>
</dimension>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" returnArray="false" id="TrueFluoChannel1">
<mapping xsi:type="IDParameterMapping" refid="Sca1" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="ScaICR1" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="ScaOCR1" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="ERTM1" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = 0
return box
if (ICR) == 0:
box = 0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
TrueICR = ICR * math.exp(TestICR * DeadTime)
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=0.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" returnArray="false" id="TrueFluoChannel2">
<mapping xsi:type="IDParameterMapping" refid="Sca2" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="ScaICR2" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="ScaOCR2" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="ERTM2" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = 0
return box
if (ICR) == 0:
box = 0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
TrueICR = ICR * math.exp(TestICR * DeadTime)
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=0.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" returnArray="false" id="TrueFluoChannel3">
<mapping xsi:type="IDParameterMapping" refid="Sca3" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="ScaICR3" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="ScaOCR3" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="ERTM3" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = 0
return box
if (ICR) == 0:
box = 0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
TrueICR = ICR * math.exp(TestICR * DeadTime)
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=0.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" returnArray="false" id="TrueFluoChannel4">
<mapping xsi:type="IDParameterMapping" refid="Sca4" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="ScaICR4" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="ScaOCR4" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="ERTM4" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = 0
return box
if (ICR) == 0:
box = 0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
TrueICR = ICR * math.exp(TestICR * DeadTime)
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=0.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" returnArray="false" id="TrueFluoChannel5">
<mapping xsi:type="IDParameterMapping" refid="Sca5" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="ScaICR5" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="ScaOCR5" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="ERTM5" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = 0
return box
if (ICR) == 0:
box = 0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
TrueICR = ICR * math.exp(TestICR * DeadTime)
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=0.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" returnArray="false" id="TotalFluo">
<mapping xsi:type="IDParameterMapping" refid="TrueFluoChannel1" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="TrueFluoChannel2" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="TrueFluoChannel3" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="TrueFluoChannel4" variable="d"/>
<mapping xsi:type="IDParameterMapping" refid="TrueFluoChannel5" variable="e"/>
<script>import math
def process(a,b,c,d,e):
SUM_DET = 0.
SUM_DET = SUM_DET + a
SUM_DET = SUM_DET + b
SUM_DET = SUM_DET + c
SUM_DET = SUM_DET + d
SUM_DET = SUM_DET + e
return SUM_DET</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" returnArray="false" id="TotalFluoXAS">
<mapping xsi:type="IDParameterMapping" refid="TotalFluo" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="SAI01-MEAN" variable="d"/>
<script>import math
def process(c,d):
return c/d</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" returnArray="false" id="XAS-refer">
<mapping xsi:type="IDParameterMapping" refid="SAI01-MEAN" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="SAI02-MEAN" variable="b"/>
<script>import math
def process(a,b):
return math.log(math.fabs(a) /math.fabs(b))</script>
</manipulation>
</scan>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="posX" y="SAI01-MEAN" title=" I0"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="posX" y="SAI02-MEAN" title=" I1"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="posX" y="XAS-refer" title=" XAS-trans"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="posX" y="TotalFluoXAS" title="XAS-Fluo"/>
</configuration>

View File

@@ -0,0 +1,6 @@
st= Stream("st", "tcp://localhost:5554", SocketType.SUB)
m=st.addMatrix("image")
st.initialize()
st.start(True)
show_panel(m)

View File

@@ -0,0 +1,8 @@
from ijutils import *
ip_list = []
for index in range(40,49):
ip_list.append(open_image(expand_path("{images}/TestObjAligner/i210517_0" + str(index) + "#001.tif")))
stack = create_stack(ip_list, title = "Test")

32
script/test/TSTIMGSIM3.py Normal file
View File

@@ -0,0 +1,32 @@
import traceback
run ("imaging/sim")
show=True
stack = load_test_stack(show=False)
shifts= load_shifts("{images}/TestObjAligner/shifts.mat")
if show:
ret.show()
ret.updateAndDraw()
#stack = load_test_stack(show=True)
#get_context().getPluginManager().loadInitializePlugin("Align_TranslationFilter.java")
#translation_filter = get_context().getClassByName("Align_TranslationFilter").newInstance()
#shifts= load_shifts("{images}/TestObjAligner/shifts.mat")
"""
translation_filter.shifts = shifts
pfr = PlugInFilterRunner(translation_filter, "", "" )
ret = translation_filter.output
if show:
ret.show()
ret.updateAndDraw()
#stack = load_test_stack(show=False)
#r=translate(stack, shifts, True, java_code=True)
"""
#translate(stack, shifts, show=True, java_code=True)

14
script/test/Test2DCont.py Normal file
View File

@@ -0,0 +1,14 @@
STEPS = 10
class Line(ReadonlyRegisterBase):
def doRead(self):
r1 = cscan(m1, (ai1), 0.0, 1.0 , steps=STEPS, save=False)
return r1[ai1]
def getSize(self):
return STEPS+1
line=Line()
lscan(ai2, line, 0, 10, 1.0)

View File

@@ -0,0 +1,24 @@
#av=create_averager(arr,1,)
#print av.sum.read()
#tscan(av.sum, 10,0.1)
#CHANNEL_NAME= "TESTIOC:TESTWF2:MyWF"
#tscan("ca://" + CHANNEL_NAME + "?op=sum", 10, 1.0)
#av=create_averager(arr,1,)
#print av.sum.read()
#tscan(av.sum, 10,0.1)
s = ArrayRegisterStats(arr.cache).sum
s.asyncUpdate=True
tscan((arr,s), 10,1.0)
#plot(ars.sum.read())

View File

@@ -0,0 +1,10 @@
class StringChannel(RegisterBase):
def doRead(self):
return self.val if hasattr(self, 'val') else ""
def doWrite(self, val):
self.val = val
reg=StringChannel()
reg.initialize()
cas3 = CAS("TESTCAS:CH", reg, 'string')

View File

@@ -0,0 +1,47 @@
run("CPython/wrapper")
x=[0,1,2,3,4,5,6,7,8,9]
y=[1,2,3,6,9,6,3,2,1,0]
#(p, x_fit, y_fit, R2) = linfit(x,y)
#plot((y,y_fit), name=("data", "fit"),xdata=(x,x_fit))
#x=to_array(x,'f')
#y=to_array(y,'f')
def _from_npa(obj):
if isinstance(obj, jep.NDArray):
ret = obj.data
if len(obj.dimensions)>1:
ret=Convert.reshape(ret, obj.dimensions)
return ret
if isinstance(obj, java.util.List) or isinstance(obj,tuple) or isinstance(obj,list):
ret=[]
for i in range(len(obj)):
ret.append(_from_npa(obj[i]))
if isinstance(obj,tuple):
return type(ret)
return ret
return obj
def _to_npa(obj):
if isinstance(obj, PyArray):
return to_npa(obj, dimensions = Arr.getShape(obj))
if isinstance(obj, java.util.List) or isinstance(obj,tuple) or isinstance(obj,list):
ret=[]
for i in range(len(obj)):
ret.append(_to_npa(obj[i]))
if isinstance(obj,tuple):
return tuple(ret)
return ret
return obj
def call_py(module, function, *args):
print _to_npa(args)
ret = call_jep(module, function, _to_npa(args))
return _from_npa(ret)
#ret = call_py("CPython/linfit", "linfit",x,y)
(p, x_fit, y_fit, R2) = call_py("CPython/linfit", "linfit",x,y)
#(p, x_fit, y_fit, R2) = linfit(x,y)
plot((y,y_fit), name=("data", "fit"),xdata=(x,x_fit))

1
script/test/TestCmd.py Normal file
View File

@@ -0,0 +1 @@
exec_cmd("ls")

View File

@@ -0,0 +1,31 @@
###################################################################################################
# This is an option to implement a 2D continuous scan
###################################################################################################
STEPS_M1 = 10
STEPS_M2 = 5
class Sensor(ReadableArray):
def read(self):
r1 = cscan(m1, (ai1), 0.0, 1.0 , steps=STEPS_M1, save=False, display=False)
return r1[ai1]
def getSize(self):
return STEPS_M1+1
def getName(self):
return "sensor"
"""
p = plot(None, title="2d Plot")[0]
def after_read(record, scan):
if record.setpoints[1] == scan.getStart()[1]:
p.addSeries(LinePlotSeries(str(record[ao1])))
p.getSeries(p.numberOfSeries-1).appendData(record[ao2], record[ai1])
"""
set_exec_pars(print_scan=True)
#lscan(m2, Sensor(), 0, 1.0, STEPS_M2, after_read=after_read)
s1=Sensor()
lscan(m2, s1, 0, 1.0, STEPS_M2)

24
script/test/TestConfig.py Normal file
View File

@@ -0,0 +1,24 @@
#Jython BUG: Sometimes getConfig(self) won'' override ProcessVariableBase.getConfig.
#E.g.: energy.getUnit() fails (calls getConfig)
#But energy.getConfig() works
class Energy(ControlledVariableBase):
def __init__(self, name):
ControlledVariableBase.__init__(self, name, None)
self.setReadback(phi.readback)
def doRead(self):
return phi.read()
def doWrite(self, val):
print "Do something"
phi.write(val)
def getConfig(self):
print "Get"
return phi.getConfig()
add_device(Energy("energy",), True)

View File

@@ -4,7 +4,7 @@
#Creating a 1D dataset from an array
path="group/data1"
path="data1"
data1d = [1.0, 2.0, 3.0, 4.0, 5.0]
save_dataset(path, data1d)
#Reading ii back
@@ -15,7 +15,7 @@ plot(read)
#Creating a 2D dataset from an array with some attributes
data2d = [ [1.0, 2.0, 3.0, 4.0, 5.0], [2.0, 3.0, 4.0, 5.0, 6.0, ], [3.0, 4.0, 5.0, 6.0, 7.0]]
path="group/data2"
path="data2"
save_dataset(path, data2d)
set_attribute(path, "AttrString", "Value")
set_attribute(path, "AttrInteger", 1)
@@ -28,7 +28,7 @@ plot(read)
#Creating a 3D dataset from an array
data3d = [ [ [1,2,3,4,5], [2,3,4,5,6], [3,4,5,6,7]], [ [3,2,3,4,5], [4,3,4,5,6], [5,4,5,6,7]]]
path="group/data3"
path="data3"
save_dataset(path, data3d)
#Reading it back
read =load_data(path,0)
@@ -37,28 +37,28 @@ read =load_data(path,1)
print read.tolist()
#Creating a INT dataset adding elements one by one
path = "group/data4"
path = "data4"
create_dataset(path, 'i')
for i in range(10):
append_dataset(path,i)
#Creating a 2D data FLOAT dataset adding lines one by one
path = "group/data5"
path = "data5"
create_dataset(path, 'd', False, (0,0))
for row in data2d:
append_dataset(path, row)
#Creating a Table (compund type)
path = "group/data6"
path = "data6"
names = ["a", "b", "c", "d"]
types = ["d", "d", "d", "[d"]
table_types = ["d", "d", "d", "[d"]
lenghts = [0,0,0,5]
table = [ [1,2,3,[0,1,2,3,4]],
[2,3,4,[3,4,5,6,7]],
[3,4,5,[6,7,8,9,4]] ]
create_table(path, names, types, lenghts)
create_table(path, names, table_types, lenghts)
for row in table:
append_table(path, row)
flush_data()
@@ -68,11 +68,11 @@ print read
#Writing scalars (datasets with rank 0)
save_dataset("group/val1", 1)
save_dataset("group/val2", 3.14)
save_dataset("group/val3", "test")
print load_data("group/val1")
print load_data("group/val2")
print load_data("group/val3")
save_dataset("val1", 1)
save_dataset("val2", 3.14)
save_dataset("val3", "test")
print load_data("val1")
print load_data("val2")
print load_data("val3")

View File

@@ -0,0 +1,14 @@
scale_min=100
scale_max=150
colormap = Colormap.Temperature #Colormap.Grayscale
while(True):
try:
i=image.data.toBufferedImage(scale_min, scale_max, colormap, False)
show_panel(i)
except:
print sys.exc_info()[2]
break
time.sleep(1.0)

View File

@@ -0,0 +1,24 @@
import ch.psi.utils.swing.SwingUtils as SwingUtils
import ch.psi.pshell.swing.DiscretePositionerPanel as DiscretePositionerPanel
import ch.psi.pshell.swing.DiscretePositionerSelector as DiscretePositionerSelector
import ch.psi.pshell.swing.RegisterPanel as RegisterPanel
"""
setp = scienta.getChannelCtrl()+":LENS_MODE"
rbck = scienta.getChannelCtrl()+":LENS_MODE_RBV"
dp = DiscretePositioner("lens_mode", setp, rbck)
dp.monitored=True
add_device(dp, True)
pn=DiscretePositionerSelector()
pn.setDevice(dp)
SwingUtils.showDialog(App.getInstance().mainFrame, dp.name, None, pn)
show_panel(dp)
"""
reg=sin #scienta.getEnergyStepSize()
rp=RegisterPanel()
rp.setDevice(None)
SwingUtils.showDialog(App.getInstance().mainFrame, reg.name, None, rp)

View File

@@ -0,0 +1,6 @@
class Measurement (ImageMeasurement):
def calc(self, data):
return data.getRoi(Rectangle(10,10,20,20)).integrate(False)
tscan(Measurement(src2, "roi"), 10, 0.2)

View File

@@ -0,0 +1,31 @@
def after_read(rec,scan):
print rec[energy], rec[sin]
#r = mscan(energy, sin.cache, after_read=after_read)
#Execute the scan: sample undefined number of samples until a condition is met, with auto range
scan_completed=False
def after_read(record, scan):
global scan_completed
print record[sin]
if motor.isReady():
scan_completed=True
scan.abort()
motor.move(0.0)
motor.moveAsync(3.0)
try:
r = mscan(motor.readback, [motor.readback, sin.cache], after_read=after_read, range=[0.0, 3.0], domain_axis=motor.readback.name)
except ScanAbortedException as ex:
if not scan_completed: raise
motor.moveAsync(0.0)
print r[sin]
#print r[0][sin]
print r[0][motor.readback]

21
script/test/TestJEP.py Normal file
View File

@@ -0,0 +1,21 @@
from jeputils import import_py
import_py("CPython/linfit", "linfit")
import_py("CPython/gfitoff", "gfitoff")
x=[0,1,2,3,4,5,6,7,8,9]
y=[1,2,3,6,9,6,3,2,1,0]
(p, x_fit, y_fit, R2) = linfit(x,y)
#print "Fit: ", (p, x_fit, y_fit, R2)
plot((y,y_fit), name=("data", "fit"),xdata=(x,x_fit))
from mathutils import Gaussian
x=to_array([-200.30429237268825, -200.2650700434188, -200.22115208318002, -199.9457671375377, -199.86345548879072, -199.85213073174933, -199.35687977133284, -199.13811861090275, -197.97304970346386, -197.2952215624348, -195.09076092936948, -192.92276048970703, -191.96871876227698, -189.49577852322938, -187.9652790409825, -183.63756456925222, -180.04899765472996, -178.43839623242422, -174.07311671294445, -172.0410133577918, -165.90824309893102, -160.99771795989466, -159.30176653939253, -154.27688897558514, -152.0854103810786, -145.75652847587313, -140.80843828908465, -139.23982133191495, -134.27073891256106, -132.12649284133064, -125.95947209775511, -121.00309550337462, -119.26736932643232, -114.2706655484383, -112.07393889578914, -105.72295990367157, -100.8088439880125, -99.2034906238494, -94.30042325164636, -92.15010048151461, -85.92203653534293, -81.03913275494665, -79.27412793784428, -74.33487658582118, -72.06274362408762, -65.76562628131825, -60.91255356825276, -59.20334389560392, -54.33286972659312, -52.19387171350535, -45.94978737932291, -41.03014719193582, -39.301602568238906, -34.35572209014114, -32.04464301272608, -25.8221033382824, -20.922074315528747, -19.21590299233186, -14.31090212502093, -12.217203140101386, -5.9283722049240435, -0.9863587170369246, 0.7408048387279834, 5.71126832601389, 7.972628957879352, 14.204559894256546, 19.11839959633025, 20.8218087836657, 25.678748486941828, 27.822718344586864, 34.062659474970715, 38.9745656819391, 40.77409719734158, 45.72080631619803, 47.974156754056835, 54.23453768983539, 59.12020360609568, 60.77306570712026, 65.70734521458867, 67.8344660434617, 74.03187028154134, 78.96532114824849, 80.76070945985495, 85.74802197591286, 87.9140889204674, 94.18082276873524, 99.25790470037091, 100.68454787413205, 105.7213026221542, 107.79483801526698, 113.99555681638138, 119.0707052529143, 120.72715813056156, 125.77551384921307, 127.91257836719551, 134.2011330887875, 139.23043006997628, 140.71673537840158, 145.76288138835983, 147.80216629676042, 154.06420451405637, 159.0846626604798, 160.76183155710717, 165.73699067536242, 167.9265357747636, 173.96705069576544, 178.2522282751915, 179.9042617354548, 183.54586165856657, 185.23269803071796, 189.41678143751972, 191.87149157986588, 192.8741468985015, 195.0241934550453, 195.966634211846, 197.9821647518146, 198.99006812859284, 199.33202054855676, 199.91897441965887, 200.11536227958896, 200.22280936469997, 200.25181179127208],'d')
y=to_array([11.0, 6.0, 8.0, 5.0, 11.0, 7.0, 18.0, 11.0, 12.0, 10.0, 8.0, 6.0, 16.0, 4.0, 12.0, 9.0, 15.0, 14.0, 8.0, 20.0, 15.0, 8.0, 9.0, 11.0, 13.0, 12.0, 13.0, 15.0, 13.0, 20.0, 10.0, 7.0, 17.0, 11.0, 20.0, 13.0, 13.0, 23.0, 14.0, 10.0, 17.0, 15.0, 20.0, 16.0, 14.0, 13.0, 18.0, 22.0, 9.0, 20.0, 12.0, 14.0, 17.0, 19.0, 14.0, 14.0, 23.0, 19.0, 15.0, 20.0, 20.0, 21.0, 20.0, 23.0, 22.0, 15.0, 10.0, 17.0, 21.0, 15.0, 23.0, 23.0, 25.0, 18.0, 16.0, 21.0, 22.0, 16.0, 16.0, 14.0, 19.0, 20.0, 18.0, 20.0, 23.0, 13.0, 16.0, 20.0, 25.0, 15.0, 15.0, 17.0, 22.0, 26.0, 19.0, 30.0, 25.0, 17.0, 17.0, 23.0, 16.0, 27.0, 21.0, 21.0, 26.0, 27.0, 21.0, 17.0, 20.0, 20.0, 21.0, 19.0, 25.0, 19.0, 13.0, 23.0, 20.0, 20.0, 18.0, 20.0, 19.0, 25.0],'d')
[off, amp, com, sigma] = gfitoff(x, y, off=None, amp=None, com=None, sigma=None)
#print "Fit: ", [off, amp, com, sigma]
g = Gaussian(amp, com, sigma)
plot([y, [g.value(i)+off for i in x]], ["data", "fit"], xdata = x)

View File

@@ -1,39 +1,16 @@
tutorial_path = "src/main/assembly/help/Tutorial_py/"
run(tutorial_path+"SimulatedDevices")
import ch.psi.pshell.data.LayoutDefault
class LayoutParallelScan(ch.psi.pshell.data.LayoutDefault):
class MyLayout(ch.psi.pshell.data.LayoutDefault):
def getDefaultGroup(self, scan):
return scan.readables[0].name
return str("test")
get_context().dataManager.setLayout(MyLayout())
#get_context().pluginManager.addDynamicClass(LayoutParallel().getClass())
tscan (sin,10,0.1)
writer = get_context().dataManager.provider.writer
o=writer.object()
o.createSoftLink("/test/sin", "/data/data1")
o.createHardLink("/test/sin", "/data/data2")
#Does not work
#lay = LayoutParallelScan().getClass()
##print lay
#cls = Class.forName(lay.getCanonicalName(), True, lay.getClassLoader())
#3print cls
#set_exec_pars(layout = "org.python.proxies.__main__$LayoutParallelScan$25")
#Must restore the layout
#get_context().dataManager.setLayout(LayoutParallelScan())
set_exec_pars(layout = "Table")
def scan1():
print "scan1"
return lscan(ao1, ai1, 0, 40, 20, 0.1, title = "scan1")
def scan2():
print "scan2"
return lscan(ao2, ai2, 0, 40, 20, 0.1, title = "scan2")
parallelize(scan1, scan2)
o.createSoftLink("/test", "/link1") #Not supported
o.createHardLink("/test", "/link2")

View File

@@ -0,0 +1,7 @@
master = MasterPositioner("master",mu, delta, gamma, eta)
add_device(master, True)
add_device(master.motorGroup, True)
show_panel(master)
show_panel(master.motorGroup)

View File

@@ -0,0 +1,3 @@
for i in frange(0.0, 1.0, 0.1):
master.move(i)
print mu.take(), delta.take(), gamma.take(), eta.take()

View File

@@ -0,0 +1,4 @@
def before_read():
time.sleep(1.0)
tscan((sin,scienta.dataMatrix, det.dataMatrix), 5, 0.1, before_read=before_read, save=False, plot_types={scienta.dataMatrix:"ch.psi.pshell.plot.MatrixPlotRenderer"})

23
script/test/TestMonit.py Normal file
View File

@@ -0,0 +1,23 @@
def after_read(rec, scan):
if rec[sin] < 19.0:
rec.invalidate()
time.sleep(0.05)
print "Refused " + str(rec["sin"]) + " at " + str (time.time()- start)
else:
print "Acccepted " + str(rec["sin"]) + " at " + str (time.time()- start)
start= time.time()
r1 = mscan(sin, [sin, out],-1, 3, async=False, after_read=after_read)
print r1.getSize()
r2 = mscan(sin, [sin, out],-1, 3, async=True, after_read=after_read)
print r2.getSize()
r3 = mscan(sin, [sin, out],10, 4, async=False, after_read=after_read)
print r3.getSize()
r4 = mscan(sin, [sin, out],10, 4, async=True, after_read=after_read)
print r4.getSize()
#r1 = lscan(energy, [sin],0, 1, 10, 0.1, after_read=after_read)
#r1 = tscan(sin, 50, 0.1, fixed_rate = True, domain_axis="Time", after_read=after_read)

View File

@@ -0,0 +1,9 @@
def after_read(rec, scan):
if rec["sin"] < 15.0:
rec.invalidate()
time.sleep(0.1)
r1 = mscan(sin, [sin], 25, after_read=after_read)

125
script/test/TestMonitor.py Normal file
View File

@@ -0,0 +1,125 @@
###################################################################################################
# Example of saving diagostics and snapshots during a scan
###################################################################################################
DIAGS = [ai2]
SNAPS = [ai3, wf1]
ret = lscan(m1, ai1, 0.0, 1.0, 4, diags=DIAGS, snaps=SNAPS)
plot(ret.getSnap(wf1))
plot(ret.getDiag(ai2))
#All devices can be directly indexd
for dev in [m1, ai1, ai2, wf1, ai3]:
print dev.name, " -> ", ret[dev]
#Changing default folders
LayoutBase.PATH_SNAPS = "initial/"
LayoutBase.PATH_DIAGS = "status/"
LayoutBase.PATH_MONITORS = "events/"
LayoutBase.PATH_LOGS = "logbook/"
ret = lscan(m1, ai1, 0.0, 1.0, 4, diags=DIAGS, snaps=SNAPS)
ret = tscan(out, 10, 0.2, diags=[inp, arr], monitors=[inp, sin], snapshots=[inp, motor])
#set_exec_pars(flush=True)
#print ret[out]
print ret[sin]
print ret["arr"]
print ret[motor]
#print ret.getDiag(sin)
#print ret.getDiag(arr)
#ret = tscan(out, 10, 0.2, monitors=[sin, arr])
#plot(ret[sin][1], xdata=ret[sin][0])
#plot(ret[out], xdata=ret.timestamps)
"""
class OtfValue(ReadonlyAsyncRegisterBase):
def __init__(self, name):
ReadonlyAsyncRegisterBase.__init__(self, name)
def setValue(self, value,timestamp):
self.setCache(value,timestamp)
class OTF(Otf):
def __init__(self, name):
Otf.__init__(self, name)
self.addComponent(OtfValue("Channel1"))
self.addComponent(OtfValue("Channel2"))
self.components[0].setValue(float("NaN"), long(time.time()*10e6))
self.components[1].setValue(-1, long(time.time()*10e6))
self.initialize()
self.interrupted = False
def task(self):
start = time.time()
finished=False
while not self.interrupted and not finished:
time.sleep(0.1)
self.components[0].setValue(time.time(), long(time.time()*10e6))
finished = (time.time()-start)> 5.0
if not self.interrupted:
for i in range(20):
self.components[1].setValue(i, long(time.time()*10e6))
self.getLogger().info("Finished OTF")
self.state=State.Ready
def start(self):
self.state=State.Busy
self.interrupted = False
self.thread = fork(self.task)
def abort(self):
self.interrupted = True
self.getLogger().info("Interrupting OTF thread")
join(self.thread)
add_device(OTF("otf"), True)
ret = tscan(out, 10, 0.2, monitors=[otf])
"""
"""
class OTF(Otf):
def __init__(self, name):
Otf.__init__(self, name)
self.setCache(float("NaN"), long(time.time()*10e6))
self.initialize()
self.interrupted = False
def task(self):
start = time.time()
finished=False
while not self.interrupted and not finished:
time.sleep(0.1)
self.setCache(time.time(), long(time.time()*10e6))
finished = (time.time()-start)> 5.0
self.getLogger().info("Finished OTF")
self.state=State.Ready
def start(self):
self.state=State.Busy
self.interrupted = False
self.thread = fork(self.task)
def abort(self):
self.interrupted = True
self.getLogger().info("Interrupting OTF thread")
join(self.thread)
add_device(OTF("otf"), True)
ret = tscan(out, 10, 0.2, monitors=[otf])
plot(ret[otf][1], xdata=ret[otf][0])
"""
set_return(None)

View File

@@ -0,0 +1,44 @@
def append_dataset(path, data, index=None, type='d', shape=None):
"""Append data to dataset.
Args:
path(str): Path to dataset relative to the current persistence context root.
data(number or array or list): name of each column.
index(int or list, optional): if set then add the data in a specific position in the dataset.
If integer is the index in an array (data must be 1 order lower than dataset)
If a list, specifies the full coordinate for multidimensional datasets.
type(str, optional): array type 'b' = byte, 'h' = short, 'i' = int, 'l' = long, 'f' = float,
'd' = double, 'c' = char, 's' = String, 'o' = Object
default: 'd' (convert data to array of doubles)
shape(list, optional): only valid if index is a list, provides the shape of the data array.
In this case data must be a flattened one-dimensional array.
Returns:
None
"""
data = to_array(data, type)
if index is None:
get_context().dataManager.appendItem(path, data)
else:
if is_list(index):
if shape is None:
shape = [len(index)]
get_context().dataManager.setItem(path, data, index, shape)
else:
get_context().dataManager.setItem(path, data, index)
path = "data/data4d"
data3d = [ [ [1,2,3,4,5], [2,3,4,5,6], [3,4,5,6,7], [4,5,6,7,8]],
[ [2,2,3,4,5], [3,3,4,5,6], [5,4,5,6,7], [7,5,6,7,8]],
[ [3,2,3,4,5], [4,3,4,5,6], [6,4,5,6,7], [8,5,6,7,8]] ]
plot(data3d)
data = flatten(to_array(data3d,'i))
#save_dataset(path, data4d)
create_dataset(path, 'i', dimensions = [2, 3, 4, 5])
append_dataset(path, data, index = [0,0,0,0], type = 'i', shape=[1, 3, 4, 5])

View File

@@ -0,0 +1,30 @@
from jeputils import import_py
from mathutils import Gaussian
import traceback
import_py("CPython/linfit", "linfit")
import_py("CPython/gfitoff", "gfitoff")
def task(index):
try:
print index
x=[0,1,2,3,4,5,6,7,8,9]
y=[1,2,3,6,9,6,3,2,1,0]
(p, x_fit, y_fit, R2) = linfit(x,y)
#print "Fit: ", (p, x_fit, y_fit, R2)
plot((y,y_fit), name=("data", "fit"),xdata=(x,x_fit), title=str(index))
x=to_array([-200.30429237268825, -200.2650700434188, -200.22115208318002, -199.9457671375377, -199.86345548879072, -199.85213073174933, -199.35687977133284, -199.13811861090275, -197.97304970346386, -197.2952215624348, -195.09076092936948, -192.92276048970703, -191.96871876227698, -189.49577852322938, -187.9652790409825, -183.63756456925222, -180.04899765472996, -178.43839623242422, -174.07311671294445, -172.0410133577918, -165.90824309893102, -160.99771795989466, -159.30176653939253, -154.27688897558514, -152.0854103810786, -145.75652847587313, -140.80843828908465, -139.23982133191495, -134.27073891256106, -132.12649284133064, -125.95947209775511, -121.00309550337462, -119.26736932643232, -114.2706655484383, -112.07393889578914, -105.72295990367157, -100.8088439880125, -99.2034906238494, -94.30042325164636, -92.15010048151461, -85.92203653534293, -81.03913275494665, -79.27412793784428, -74.33487658582118, -72.06274362408762, -65.76562628131825, -60.91255356825276, -59.20334389560392, -54.33286972659312, -52.19387171350535, -45.94978737932291, -41.03014719193582, -39.301602568238906, -34.35572209014114, -32.04464301272608, -25.8221033382824, -20.922074315528747, -19.21590299233186, -14.31090212502093, -12.217203140101386, -5.9283722049240435, -0.9863587170369246, 0.7408048387279834, 5.71126832601389, 7.972628957879352, 14.204559894256546, 19.11839959633025, 20.8218087836657, 25.678748486941828, 27.822718344586864, 34.062659474970715, 38.9745656819391, 40.77409719734158, 45.72080631619803, 47.974156754056835, 54.23453768983539, 59.12020360609568, 60.77306570712026, 65.70734521458867, 67.8344660434617, 74.03187028154134, 78.96532114824849, 80.76070945985495, 85.74802197591286, 87.9140889204674, 94.18082276873524, 99.25790470037091, 100.68454787413205, 105.7213026221542, 107.79483801526698, 113.99555681638138, 119.0707052529143, 120.72715813056156, 125.77551384921307, 127.91257836719551, 134.2011330887875, 139.23043006997628, 140.71673537840158, 145.76288138835983, 147.80216629676042, 154.06420451405637, 159.0846626604798, 160.76183155710717, 165.73699067536242, 167.9265357747636, 173.96705069576544, 178.2522282751915, 179.9042617354548, 183.54586165856657, 185.23269803071796, 189.41678143751972, 191.87149157986588, 192.8741468985015, 195.0241934550453, 195.966634211846, 197.9821647518146, 198.99006812859284, 199.33202054855676, 199.91897441965887, 200.11536227958896, 200.22280936469997, 200.25181179127208],'d')
y=to_array([11.0, 6.0, 8.0, 5.0, 11.0, 7.0, 18.0, 11.0, 12.0, 10.0, 8.0, 6.0, 16.0, 4.0, 12.0, 9.0, 15.0, 14.0, 8.0, 20.0, 15.0, 8.0, 9.0, 11.0, 13.0, 12.0, 13.0, 15.0, 13.0, 20.0, 10.0, 7.0, 17.0, 11.0, 20.0, 13.0, 13.0, 23.0, 14.0, 10.0, 17.0, 15.0, 20.0, 16.0, 14.0, 13.0, 18.0, 22.0, 9.0, 20.0, 12.0, 14.0, 17.0, 19.0, 14.0, 14.0, 23.0, 19.0, 15.0, 20.0, 20.0, 21.0, 20.0, 23.0, 22.0, 15.0, 10.0, 17.0, 21.0, 15.0, 23.0, 23.0, 25.0, 18.0, 16.0, 21.0, 22.0, 16.0, 16.0, 14.0, 19.0, 20.0, 18.0, 20.0, 23.0, 13.0, 16.0, 20.0, 25.0, 15.0, 15.0, 17.0, 22.0, 26.0, 19.0, 30.0, 25.0, 17.0, 17.0, 23.0, 16.0, 27.0, 21.0, 21.0, 26.0, 27.0, 21.0, 17.0, 20.0, 20.0, 21.0, 19.0, 25.0, 19.0, 13.0, 23.0, 20.0, 20.0, 18.0, 20.0, 19.0, 25.0],'d')
[off, amp, com, sigma] = gfitoff(x, y, off=None, amp=None, com=None, sigma=None)
#print "Fit: ", [off, amp, com, sigma]
g = Gaussian(amp, com, sigma)
plot([y, [g.value(i)+off for i in x]], ["data", "fit"], xdata = x, title=str(index))
except:
traceback.print_exc()
task(0)
for i in range(3):
fork((task,(i+1,)))

View File

@@ -0,0 +1,32 @@
add_device(PipelineStream("p","localhost:8889", "simulation_sp"), True)
set_exec_pars(save=False)
#tscan(p.channels,10,0.1)
#Sync with stopped stream
p.update() #First update to create children devices
x_profile= p.getChannel("x_profile")
tscan((p,x_profile),3,0.1)
#Async on running stream
p.monitored=True
p.stream.waitValueChange(-1)
class StreamImage(ReadableMatrix):
def read(self):
return Convert.reshape(p.getValue("image") , (self.getHeight(), self.getWidth()))
def getWidth(self):
return p.getValue("width")
def getHeight(self):
return p.getValue("height")
mscan(p, StreamImage(), 5)
#Sync on running stream
tscan(p.channels,5,0.5)

View File

@@ -0,0 +1,8 @@
DIAGS = [wf1,im1]
SNAPS = [wf1,im1]
ret = lscan(m1, ai1, 0.0, 1.0, 4, diags=DIAGS, snaps=SNAPS)
plot(ret.getSnap(wf1))
plot(ret.getDiag(im1))

149
script/test/TestSpectrum.py Normal file
View File

@@ -0,0 +1,149 @@
#If running from editor
if (get_exec_pars().source == CommandSource.ui):
ROI = {"Region1": [10,5,20, 10], "Region2": [60,60,40, 40]}
SAVE_SPECTRUM = True
SAVE_IMAGES = True
WITH_I0 = False
SWITCH_POL = False
EXPOSURE = 1.0
AVERAGE = 2
NUMBER_SCANS =1
RANGES = [[500.0, 1000.0, 100.0]]
print "Starting AbsSpec: ",SAVE_SPECTRUM, SAVE_IMAGES, WITH_I0, SWITCH_POL, EXPOSURE, AVERAGE, NUMBER_SCANS, RANGES
run("eiger")
machine_cur=sin
Keithley_1_raw = cv
def get_dry_run():
return True
def set_outliers_threshold(value):
set_setting("OUTLIERS_THRESHOLD", int(value))
def get_outliers_threshold():
try:
return int(get_setting("OUTLIERS_THRESHOLD"))
except:
return 0
def get_outliers_mask_file():
return get_setting("OUTLIERS_MASK_FILE")
if SWITCH_POL:
init_pol_switch("Normal")
log("ROIs: " + str(ROI))
if len(RANGES) == 0:
raise Exception("No scan range defined")
start = time.time()
init_eiger(exposure=EXPOSURE)
set_exec_pars(name="AbsortionSpectrum", format="csv", layout="table")
tag= "AbsortionSpectrum_{seq}%03d_{count}%02d"
rois = create_roi_devices(ROI)
if AVERAGE>1:
for i in range(len(rois)):
rois[i].monitored = True
rois[i] = create_averager(rois[i], AVERAGE, -1)
rois[i].monitored = True
frames=[]
class SyncEnergy(Writable):
def write(self,pos):
if not get_dry_run():
put_energy(pos)
else:
print "Energy=" + str(pos)
sync_energy=SyncEnergy()
set_device_alias(sync_energy, "Energy") #Set display name
sensors = rois + [machine_cur]
if WITH_I0:
sensors = sensors + [Keithley_1_raw]
####
def __save_as_tiff(index, data, filename,metadata={}):
if type(data) == Data:
ip = load_array(data.matrix)
else:
ip = data
metadata["Timestamp"] = time.strftime("%y/%m/%d %H:%M:%S",time.localtime())
if not os.path.exists(os.path.dirname(filename)):
os.makedirs(os.path.dirname(filename))
save_image(ip, filename,"tiff", metadata)
d = get_ip_array(ip)
import java.util.Arrays as Arrays
ip=open_image(filename)
read = get_ip_array(ip)
if not Arrays.deepEquals(read, d):
print "Error reading array"
print index, filename
index=0
for name,r in ROI.items():
s=0.0
for i in range(r[2]):
for j in range(r[3]):
#s = s + d[r[0]+i][r[1]+j]
el=data.getElement(r[0]+i, r[1]+j, False)
s = s + (0 if (math.isnan(el)) else el)
roi = data.getRoi(Rectangle(r[0],r[1], r[2], r[3]))
print name, s, rois[index].take(), roi.integrate(False)
index=index+1
####
av=None
def grab_image(position, scan):
global av
av = average_eiger_frames(AVERAGE, roi=None, wait_next=True)
if SAVE_IMAGES:
filename = get_exec_pars().path + "/" + str(scan.currentPass) + "/s" + "{seq}%03d" + "_" + ("%03d.tif" % scan.recordIndex)
filename = get_context().setup.expandPath(filename)
#print filename
#save_as_tiff(av, filename, metadata={})
#fork((__save_as_tiff,(scan.recordIndex, av, filename)),)
__save_as_tiff(scan.recordIndex, av, filename)
class Average(ReadableMatrix):
def read(self):
return av.matrix
def getWidth(self):
return image.getData().getWidth()
def getHeight(self):
return image.getData().getHeight()
averager=Average()
set_device_alias(averager, "Image") #Set display name
sensors.append(averager)
#Initialize vartiables
if not get_dry_run() and str(get_setting("AUTO_SWITCH_VALVE")).lower() == "true":
open_vg10()
def after_pass(pass_number, scan):
if SWITCH_POL:
if pass_number<scan.numberOfPasses:
switch_pol()
try:
rscan(sync_energy, sensors, RANGES, latency = 0.0 , passes = NUMBER_SCANS, tag=tag, before_read=grab_image, save=SAVE_SPECTRUM, split=True, keep=False, after_pass=after_pass)
finally:
if AVERAGE>1:
for i in range(len(rois)):
rois[i].parent.monitored = False # Remove listeners on the image
if not get_dry_run() and str(get_setting("AUTO_SWITCH_VALVE")).lower() == "true":
close_vg10()
restore_eiger()
print "Running time: " + str(time.time() - start)

View File

@@ -0,0 +1,15 @@
STREAM_URL="tcp://localhost:5552"
st1=Stream("st1", STREAM_URL, SocketType.SUB)
st1.createMatrix = True
st1.initialize()
st1.start()
st1.waitCacheChange(2000)
show_panel(st1)
#bscan(st1, 10, -1)

View File

@@ -2,22 +2,33 @@ import ch.psi.pshell.bs.Provider as Provider
url="tcp://localhost:9999"
url="tcp://SFTEST-CVME-DBPM1:9001"
#url= "tcp://SIN-CVME-DBPM0421:9000"
p=Provider("provider", url, True)
p.config.keepListeningOnStop = True
p.config.parallelHandlerProcessing = False
p.config.byteBufferAllocator = True
st1 = Stream("st1", p)
url="tcp://localhost:5553"
#url="tcp://localhost:10101"
#p=Provider("provider", url, False)
#p.config.keepListeningOnStop = True
#p.config.parallelHandlerProcessing = False
#p.config.byteBufferAllocator = True
#st1 =
st1=Stream("st1", url, SocketType.SUB)
#st1.addScalar("scalar")
#st1.addMatrix("img")
#st1.addScalar("str")
#st1.addWaveform("waveform")
st1.initialize()
st1.start()
st1.waitCacheChange(20000)
st1.waitCacheChange(2000)
#try:
# bscan (st1, 5, 5, save=False)
#finally:
# st1.close()
"""
try:
bscan (st1, 5, 5, save=False)
finally:
st1.close()
try:
print st1.getValues()
finally:
st1.close()
"""

21
script/test/TestStrip.py Normal file
View File

@@ -0,0 +1,21 @@
import random
####################################################################################################
# Simulated Devices
####################################################################################################
class AnalogInput(ReadonlyRegisterBase):
def doRead(self):
time.sleep(0.001)
self.val = to_array(self.calc(), 'd')
return self.val
class Random(AnalogInput):
def calc(self):
return random.random()
for i in range(20):
r=Random("r"+str(i))
add_device(r, True)
r.polling=5

View File

@@ -0,0 +1,2 @@
CUSTOM_PLOT_TYPES = {scienta.dataMatrix:"ch.psi.pshell.plot.TablePlot"}
tscan(scienta.dataMatrix, 5, 0.1, save=False, plot_types=CUSTOM_PLOT_TYPES)

View File

@@ -0,0 +1,24 @@
import ch.psi.utils.swing.Terminal as Terminal
import ch.psi.utils.swing.SwingUtils as SwingUtils
terminal=None
view=App.getInstance().getMainFrame()
tabStatus=view.getStatusTab()
def showTerminal():
global terminal
terminal = Terminal(".", 13)
tabStatus.addTab("T", terminal)
index = tabStatus.getTabCount() - 1
SwingUtils.setTabClosable(tabStatus, index)
tabStatus.setSelectedComponent(terminal)
def hideTerminal():
global terminal
if terminal is not None:
tabStatus.remove(terminal)
terminal = None
for i in range (100):
showTerminal()
hideTerminal()

2
script/test/TestVscan.py Normal file
View File

@@ -0,0 +1,2 @@
vector = [ 1, 3, 5, 10, 25, 40, 45, 47, 49]
r1 = vscan(motor,(sin),vector,False, 0.5, relative=True,title = "1D Vector", before_read=None, after_read=None)

43
script/test/TstImgSim.py Normal file
View File

@@ -0,0 +1,43 @@
run ("imaging/sim")
stack = load_test_stack(show=True)
ipr, ipi = complex_edge_filtering(stack, complex=True, g_sigma = 3.0, show=False)
#complex_edge_filter = get_context().getClassByName("Align_ComplexEdgeFiltering").newInstance()
#translation_filter = get_context().getClassByName("Align_TranslationFilter2").newInstance()
#compute_shifts_filter = get_context().getClassByName("Align_ComputeShifts2").newInstance()
"""
ip_list = []
for index in range(40,49):
ip_list.append(open_image(expand_path("{images}/TestObjAligner/i210517_0" + str(index) + "#001.tif")))
stack = create_stack(ip_list, title = "Test")
stack.show()
complex_edge_filter.setup("2,True,False", stack) #Gaussian blur radius, Complex (True) or Real (False), show dialog = False
complex_edge_filter.r"un(stack.getProcessor())
imp_r, imp_i = complex_edge_filter.output
#imp_r.show()
#imp_i.show()
roi=Roi(258,0,256,256)
compute_shifts_filter.setup(10, False, ipr, ipi, 1, roi)
compute_shifts_filter.run(None)
shifts = compute_shifts_filter.shifts
translation_filter.shifts = shifts
translation_filter.setup("",stack)
translation_filter.run(stack.getProcessor())
translation_filter.registred.show();
translation_filter.registred.updateAndDraw();
"""
roi=Roi(258,0,256,256)
shifts = calculate_shifts(ipr, ipi, roi, 2)
r=translate(stack, shifts, True)

44
script/test/TstImgSim2.py Normal file
View File

@@ -0,0 +1,44 @@
from ijutils import Roi
#from sim import *
import traceback
run ("imaging/sim")
roi=Roi(0,0,128,128)
"""
stack = load_test_stack(show=True, size=2)
ipr, ipi = complex_edge_filtering(stack, show=False)
shifts = calculate_shifts(ipr, ipi, roi, java_code=True)
#shifts= load_shifts("{images}/TestObjAligner/shifts.mat")
#stack = load_test_stack(show=True)
r=translate(stack, shifts, show=True)
"""
ref = "{images}/TestObjAligner/i210517_040#001.tif"
img = "{images}/TestObjAligner/i210517_041#001.tif"
ref = open_image(ref)
img = open_image(img)
#ref=ref.getBufferedImage()
#img=img.getBufferedImage()
#ref=ca.data
img=grayscale(to_ip(ca.data))
ref = grayscale(ref.crop([Roi(0,0,452,452)])[0])
def calculate_shift(ref,img, roi, upscale_factor=100, reference_slide=1):
ref = to_ip(ref)
img = to_ip(img)
stack = create_stack([ref,img])
stack.show()
ipr, ipi = complex_edge_filtering(stack, show=False)
shifts = calculate_shifts(ipr, ipi, roi, java_code=True)
xoff, yoff = shifts[1][3], shifts[1][2]
error, diffphase = shifts[1][4], shifts[1][5]
r=translate(stack, shifts, show=True)
return xoff, yoff,error, diffphase
print calculate_shift(ref,img, roi)

View File

@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration xmlns="http://www.psi.ch/~ebner/models/scan/1.0" numberOfExecution="1" failOnSensorError="true">
<data format="txt" fileName="VERSI_BEAMSTOP_SCAN"/>
<variable name="X_INIT" value="-2.0"/>
<variable name="X_FINAL" value="2.0"/>
<scan>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X05LA-ES3:START-CSMPL" value="1"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X05LA-ES3:SET-DCT-TIME" value="0.2"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X05LA-ES3:SMPL-BTN" value="1"/>
<cdimension zigzag="false" dataGroup="false">
<positioner name="X05LA-ES2-VERSI:TRXDO" id="versiBS_TRX">
<start>-2.0</start>
<end>2.0</end>
<stepSize>0.1</stepSize>
<integrationTime>0.2</integrationTime>
<additionalBacklash>0.25</additionalBacklash>
</positioner>
<detector name="TRIGGER1" scr="false" id="trigger"/>
<detector name="X05LA-ES3-SAI_06:CUR-MEAN" scr="true" id="SAI_BS_Diode"/>
<detector name="X05LA-ES3-SAI_05:CUR-MEAN" scr="true" id="microChamber"/>
<detector name="X05LA-ES3-SAI_07:CUR-MEAN" scr="true" id="transSiCDiode"/>
<detector name="X05LA-EH-QEM1:SumAll:MeanValue_RBV" scr="true" id="BMtotal"/>
<detector name="MTEST-X05LA-ES2-XRAYEYE:FEMTO-MEAN-CURR" scr="true" id="XrayEye"/>
</cdimension>
<dimension zigzag="false" dataGroup="false">
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinearPositioner" name="X05LA-ES2-VERSI:TRYDO" settlingTime="0.05" asynchronous="false" id="versiBS_TRY">
<start>0.0</start>
<end>2.0</end>
<stepSize>0.1</stepSize>
<startVar>X_INIT</startVar>
<endVar>X_FINAL</endVar>
</positioner>
</dimension>
<postAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X05LA-ES2-VERSI:TRXDO" value="0"/>
<postAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="X05LA-ES2-VERSI:TRYDO" value="0"/>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="MANIP">
<script>def process():
return X_INIT + caget("X05LA-ES2-MA:6DTRY")
</script>
</manipulation>
</scan>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="MatrixPlot" x="versiBS_TRX" y="versiBS_TRY" z="SAI_BS_Diode" title="BS Diode"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="MatrixPlot" x="versiBS_TRX" y="versiBS_TRY" z="microChamber" title="I0"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="MatrixPlot" x="versiBS_TRX" y="versiBS_TRY" z="transSiCDiode" title="Si Diode"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="MatrixPlot" x="versiBS_TRX" y="versiBS_TRY" z="XrayEye" title="XrayEye"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="versiBS_TRX" y="MANIP"/>
</configuration>

View File

@@ -1,3 +1,4 @@
def calc(a):
return a*4
print calc(10)

3128
script/test/inspect.py Normal file

File diff suppressed because it is too large Load Diff

7
script/test/t.py Normal file
View File

@@ -0,0 +1,7 @@
i=1
j=time.sleep(1.0)
r1 = lscan(inp, (sin,out,), 0, 40, 100, 0.05, print_scan=True)
r1 = lscan(inp, (sin,out,), 0, 40, 100, 0.01)
j=time.sleep(1.0)

View File

@@ -14,11 +14,12 @@ Line Scan
#set_exec_pars(name="out", open=False)
print get_exec_pars().path
print (get_exec_pars().path)
def before_pass(pass_num):
print "Starting pass: " , pass_num
print ("Starting pass: " , pass_num)
def after_pass(pass_num):
print "Finished pass: " , pass_num
print ("Finished pass: " , pass_num)
#set_exec_pars(layout="sf")

View File

@@ -1,20 +1,22 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration xmlns="http://www.psi.ch/~ebner/models/scan/1.0" failOnSensorError="true">
<notification>
<recipient>alexandre.gobbo@psi.ch</recipient>
<recipient error="true" success="false">alexandre.gobbo@psi.ch</recipient>
</notification>
<data fileName="test14"/>
<description>My first test</description>
<variable name="var1" value="0.0"/>
<scan>
<dimension>
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="FunctionPositioner" name="TESTIOC:TESTCALCOUT:Input" id="id108088">
<dimension zigzag="false" dataGroup="false">
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="FunctionPositioner" name="TESTIOC:TESTCALCOUT:Input" asynchronous="false" id="id108088">
<start>0.0</start>
<end>20.0</end>
<stepSize>1.0</stepSize>
<function>
<script>def calculate(parameter):
return parameter*2</script>
<mapping xsi:type="ChannelParameterMapping" channel="TESTIOC:TESTSINUS:SinCalc" variable="c"/>
<mapping xsi:type="ChannelParameterMapping" channel="TESTIOC:TESTSINUS:SinCalc" variable="master"/>
<script>def calculate(parameter,master):
return 2.0*master.value + parameter </script>
</function>
</positioner>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="id348623"/>

View File

@@ -9,7 +9,7 @@
<scan>
<dimension>
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinearPositioner" name="TESTIOC:TESTCALCOUT:Input" id="id278043">
<start>0.0</start>
<start>10.0</start>
<end>31.0</end>
<stepSize>1.0</stepSize>
</positioner>
@@ -23,8 +23,8 @@ def process():
</dimension>
<dimension>
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinearPositioner" name="TESTIOC:TESTCALC:MyCalc" id="id643271">
<start>0.0</start>
<end>5.0</end>
<start>5.0</start>
<end>10.0</end>
<stepSize>1.0</stepSize>
</positioner>
</dimension>

View File

@@ -1,7 +1,7 @@
[py, px, pxy]=plot([None,None,None],["y","x", "xy"])
#
#XY error plot
pxy.setStyle(pxy.Style.ErrorXY)

46
script/test/test2v.xml Normal file
View File

@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration xmlns="http://www.psi.ch/~ebner/models/scan/1.0" failOnSensorError="true">
<notification>
<recipient>alexandre.gobbo@psi.ch</recipient>
</notification>
<data fileName="test2"/>
<description>My second test</description>
<variable name="var1" value="0.1" description="HAHAHA"/>
<variable name="START_X" value="10"/>
<variable name="END_X" value="=START_X+20"/>
<variable name="STEP_X" value="1"/>
<variable name="START_Y" value="5"/>
<variable name="END_Y" value="=START_Y+5"/>
<variable name="STEP_Y" value="=STEP_X"/>
<scan>
<dimension>
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinearPositioner" name="TESTIOC:TESTCALCOUT:Input" id="id278043">
<start>0.0</start>
<end>0.0</end>
<stepSize>1.0</stepSize>
<startVar>START_X</startVar>
<endVar>END_X</endVar>
<stepSizeVar>STEP_X</stepSizeVar>
</positioner>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptAction">
<script>import time
def process():
time.sleep(0.1)</script>
</action>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="id348623"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTSINUS:SinCalc" id="id367393"/>
</dimension>
<dimension>
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinearPositioner" name="TESTIOC:TESTCALC:MyCalc" id="id643271">
<start>0.0</start>
<end>10.0</end>
<stepSize>0.0</stepSize>
<startVar>START_Y</startVar>
<endVar>END_Y</endVar>
<stepSizeVar>STEP_Y</stepSizeVar>
</positioner>
</dimension>
</scan>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id278043" y="id367393"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="MatrixPlot" x="id278043" y="id643271" z="id367393"/>
</configuration>

25
script/test/test6v.xml Normal file
View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration xmlns="http://www.psi.ch/~ebner/models/scan/1.0" numberOfExecution="1" failOnSensorError="true">
<data fileName="test"/>
<scan>
<dimension zigzag="false" dataGroup="false">
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="PseudoPositioner" id="id226053">
<counts>100</counts>
</positioner>
</dimension>
<dimension zigzag="false" dataGroup="false">
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="PseudoPositioner" id="id236750">
<counts>100</counts>
</positioner>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Timestamp" id="id246209"/>
</dimension>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" returnArray="false" id="id060427">
<mapping xsi:type="IDParameterMapping" refid="id226053" variable="x"/>
<mapping xsi:type="IDParameterMapping" refid="id236750" variable="y"/>
<mapping xsi:type="IDParameterMapping" refid="id246209" variable="z"/>
<script>def process(x,y,z):
return z</script>
</manipulation>
</scan>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="MatrixPlot" x="id226053" y="id236750" z="id060427"/>
</configuration>

View File

@@ -25,11 +25,6 @@ def process(x):
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTSINUS:SinCalc" id="id367393"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Timestamp" id="id192931"/>
</dimension>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" returnArray="false" id="id173831">
<mapping xsi:type="IDParameterMapping" refid="id367393" variable="v"/>
<script>def process(v):
return v+100.0</script>
</manipulation>
</scan>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id192931" y="id348623 id173831"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id278043" y="id367393"/>
</configuration>

15
script/test/test9.xml → script/test/test8v.xml Executable file → Normal file
View File

@@ -3,15 +3,21 @@
<notification>
<recipient>alexandre.gobbo@psi.ch</recipient>
</notification>
<data fileName="test8"/>
<description>My third test</description>
<data fileName="test8v"/>
<description>My first test</description>
<variable name="var1" value="0.0"/>
<variable name="START" value="0.0"/>
<variable name="END" value="31.0"/>
<variable name="STEP" value="1.0"/>
<scan>
<dimension>
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinearPositioner" name="TESTIOC:TESTCALCOUT:Input" id="id278043">
<start>0.0</start>
<end>31.0</end>
<stepSize>1.0</stepSize>
<startVar>START</startVar>
<endVar>END</endVar>
<stepSizeVar>STEP</stepSizeVar>
</positioner>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptAction">
<script>import time
@@ -20,9 +26,10 @@ def process():
</action>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="id348623"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTSINUS:SinCalc" id="id367393"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ArrayDetector" arraySize="10" name="TESTIOC:TESTWF2:MyWF" id="id031980"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ArrayDetector" arraySize="10" name="TESTIOC:TESTWF2:MyWF" id="id980818"/>
</dimension>
</scan>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id278043" y="id348623 id367393"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="MatrixPlotArray" y="id278043" z="id031980"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="MatrixPlotArray" y="id278043" z="id980818" type="3D"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlotArray" y="id980818" maxSeries="2" offset="3" size="5"/>
</configuration>

View File

@@ -0,0 +1,41 @@
REGIONS = [("R1",(1.0, 2.0, 0.1)), ("R2",(2.0, 8.0, 0.5)), ("R3",(8.0, 9.0, 0.2)), ]
PASSES = 2
class AnalogOutput(RegisterBase):
def doRead(self):
return self.val if hasattr(self, 'val') else 0.0
def doWrite(self, val):
self.val = val
add_device(AnalogOutput("ao1"), True)
scanning=False
current_index=-1
def scan(region):
name, pars=REGIONS[region]
def before_pass(pass_num, scan):
global scanning, current_index
while (current_index != (region-1)) or scanning:
time.sleep(0.1)
scanning = True
#time.sleep(0.1)
current_index = current_index+1
App.getInstance().mainFrame.setScanDisplays(scan, None)
def after_pass(pass_num):
global scanning, current_index
if current_index>=(len(REGIONS)-1):
current_index=-1
scanning = False
lscan(ao1, [ai1, ai2], pars[0], pars[1], pars[2], 0.1, tag=name, passes=PASSES,
before_pass = before_pass, after_pass=after_pass, restore_position=False)
scans = [[scan,[i,]] for i in range(len(REGIONS))]
parallelize(*scans)

View File

@@ -0,0 +1,24 @@
url="tcp://localhost:5554"
"""
import ch.psi.pshell.bs.Provider as Provider
p=Provider("provider", url, SocketType.SUB)
#p.config.keepListeningOnStop = True
#p.config.parallelHandlerProcessing = False
p.config.headerReservingAllocator = True
st1 = Stream("st1", p)
"""
st1 = Stream("st1", url, SocketType.SUB)
st1.parent.config.headerReservingAllocator = True
st1.initialize()
st1.start()
st1.waitCacheChange(20000)
try:
bscan (st1, 5, 5, save=False)
finally:
st1.close()
#p.close()

15
script/test/test_cont.xml Normal file
View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration xmlns="http://www.psi.ch/~ebner/models/scan/1.0">
<data fileName="xxx.xml"/>
<scan>
<cdimension>
<positioner name="TEST" readback="" id="id518535">
<start>0.0</start>
<end>0.0</end>
<stepSize>0.0</stepSize>
<integrationTime>0.0</integrationTime>
<additionalBacklash>2.0</additionalBacklash>
</positioner>
</cdimension>
</scan>
</configuration>

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration xmlns="http://www.psi.ch/~ebner/models/scan/1.0">
<data fileName="xxx.xml"/>
<scan>
<dimension>
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="FunctionPositioner" name="TESTIOC:TESTCALCOUT:Input" id="p1">
<start>0.0</start>
<end>1.0</end>
<stepSize>0.1</stepSize>
<function>
<script>def calculate(parameter):
return parameter +1</script>
</function>
</positioner>
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="FunctionPositioner" name="TESTIOC:TESTWF2:MyWF" id="p2">
<start>10.0</start>
<end>20.0</end>
<stepSize>1.0</stepSize>
<function>
<script>def calculate(parameter):
return parameter+10</script>
</function>
</positioner>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="det"/>
</dimension>
</scan>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="p1" y="det"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="p2" y="det"/>
</configuration>

View File

@@ -0,0 +1,11 @@
add_device(ChannelDouble("c0", "TESTIOC:TESTSINUS:SinCalc"), True)
c0.monitored=True
show_panel(c0)
for i in range(1000000):
c=ChannelDouble("channel", "TESTIOC:TESTSINUS:SinCalc")
c.initialize()
print i, c.read()
c.close()
time.sleep(0.001)

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration xmlns="http://www.psi.ch/~ebner/models/scan/1.0" failOnSensorError="true">
<data fileName="test_manip.xml"/>
<scan>
<dimension zigzag="false" dataGroup="false">
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="PseudoPositioner" id="Pos">
<counts>5</counts>
</positioner>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Timestamp" id="Time"/>
</dimension>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" returnArray="false" id="Manip">
<mapping xsi:type="IDParameterMapping" refid="Time" variable="x"/>
<script>def process(x):
return 2*x</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="Manio2">
<script>def process():
return 0.0</script>
</manipulation>
</scan>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Pos" y="Time"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Pos" y="Manip"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Pos" y="Manio2"/>
</configuration>

View File

@@ -0,0 +1,19 @@
url="tcp://localhost:9999"
st1 = Stream("st1", url, SocketType.PULL)
#st1.parent.config.headerReservingAllocator = True
st1.initialize()
st1.start()
st1.waitCacheChange(60000)
#show_panel(st1)
try:
bscan (st1, 5, 5, save=False)
finally:
st1.close()
#p.close()

20
script/test/test_roi.py Normal file
View File

@@ -0,0 +1,20 @@
r=show_panel(ca)
r.addDataSelection(Overlays.Rect(None, Point(70,50), Dimension(20,40)))
ov = r.getDataSelection()
size =20
ov.width = 40
ov.height = 80
r.refresh()
ov.setPosition(Point(100,79))
r.refresh()
print ov.position.x,ov.position.x,ov.size.width, ov.size.height
r.addDataSelection(Overlays.Line(None, Point(20,50), Point(40,90)))
r.addDataSelection(Overlays.Crosshairs(None, Point(20,50), Dimension(-1,1)))
r.addDataSelection(Overlays.Crosshairs(None, Point(20,50), Dimension(1,-1)))

View File

@@ -0,0 +1,77 @@
from ch.psi.bsread import ScheduledSender
from ch.psi.bsread import SenderConfig
from ch.psi.bsread import DataChannel
from ch.psi.bsread.impl import StandardPulseIdProvider
from ch.psi.bsread.impl import StandardTimeProvider
from ch.psi.bsread.message import Timestamp
from ch.psi.bsread.message import ChannelConfig
from ch.psi.bsread.converter import MatlabByteConverter
from java.util.concurrent import TimeUnit
from ch.psi.bsread.message import Type as ChanlelType
from ch.psi.bsread.compression import Compression
try:
sender.close()
except:
pass
try:
receiver.close()
except:
pass
#address "tcp://*:9999"
#try:
pid_provider = StandardPulseIdProvider()
time_provider = StandardTimeProvider();
converter = MatlabByteConverter()
sender = ScheduledSender(SenderConfig(SenderConfig.DEFAULT_ADDRESS,pid_provider,time_provider,converter))
class ScalarChannel(DataChannel):
def getValue(self, pulseId):
#print pulseId
return float(pulseId);
def getTime(self, pulseId):
return Timestamp(pulseId, 0L)
scalar_channel_config = ChannelConfig("Scalar", ChanlelType.Float64, 10, 0)
scalar_channel = ScalarChannel(scalar_channel_config)
sender.addSource(scalar_channel)
#Compression: bitshuffle_lz4 , none or lz4
compression = Compression.none
SIZE_ARRAY = 1200000 #54268
#SIZE_ARRAY = 120
class ArrayChannel(DataChannel):
def getValue(self, pulseId):
return Arr.indexesDouble(SIZE_ARRAY)
def getTime(self, pulseId):
return Timestamp(pulseId, 0L)
array_channel_config = ChannelConfig("Array", ChanlelType.Float64, [SIZE_ARRAY/1000, 1000], 10, 0, ChannelConfig.DEFAULT_ENCODING, compression)
array_channel = ArrayChannel(array_channel_config)
sender.addSource(array_channel)
sender.connect();
initialDelay = 20
period = 20
sender.sendAtFixedRate(initialDelay, period, TimeUnit.MILLISECONDS)
back=sender
#run ("test/test_receive_sender")
receiver = Stream("st1", "tcp://localhost:9999", SocketType.PULL)
#st1.parent.config.headerReservingAllocator = True
receiver.initialize()
receiver.start()
show_panel(receiver)
#finally:
# #receiver.close();
# sender.close();
# pass

250
script/test/testbug.xml Normal file
View File

@@ -0,0 +1,250 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration xmlns="http://www.psi.ch/~ebner/models/scan/1.0" numberOfExecution="1" failOnSensorError="true">
<data format="txt" fileName="Au_calib"/>
<scan>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Input" value="0" delay="0.1"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Input" value="0" operation="put" type="String" delay="0.1"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Input" value="Auto" operation="put" type="String" delay="0.1"/>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Input" value="0" delay="0.1"/>
<dimension zigzag="false" dataGroup="false">
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RegionPositioner" name="TESTIOC:TESTCALCOUT:Input" readback="TESTIOC:TESTCALCOUT:Input" settlingTime="0.3" doneDelay="0.3" asynchronous="false" id="posX">
<region>
<preAction xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Input" value="2" operation="put" type="Integer"/>
<start>-8.0</start>
<end>0.0</end>
<stepSize>0.2</stepSize>
</region>
</positioner>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Input" value="1" operation="putq" delay="0.1"/>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Input" value="Acquiring" operation="wait"/>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Input" value="1" delay="0.6"/>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Input" value="1" operation="wait" type="Integer" delay="0.2"/>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Input" value="1" delay="0.1"/>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Input" value="Done" operation="wait"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="Fluo-Ketek1"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="SAI01-MEAN"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="SAI02-MEAN"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="SAI03-MEAN"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="Ring-current"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="IntegrTimeSet"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" type="Double" name="TESTIOC:TESTCALCOUT:Output" id="IntegrTimeGet"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Timestamp" id="Timestamp"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="dead_time"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="Fluo-Ketek2"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="Sca1"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ScaICR1"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ScaOCR1"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ERTM1"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="Sca2"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ScaICR2"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ScaOCR2"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ERTM2"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="Sca3"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ScaICR3"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ScaOCR3"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ERTM3"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="Sca4"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ScaICR4"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ScaOCR4"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ERTM4"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="Sca5"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ScaICR5"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ScaOCR5"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="ERTM5"/>
</dimension>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" returnArray="false" id="TrueFluoChannel1">
<mapping xsi:type="IDParameterMapping" refid="Sca1" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="ScaICR1" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="ScaOCR1" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="ERTM1" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = 0
return box
if (ICR) == 0:
box = 0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
TrueICR = ICR * math.exp(TestICR * DeadTime)
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=0.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" returnArray="false" id="TrueFluoChannel2">
<mapping xsi:type="IDParameterMapping" refid="Sca2" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="ScaICR2" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="ScaOCR2" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="ERTM2" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = 0
return box
if (ICR) == 0:
box = 0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
TrueICR = ICR * math.exp(TestICR * DeadTime)
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=0.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" returnArray="false" id="TrueFluoChannel3">
<mapping xsi:type="IDParameterMapping" refid="Sca3" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="ScaICR3" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="ScaOCR3" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="ERTM3" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = 0
return box
if (ICR) == 0:
box = 0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
TrueICR = ICR * math.exp(TestICR * DeadTime)
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=0.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" returnArray="false" id="TrueFluoChannel4">
<mapping xsi:type="IDParameterMapping" refid="Sca4" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="ScaICR4" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="ScaOCR4" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="ERTM4" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = 0
return box
if (ICR) == 0:
box = 0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
TrueICR = ICR * math.exp(TestICR * DeadTime)
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=0.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" returnArray="false" id="TrueFluoChannel5">
<mapping xsi:type="IDParameterMapping" refid="Sca5" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="ScaICR5" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="ScaOCR5" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="ERTM5" variable="d"/>
<script>import math
def process(a,b,c,d):
DeadTime = 1.182e-7
ICR = b
OCR = c
if (OCR) == 0:
box = 0
return box
if (ICR) == 0:
box = 0
return box
Test = 1.e8
TestICR = ICR
n = 0
while ((Test &gt; DeadTime) and (n &lt; 30)):
TrueICR = ICR * math.exp(TestICR * DeadTime)
Test = (TrueICR - TestICR) / TestICR
TestICR = TrueICR
n = n + 1
if (OCR*d) &lt;&gt; 0:
box = a * TrueICR / OCR / d
if (OCR*d) == 0:
box=0.0
return box</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" returnArray="false" id="TotalFluo">
<mapping xsi:type="IDParameterMapping" refid="TrueFluoChannel1" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="TrueFluoChannel2" variable="b"/>
<mapping xsi:type="IDParameterMapping" refid="TrueFluoChannel3" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="TrueFluoChannel4" variable="d"/>
<mapping xsi:type="IDParameterMapping" refid="TrueFluoChannel5" variable="e"/>
<script>import math
def process(a,b,c,d,e):
SUM_DET = 0.
SUM_DET = SUM_DET + a
SUM_DET = SUM_DET + b
SUM_DET = SUM_DET + c
SUM_DET = SUM_DET + d
SUM_DET = SUM_DET + e
return SUM_DET</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" returnArray="false" id="TotalFluoXAS">
<mapping xsi:type="IDParameterMapping" refid="TotalFluo" variable="c"/>
<mapping xsi:type="IDParameterMapping" refid="SAI01-MEAN" variable="d"/>
<script>import math
def process(c,d):
return c/d</script>
</manipulation>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" returnArray="false" id="XAS-refer">
<mapping xsi:type="IDParameterMapping" refid="SAI01-MEAN" variable="a"/>
<mapping xsi:type="IDParameterMapping" refid="SAI02-MEAN" variable="b"/>
<script>import math
def process(a,b):
return math.log(math.fabs(a) /math.fabs(b))</script>
</manipulation>
</scan>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="posX" y="SAI01-MEAN" title=" I0"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="posX" y="SAI02-MEAN" title=" I1"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="posX" y="XAS-refer" title=" XAS-trans"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="posX" y="TotalFluoXAS" title="XAS-Fluo"/>
</configuration>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration xmlns="http://www.psi.ch/~ebner/models/scan/1.0">
<data/>
<scan/>
</configuration>

View File

@@ -0,0 +1,9 @@
cc =ChannelSettlingCondition("TESTIOC:TESTCALCOUT:Input", 0)
positioner = ControlledVariable("positioner", "TESTIOC:TESTCALCOUT:Output", "TESTIOC:TESTSINUS:SinCalc")
positioner.getConfig().resolution = float('inf')
positioner.initialize()
positioner.setSettlingCondition(ChannelSettlingCondition("TESTIOC:TESTCALCOUT:Input", 0))
positioner.write(2.0)
positioner.read()

View File

@@ -5,8 +5,12 @@
</notification>
<data fileName="test1"/>
<description>My first test</description>
<variable name="var1" value="0.0"/>
<variable name="var1" value="0.2"/>
<variable name="var2" value="=var1+3"/>
<scan>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptAction">
<script>print var1, var2</script>
</preAction>
<dimension zigzag="false" dataGroup="false">
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinearPositioner" name="TESTIOC:TESTCALCOUT:Input" asynchronous="false" id="id278043">
<start>0.0</start>
@@ -18,6 +22,9 @@
def process():
time.sleep(0.1)</script>
</action>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptAction">
<script>print 1</script>
</action>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="id348623"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTSINUS:SinCalc" id="id367393"/>
</dimension>

25
script/test/test1.xml → script/test/testy.xml Executable file → Normal file
View File

@@ -3,10 +3,22 @@
<notification>
<recipient error="true" success="false">alexandre.gobbo@psi.ch</recipient>
</notification>
<data fileName="{name}"/>
<description>My first test a</description>
<data fileName="test1"/>
<description>My first test</description>
<variable name="var1" value="0.0"/>
<scan>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptAction">
<script>print 1</script>
</preAction>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptAction">
<script>def process():
print 3</script>
</preAction>
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptAction">
<mapping channel="TESTIOC:TESTCALCOUT:Input" variable="x"/>
<script>def process(x):
print x.get()</script>
</preAction>
<dimension zigzag="false" dataGroup="false">
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinearPositioner" name="TESTIOC:TESTCALCOUT:Input" asynchronous="false" id="id278043">
<start>0.0</start>
@@ -15,12 +27,17 @@
</positioner>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptAction">
<script>import time
def process():
time.sleep(0.1)</script>
time.sleep(0.1)
print 2</script>
</action>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTCALCOUT:Output" id="id348623"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="TESTIOC:TESTSINUS:SinCalc" id="id367393"/>
</dimension>
<manipulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScriptManipulation" id="Manip">
<script>def process():
return 0.0</script>
</manipulation>
</scan>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id278043" y="id348623 id367393" title="Plot 1"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id278043" y="Manip" title="Manip"/>
</configuration>

23
script/test/x.xml Normal file
View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration xmlns="http://www.psi.ch/~ebner/models/scan/1.0">
<data fileName="x.xml"/>
<description></description>
<scan>
<cdimension>
<positioner name="A" readback="B" id="id104469">
<start>0.0</start>
<end>0.0</end>
<stepSize>0.0</stepSize>
<integrationTime>0.0</integrationTime>
</positioner>
</cdimension>
<dimension>
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinearPositioner" name="A" readback="B" id="id124607">
<start>0.0</start>
<end>0.0</end>
<stepSize>0.0</stepSize>
</positioner>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Timestamp" id="id412416"/>
</dimension>
</scan>
</configuration>

View File

@@ -1,4 +1,16 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration xmlns="http://www.psi.ch/~ebner/models/scan/1.0">
<scan/>
<data fileName="xxx.xml"/>
<scan>
<dimension>
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="PseudoPositioner" id="Pos">
<counts>1000</counts>
</positioner>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Input" value="1" delay="0.01"/>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Input" value="1" operation="putq"/>
<action xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="TESTIOC:TESTCALCOUT:Input" value="1" operation="wait" type="Integer"/>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Timestamp" id="Det"/>
</dimension>
</scan>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="Pos" y="Det"/>
</configuration>

23
script/test/y.xml Normal file
View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration xmlns="http://www.psi.ch/~ebner/models/scan/1.0">
<data fileName="x.xml"/>
<description></description>
<scan>
<cdimension>
<positioner name="A" readback="" id="id104469">
<start>0.0</start>
<end>0.0</end>
<stepSize>0.0</stepSize>
<integrationTime>0.0</integrationTime>
</positioner>
</cdimension>
<dimension zigzag="false" dataGroup="false">
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinearPositioner" name="A" readback="" id="id124607">
<start>0.0</start>
<end>0.0</end>
<stepSize>0.0</stepSize>
</positioner>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Timestamp" id="id412416"/>
</dimension>
</scan>
</configuration>