06.2026
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#Wed Dec 03 15:12:13 CET 2025
|
||||
#Wed May 20 15:06:54 CEST 2026
|
||||
commandQueueSize=-1
|
||||
commandStatistics=false
|
||||
commandTimeToLive=600000
|
||||
@@ -24,7 +24,7 @@ logLevel=Fine
|
||||
logPath={logs}/{date}_{time}.{mode}
|
||||
notificationLevel=Completion
|
||||
notificationTasks=EigerAbsSpec|Eiger2Img
|
||||
pythonHome=
|
||||
pythonHome=/sls/controls/applications/pshell/cpython/Python-3.12.9
|
||||
scanAutoSave=true
|
||||
scanDefaultTag=null
|
||||
scanFlushRecords=true
|
||||
@@ -39,7 +39,7 @@ scanSaveSetpoints=false
|
||||
scanSaveTimestamps=false
|
||||
scanStreamerPort=-1
|
||||
serverCommandsHidden=false
|
||||
serverEnabled=false
|
||||
serverEnabled=true
|
||||
serverHostName=null
|
||||
serverHttps=false
|
||||
serverPort=8080
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
eiger=ch.psi.pshell.epics.AreaDetector|X11MA-ES1-EIGER|||true
|
||||
BML_RMU1_CAM=ch.psi.pshell.epics.AreaDetector|X11MA-OP-RM1CAM|||true
|
||||
BML_AUSL_CAM=ch.psi.pshell.epics.AreaDetector|X11MA-OP-AUSLCAM|||true
|
||||
BML_RMU1_CAM=ch.psi.pshell.epics.AreaDetector|X11MA-OP-RM1CAM|||true
|
||||
#cam2=ch.psi.pshell.epics.AreaDetector|X11MA-ES1-CAM2|||true
|
||||
#peemcam=ch.psi.pshell.epics.AreaDetector|X11MA-ES1-PEEMCAM|||true
|
||||
ai1_temperature=ch.psi.pshell.epics.ReadonlyProcessVariable|X11MA-CPCL-ET7000:SW-K1|Read||true
|
||||
@@ -25,8 +25,8 @@ ai1_temperature=ch.psi.pshell.epics.ReadonlyProcessVariable|X11MA-CPCL-ET7000:SW
|
||||
#Grating_ch=ch.psi.pshell.epics.ChannelString|X11MA-PGM-GRCH:GRATING|||true
|
||||
#DiffOrd=ch.psi.pshell.epics.ChannelString|X11MA-PGM:difforder0|||true
|
||||
#voltage=ch.psi.pshell.epics.ChannelDouble|X11MA-KEI13:SETVOLTAGE|||true
|
||||
BML_FE_CX_RBV=ch.psi.pshell.epics.ChannelDouble|X11MA-FE-SL1:CENTERX.RBV|Read||true
|
||||
BML_FE_CY_RBV=ch.psi.pshell.epics.ChannelDouble|X11MA-FE-SL1:CENTERY.RBV|Read||true
|
||||
#BML_FE_CX_RBV=ch.psi.pshell.epics.ChannelDouble|X11MA-FE-SL1:CENTERX.RBV|Read||true
|
||||
#BML_FE_CY_RBV=ch.psi.pshell.epics.ChannelDouble|X11MA-FE-SL1:CENTERY.RBV|Read||true
|
||||
BML_CMU_TRY=ch.psi.pshell.epics.Motor|X11MA-OP2-CM:TRY|||true
|
||||
BML_CMU_TRZ=ch.psi.pshell.epics.Motor|X11MA-OP2-CM:TRZ|||true
|
||||
BML_CMU_ROX=ch.psi.pshell.epics.Motor|X11MA-OP2-CM:ROX|||true
|
||||
@@ -97,13 +97,21 @@ SR_current=ch.psi.pshell.epics.ChannelDouble|AGEBD-DBPM3CURR:CURRENT-AVG|Read||t
|
||||
#pol_angle=ch.psi.pshell.epics.ChannelDouble|X11MA-ID2:ALPHA|||true
|
||||
#pol_offset=ch.psi.pshell.epics.ChannelDouble|X11MA-ID2:ENERGY-OFFS|||true
|
||||
#pol_done=ch.psi.pshell.epics.ChannelString|X11MA-ID2:DONE|Read||true
|
||||
ID1_X_POS=ch.psi.pshell.epics.Positioner|X11MA-UIND1-MOVER:X-SP X11MA-UIND1-MOVER:X-RBV|||true
|
||||
ID1_Y_POS=ch.psi.pshell.epics.Positioner|X11MA-UIND1-MOVER:Y-SP X11MA-UIND1-MOVER:Y-RBV|||true
|
||||
ID1_YAW=ch.psi.pshell.epics.Positioner|X11MA-UIND1-MOVER:YAW-SP X11MA-UIND1-MOVER:YAW-RBV|||true
|
||||
ID1_PITCH=ch.psi.pshell.epics.Positioner|X11MA-UIND1-MOVER:PITCH-SP X11MA-UIND1-MOVER:PITCH-RBV|||true
|
||||
#id1_mode=ch.psi.pshell.epics.DiscretePositioner|X11MA-ID1:MODE|||true
|
||||
#id1_alpha=ch.psi.pshell.epics.ChannelDouble|X11MA-ID1:ALPHA|||true
|
||||
#id1_offset=ch.psi.pshell.epics.ChannelDouble|X11MA-ID1:ENERGY-OFFS|||true
|
||||
#id1_harmonic=ch.psi.pshell.epics.ChannelDouble|X11MA-ID1:HARMONIC|||true
|
||||
#id1_gap=ch.psi.pshell.epics.ChannelDouble|X11MA-ID1-GAP:READ 3|||true
|
||||
#id1_gap=ch.psi.pshell.epics.ChannelDouble|X11MA-UIND1:GAP-RBV 3|||true
|
||||
#id1_shift=ch.psi.pshell.epics.ChannelDouble|X11MA-ID1-SHIFT:READ|||true
|
||||
#id1_done=ch.psi.pshell.epics.ChannelString|X11MA-ID1:DONE|Read||true
|
||||
ID2_X_POS=ch.psi.pshell.epics.Positioner|X11MA-UIND2-MOVER:X-SP X11MA-UIND2-MOVER:X-RBV|||true
|
||||
ID2_Y_POS=ch.psi.pshell.epics.Positioner|X11MA-UIND2-MOVER:Y-SP X11MA-UIND2-MOVER:Y-RBV|||true
|
||||
ID2_YAW=ch.psi.pshell.epics.Positioner|X11MA-UIND2-MOVER:YAW-SP X11MA-UIND2-MOVER:YAW-RBV|||true
|
||||
ID2_PITCH=ch.psi.pshell.epics.Positioner|X11MA-UIND2-MOVER:PITCH-SP X11MA-UIND2-MOVER:PITCH-RBV|||true
|
||||
ID2_mode=ch.psi.pshell.epics.DiscretePositioner|X11MA-UIND2:MODE X11MA-UIND2:MODE-ACT||1000|true
|
||||
#id2_alpha=ch.psi.pshell.epics.ChannelDouble|X11MA-ID2:ALPHA|||true
|
||||
ID2_offset=ch.psi.pshell.epics.ChannelDouble|X11MA-UIND2:ENERGY-OFFS|||true
|
||||
@@ -111,9 +119,9 @@ ID2_offset=ch.psi.pshell.epics.ChannelDouble|X11MA-UIND2:ENERGY-OFFS|||true
|
||||
ID2_gap=ch.psi.pshell.epics.ChannelDouble|X11MA-UIND2:GAP|||true
|
||||
#id2_shift=ch.psi.pshell.epics.ChannelDouble|X11MA-ID2-SHIFT:READ|||true
|
||||
#id2_done=ch.psi.pshell.epics.ChannelString|X11MA-ID2:DONE|Read||true
|
||||
BML_energy_set=ch.psi.pshell.epics.ChannelDouble|X11PHS-E:GO.A|||true
|
||||
BML_energy_RBV=ch.psi.pshell.epics.ChannelDouble|X11MA-PGM:rbkenergy|Read||true
|
||||
BML_energy=ch.psi.pshell.epics.Positioner|X11PHS-E:GO.A X11MA-PGM:rbkenergy|||true
|
||||
#BML_energy_RBV=ch.psi.pshell.epics.ChannelDouble|X11MA-PGM:rbkenergy|Read||true
|
||||
#BML_energy_old=ch.psi.pshell.epics.Positioner|X11PHS-E:GO.A X11MA-PGM:rbkenergy|||true
|
||||
BML_energy_mode=ch.psi.pshell.epics.ChannelString|X11PHS-E:OPT|||true
|
||||
#id_error=ch.psi.pshell.epics.ChannelInteger|X11MA-ID2-PLC:ERROR|||true
|
||||
#beam_status=ch.psi.pshell.epics.DiscretePositioner|ACOAU-ACCU:OP-MODE|Read||true
|
||||
@@ -180,6 +188,7 @@ raw=ch.psi.pshell.imaging.CameraSource|eiger|||true
|
||||
#image2=ch.psi.pshell.imaging.CameraSource|cam2|||true
|
||||
#img_peemcam=ch.psi.pshell.imaging.CameraSource|peemcam|||true
|
||||
axis=ch.psi.pshell.imaging.MjpegSource|http://axis-x11ma.psi.ch/axis-cgi/mjpg/video.cgi?id=176%20true||-200|false
|
||||
AXIS_M1135_Mk_II=ch.psi.pshell.imaging.MjpegSource|http://129.129.121.72/axis-cgi/mjpg/video.cgi?id=0 true||-200|false
|
||||
axis2=ch.psi.pshell.imaging.MjpegSource|http://root:monocam-4@129.129.121.54/axis-cgi/mjpg/video.cgi?id=0 true||-200|
|
||||
IMG_BML_RMU1_CAM=ch.psi.pshell.imaging.CameraSource|BML_RMU1_CAM|||true
|
||||
IMG_BML_AUSL_CAM=ch.psi.pshell.imaging.CameraSource|BML_AUSL_CAM|||true
|
||||
|
||||
@@ -5,5 +5,5 @@ usr=
|
||||
smsSuffix=@sms.switch.ch
|
||||
host=smtpint.psi.ch
|
||||
from=pshell.sim@psi.ch
|
||||
to=
|
||||
to=alexandre.gobbo@psi.ch
|
||||
pwd=
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
#Wed Nov 20 14:33:45 CET 2024
|
||||
SessionCounter=89
|
||||
#Tue Mar 17 14:20:44 CET 2026
|
||||
SessionCounter=90
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#Wed Dec 17 09:12:58 CET 2025
|
||||
#Wed Jun 24 13:19:47 CEST 2026
|
||||
ALPHA_ID_2=0.0
|
||||
AUTO_SWITCH_BEAMLINE=false
|
||||
AUTO_SWITCH_SHUTTER=true
|
||||
|
||||
-456197
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
#Wed Dec 17 09:55:52 CET 2025
|
||||
DaySequentialNumber=8
|
||||
FileSequentialNumber=635
|
||||
LastRunDate=251217
|
||||
#Mon Jun 22 23:51:18 CEST 2026
|
||||
DaySequentialNumber=18
|
||||
FileSequentialNumber=1142
|
||||
LastRunDate=260622
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
#Wed May 20 14:16:35 CEST 2026
|
||||
flipHorizontally=false
|
||||
flipVertically=false
|
||||
grayscale=false
|
||||
invert=false
|
||||
rescaleFactor=1.0
|
||||
rescaleOffset=0.0
|
||||
roiHeight=-1
|
||||
roiWidth=-1
|
||||
roiX=0
|
||||
roiY=0
|
||||
rotation=0.0
|
||||
rotationCrop=false
|
||||
scale=1.0
|
||||
spatialCalOffsetX=NaN
|
||||
spatialCalOffsetY=NaN
|
||||
spatialCalScaleX=NaN
|
||||
spatialCalScaleY=NaN
|
||||
spatialCalUnits=mm
|
||||
transpose=false
|
||||
@@ -1,5 +1,5 @@
|
||||
#Fri Nov 21 13:51:01 CET 2025
|
||||
deadband=1.0
|
||||
#Thu Jan 22 10:35:26 CET 2026
|
||||
deadband=0.05
|
||||
defaultSpeed=0.1
|
||||
description=slit X center
|
||||
estbilizationDelay=0
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#Fri Nov 21 13:51:14 CET 2025
|
||||
deadband=1.0
|
||||
#Wed Jan 21 16:01:01 CET 2026
|
||||
deadband=0.05
|
||||
defaultSpeed=0.1
|
||||
description=slit X center
|
||||
estbilizationDelay=0
|
||||
@@ -7,7 +7,7 @@ hasEnable=false
|
||||
homingType=None
|
||||
maxSpeed=2.0
|
||||
maxValue=4.0
|
||||
minSpeed=0.1
|
||||
minSpeed=0.01
|
||||
minValue=-4.0
|
||||
monitorByPosition=false
|
||||
offset=0.0
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#Fri Dec 12 14:05:28 CET 2025
|
||||
deadband=0.05
|
||||
#Thu Jun 18 18:21:50 CEST 2026
|
||||
deadband=0.1
|
||||
defaultSpeed=NaN
|
||||
description=null
|
||||
estbilizationDelay=0
|
||||
@@ -11,9 +11,9 @@ minSpeed=NaN
|
||||
minValue=100.0
|
||||
monitorByPosition=false
|
||||
offset=0.0
|
||||
precision=-1
|
||||
precision=4
|
||||
rotation=false
|
||||
scale=1.0
|
||||
sign_bit=0
|
||||
startRetries=1
|
||||
unit=null
|
||||
unit=eV
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
#Wed Jan 21 15:38:28 CET 2026
|
||||
deadband=1.0
|
||||
description=null
|
||||
maxValue=10000.0
|
||||
minValue=0.0
|
||||
offset=0.0
|
||||
precision=-1
|
||||
rotation=false
|
||||
scale=1.0
|
||||
sign_bit=0
|
||||
unit=null
|
||||
@@ -0,0 +1,19 @@
|
||||
#Thu Jun 18 15:07:32 CEST 2026
|
||||
deadband=NaN
|
||||
defaultSpeed=NaN
|
||||
description=null
|
||||
estbilizationDelay=0
|
||||
hasEnable=false
|
||||
homingType=None
|
||||
maxSpeed=NaN
|
||||
maxValue=NaN
|
||||
minSpeed=NaN
|
||||
minValue=NaN
|
||||
monitorByPosition=false
|
||||
offset=0.0
|
||||
precision=-1
|
||||
rotation=false
|
||||
scale=1.0
|
||||
sign_bit=0
|
||||
startRetries=1
|
||||
unit=null
|
||||
@@ -0,0 +1,11 @@
|
||||
#Fri Jun 19 23:03:34 CEST 2026
|
||||
deadband=0.002
|
||||
description=Mover Pitch
|
||||
maxValue=0.3
|
||||
minValue=-0.3
|
||||
offset=0.0
|
||||
precision=4
|
||||
rotation=false
|
||||
scale=1.0
|
||||
sign_bit=0
|
||||
unit=mrad
|
||||
@@ -0,0 +1,11 @@
|
||||
#Mon Jun 22 21:49:19 CEST 2026
|
||||
deadband=0.01
|
||||
description=Mover X
|
||||
maxValue=0.4
|
||||
minValue=-0.4
|
||||
offset=0.0
|
||||
precision=4
|
||||
rotation=false
|
||||
scale=1.0
|
||||
sign_bit=0
|
||||
unit=mm
|
||||
@@ -0,0 +1,11 @@
|
||||
#Fri Jun 19 23:04:23 CEST 2026
|
||||
deadband=0.002
|
||||
description=Mover Yaw
|
||||
maxValue=0.3
|
||||
minValue=-0.3
|
||||
offset=0.0
|
||||
precision=4
|
||||
rotation=false
|
||||
scale=1.0
|
||||
sign_bit=0
|
||||
unit=mrad
|
||||
@@ -0,0 +1,11 @@
|
||||
#Mon Jun 22 21:49:28 CEST 2026
|
||||
deadband=0.01
|
||||
description=Mover Y
|
||||
maxValue=0.4
|
||||
minValue=-0.4
|
||||
offset=0.0
|
||||
precision=4
|
||||
rotation=false
|
||||
scale=1.0
|
||||
sign_bit=0
|
||||
unit=mm
|
||||
@@ -0,0 +1,19 @@
|
||||
#Thu Jun 18 15:45:52 CEST 2026
|
||||
deadband=0.002
|
||||
defaultSpeed=NaN
|
||||
description=Mover X
|
||||
estbilizationDelay=0
|
||||
hasEnable=false
|
||||
homingType=None
|
||||
maxSpeed=NaN
|
||||
maxValue=0.31
|
||||
minSpeed=NaN
|
||||
minValue=-0.31
|
||||
monitorByPosition=false
|
||||
offset=0.0
|
||||
precision=4
|
||||
rotation=false
|
||||
scale=1.0
|
||||
sign_bit=0
|
||||
startRetries=1
|
||||
unit=mm
|
||||
@@ -0,0 +1,11 @@
|
||||
#Thu Jun 18 15:45:40 CEST 2026
|
||||
deadband=0.002
|
||||
description=Mover Y
|
||||
maxValue=0.31
|
||||
minValue=-0.31
|
||||
offset=0.0
|
||||
precision=4
|
||||
rotation=false
|
||||
scale=1.0
|
||||
sign_bit=0
|
||||
unit=mm
|
||||
@@ -0,0 +1,11 @@
|
||||
#Sun Jun 21 21:36:49 CEST 2026
|
||||
deadband=0.002
|
||||
description=Mover Pitch
|
||||
maxValue=0.3
|
||||
minValue=-0.3
|
||||
offset=0.0
|
||||
precision=4
|
||||
rotation=false
|
||||
scale=1.0
|
||||
sign_bit=0
|
||||
unit=mrad
|
||||
@@ -0,0 +1,11 @@
|
||||
#Sun Jun 21 21:37:19 CEST 2026
|
||||
deadband=0.002
|
||||
description=Mover X
|
||||
maxValue=0.3
|
||||
minValue=-0.3
|
||||
offset=0.0
|
||||
precision=4
|
||||
rotation=false
|
||||
scale=1.0
|
||||
sign_bit=0
|
||||
unit=mm
|
||||
@@ -0,0 +1,11 @@
|
||||
#Sun Jun 21 21:38:11 CEST 2026
|
||||
deadband=0.002
|
||||
description=Mover Yaw
|
||||
maxValue=0.3
|
||||
minValue=-0.3
|
||||
offset=0.0
|
||||
precision=4
|
||||
rotation=false
|
||||
scale=1.0
|
||||
sign_bit=0
|
||||
unit=mrad
|
||||
@@ -0,0 +1,11 @@
|
||||
#Sun Jun 21 21:37:37 CEST 2026
|
||||
deadband=0.002
|
||||
description=Mover Y
|
||||
maxValue=0.4
|
||||
minValue=-0.4
|
||||
offset=0.0
|
||||
precision=4
|
||||
rotation=false
|
||||
scale=1.0
|
||||
sign_bit=0
|
||||
unit=mm
|
||||
@@ -0,0 +1,11 @@
|
||||
#Thu Jun 18 15:50:07 CEST 2026
|
||||
deadband=0.002
|
||||
description=Mover X
|
||||
maxValue=0.31
|
||||
minValue=-0.31
|
||||
offset=0.0
|
||||
precision=4
|
||||
rotation=false
|
||||
scale=1.0
|
||||
sign_bit=0
|
||||
unit=mm
|
||||
@@ -0,0 +1,11 @@
|
||||
#Thu Jun 18 15:59:53 CEST 2026
|
||||
deadband=0.002
|
||||
description=Mover Y
|
||||
maxValue=0.31
|
||||
minValue=-0.31
|
||||
offset=0.0
|
||||
precision=4
|
||||
rotation=false
|
||||
scale=1.0
|
||||
sign_bit=0
|
||||
unit=mm
|
||||
@@ -1,6 +1,6 @@
|
||||
#Wed Nov 19 16:22:47 CET 2025
|
||||
#Mon May 18 14:26:12 CEST 2026
|
||||
colormap=Grayscale
|
||||
colormapAutomatic=false
|
||||
colormapAutomatic=true
|
||||
colormapLogarithmic=false
|
||||
colormapMax=NaN
|
||||
colormapMin=NaN
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
#Wed Dec 17 15:27:13 CET 2025
|
||||
flipHorizontally=false
|
||||
flipVertically=false
|
||||
grayscale=false
|
||||
invert=false
|
||||
rescaleFactor=1.0
|
||||
rescaleOffset=0.0
|
||||
roiHeight=-1
|
||||
roiWidth=-1
|
||||
roiX=0
|
||||
roiY=0
|
||||
rotation=0.0
|
||||
rotationCrop=false
|
||||
scale=1.0
|
||||
spatialCalOffsetX=NaN
|
||||
spatialCalOffsetY=NaN
|
||||
spatialCalScaleX=NaN
|
||||
spatialCalScaleY=NaN
|
||||
spatialCalUnits=mm
|
||||
transpose=false
|
||||
@@ -0,0 +1,20 @@
|
||||
#Wed Dec 17 13:16:14 CET 2025
|
||||
flipHorizontally=false
|
||||
flipVertically=false
|
||||
grayscale=false
|
||||
invert=false
|
||||
rescaleFactor=1.0
|
||||
rescaleOffset=0.0
|
||||
roiHeight=-1
|
||||
roiWidth=-1
|
||||
roiX=0
|
||||
roiY=0
|
||||
rotation=0.0
|
||||
rotationCrop=false
|
||||
scale=1.0
|
||||
spatialCalOffsetX=NaN
|
||||
spatialCalOffsetY=NaN
|
||||
spatialCalScaleX=NaN
|
||||
spatialCalScaleY=NaN
|
||||
spatialCalUnits=mm
|
||||
transpose=false
|
||||
@@ -0,0 +1,11 @@
|
||||
#Wed Jan 21 14:09:49 CET 2026
|
||||
deadband=0.0015
|
||||
description=slit X center
|
||||
maxValue=1.0
|
||||
minValue=-1.0
|
||||
offset=0.0
|
||||
precision=5
|
||||
rotation=false
|
||||
scale=1.0
|
||||
sign_bit=0
|
||||
unit=mm
|
||||
@@ -0,0 +1,11 @@
|
||||
#Wed Jan 21 14:09:38 CET 2026
|
||||
deadband=0.0015
|
||||
description=slit Y center
|
||||
maxValue=1.0
|
||||
minValue=-1.0
|
||||
offset=0.0
|
||||
precision=5
|
||||
rotation=false
|
||||
scale=1.0
|
||||
sign_bit=0
|
||||
unit=mm
|
||||
@@ -0,0 +1,11 @@
|
||||
#Fri Jun 19 16:04:22 CEST 2026
|
||||
deadband=0.005
|
||||
description=eV
|
||||
maxValue=1000.0
|
||||
minValue=250.0
|
||||
offset=0.0
|
||||
precision=4
|
||||
rotation=false
|
||||
scale=1.0
|
||||
sign_bit=0
|
||||
unit=eV
|
||||
@@ -1,8 +1,8 @@
|
||||
#Mon Dec 15 12:53:06 CET 2025
|
||||
#Thu Jun 18 09:26:11 CEST 2026
|
||||
colormap=Grayscale
|
||||
colormapAutomatic=false
|
||||
colormapLogarithmic=false
|
||||
colormapMax=1.0
|
||||
colormapMax=18000.0
|
||||
colormapMin=0.0
|
||||
flipHorizontally=false
|
||||
flipVertically=false
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package sparseviewer;
|
||||
|
||||
import sparseviewer.ui.MainFrame;
|
||||
import ij.plugin.PlugIn;
|
||||
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
public class SparseScanViewer_Plugin implements PlugIn {
|
||||
|
||||
@Override
|
||||
public void run(String arg) {
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
MainFrame frame = new MainFrame();
|
||||
frame.setVisible(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package sparseviewer.filter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DirectionFilter {
|
||||
|
||||
public static FilteredData apply(double[] x,
|
||||
double[] y,
|
||||
double[] z,
|
||||
double[] fastAxis,
|
||||
DirectionMode mode,
|
||||
double epsilon) {
|
||||
|
||||
if (x == null || y == null || z == null) {
|
||||
return new FilteredData(new double[0], new double[0], new double[0], new int[0]);
|
||||
}
|
||||
|
||||
if (mode == DirectionMode.ALL || fastAxis == null) {
|
||||
return copyFinite(x, y, z);
|
||||
}
|
||||
|
||||
int n = Math.min(Math.min(x.length, y.length), z.length);
|
||||
n = Math.min(n, fastAxis.length);
|
||||
|
||||
List<Double> xf = new ArrayList<Double>();
|
||||
List<Double> yf = new ArrayList<Double>();
|
||||
List<Double> zf = new ArrayList<Double>();
|
||||
List<Integer> idx = new ArrayList<Integer>();
|
||||
|
||||
for (int i = 1; i < n; i++) {
|
||||
if (!isFinite(x[i]) || !isFinite(y[i]) || !isFinite(z[i])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isFinite(fastAxis[i]) || !isFinite(fastAxis[i - 1])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
double delta = fastAxis[i] - fastAxis[i - 1];
|
||||
|
||||
boolean keep = false;
|
||||
|
||||
if (mode == DirectionMode.POSITIVE) {
|
||||
keep = delta > epsilon;
|
||||
} else if (mode == DirectionMode.NEGATIVE) {
|
||||
keep = delta < -epsilon;
|
||||
}
|
||||
|
||||
if (keep) {
|
||||
xf.add(Double.valueOf(x[i]));
|
||||
yf.add(Double.valueOf(y[i]));
|
||||
zf.add(Double.valueOf(z[i]));
|
||||
idx.add(Integer.valueOf(i));
|
||||
}
|
||||
}
|
||||
|
||||
return toFilteredData(xf, yf, zf, idx);
|
||||
}
|
||||
|
||||
private static FilteredData copyFinite(double[] x, double[] y, double[] z) {
|
||||
int n = Math.min(Math.min(x.length, y.length), z.length);
|
||||
|
||||
List<Double> xf = new ArrayList<Double>();
|
||||
List<Double> yf = new ArrayList<Double>();
|
||||
List<Double> zf = new ArrayList<Double>();
|
||||
List<Integer> idx = new ArrayList<Integer>();
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
if (!isFinite(x[i]) || !isFinite(y[i]) || !isFinite(z[i])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
xf.add(Double.valueOf(x[i]));
|
||||
yf.add(Double.valueOf(y[i]));
|
||||
zf.add(Double.valueOf(z[i]));
|
||||
idx.add(Integer.valueOf(i));
|
||||
}
|
||||
|
||||
return toFilteredData(xf, yf, zf, idx);
|
||||
}
|
||||
|
||||
private static FilteredData toFilteredData(List<Double> xf,
|
||||
List<Double> yf,
|
||||
List<Double> zf,
|
||||
List<Integer> idx) {
|
||||
int n = xf.size();
|
||||
|
||||
double[] x = new double[n];
|
||||
double[] y = new double[n];
|
||||
double[] z = new double[n];
|
||||
int[] sourceIndex = new int[n];
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
x[i] = xf.get(i).doubleValue();
|
||||
y[i] = yf.get(i).doubleValue();
|
||||
z[i] = zf.get(i).doubleValue();
|
||||
sourceIndex[i] = idx.get(i).intValue();
|
||||
}
|
||||
|
||||
return new FilteredData(x, y, z, sourceIndex);
|
||||
}
|
||||
|
||||
private static boolean isFinite(double v) {
|
||||
return !Double.isNaN(v) && !Double.isInfinite(v);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package sparseviewer.filter;
|
||||
|
||||
public enum DirectionMode {
|
||||
ALL,
|
||||
POSITIVE,
|
||||
NEGATIVE
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package sparseviewer.filter;
|
||||
|
||||
public class FilteredData {
|
||||
|
||||
private final double[] x;
|
||||
private final double[] y;
|
||||
private final double[] z;
|
||||
private final int[] sourceIndex;
|
||||
|
||||
public FilteredData(double[] x, double[] y, double[] z, int[] sourceIndex) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.sourceIndex = sourceIndex;
|
||||
}
|
||||
|
||||
public double[] getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public double[] getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public double[] getZ() {
|
||||
return z;
|
||||
}
|
||||
|
||||
public int[] getSourceIndex() {
|
||||
return sourceIndex;
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return x == null ? 0 : x.length;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package sparseviewer.interp;
|
||||
|
||||
public class Grid2D {
|
||||
|
||||
private final int width;
|
||||
private final int height;
|
||||
|
||||
private final double xmin;
|
||||
private final double xmax;
|
||||
private final double ymin;
|
||||
private final double ymax;
|
||||
|
||||
public Grid2D(int width, int height,
|
||||
double xmin, double xmax,
|
||||
double ymin, double ymax) {
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.xmin = xmin;
|
||||
this.xmax = xmax;
|
||||
this.ymin = ymin;
|
||||
this.ymax = ymax;
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public double getXMin() {
|
||||
return xmin;
|
||||
}
|
||||
|
||||
public double getXMax() {
|
||||
return xmax;
|
||||
}
|
||||
|
||||
public double getYMin() {
|
||||
return ymin;
|
||||
}
|
||||
|
||||
public double getYMax() {
|
||||
return ymax;
|
||||
}
|
||||
|
||||
public double xAt(int ix) {
|
||||
if (width <= 1) {
|
||||
return xmin;
|
||||
}
|
||||
|
||||
return xmin + ix * (xmax - xmin) / (double) (width - 1);
|
||||
}
|
||||
|
||||
public double yAt(int iy) {
|
||||
if (height <= 1) {
|
||||
return ymin;
|
||||
}
|
||||
|
||||
return ymin + iy * (ymax - ymin) / (double) (height - 1);
|
||||
}
|
||||
|
||||
public int xToIndex(double x) {
|
||||
if (xmax == xmin) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
double t = (x - xmin) / (xmax - xmin);
|
||||
int ix = (int) Math.round(t * (width - 1));
|
||||
|
||||
if (ix < 0) {
|
||||
ix = 0;
|
||||
}
|
||||
|
||||
if (ix >= width) {
|
||||
ix = width - 1;
|
||||
}
|
||||
|
||||
return ix;
|
||||
}
|
||||
|
||||
public int yToIndex(double y) {
|
||||
if (ymax == ymin) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
double t = (y - ymin) / (ymax - ymin);
|
||||
int iy = (int) Math.round(t * (height - 1));
|
||||
|
||||
if (iy < 0) {
|
||||
iy = 0;
|
||||
}
|
||||
|
||||
if (iy >= height) {
|
||||
iy = height - 1;
|
||||
}
|
||||
|
||||
return iy;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package sparseviewer.interp;
|
||||
|
||||
public class IdwInterpolator {
|
||||
|
||||
public static InterpolationResult interpolate(double[] x,
|
||||
double[] y,
|
||||
double[] z,
|
||||
int width,
|
||||
int height,
|
||||
double power) {
|
||||
Grid2D grid = createGrid(x, y, width, height);
|
||||
float[] out = new float[width * height];
|
||||
|
||||
double exponent = power * 0.5;
|
||||
|
||||
for (int iy = 0; iy < height; iy++) {
|
||||
double gy = grid.yAt(iy);
|
||||
|
||||
for (int ix = 0; ix < width; ix++) {
|
||||
double gx = grid.xAt(ix);
|
||||
|
||||
double numerator = 0.0;
|
||||
double denominator = 0.0;
|
||||
boolean exact = false;
|
||||
double exactValue = 0.0;
|
||||
|
||||
for (int i = 0; i < x.length; i++) {
|
||||
if (!isFinite(x[i]) || !isFinite(y[i]) || !isFinite(z[i])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
double dx = x[i] - gx;
|
||||
double dy = y[i] - gy;
|
||||
double d2 = dx * dx + dy * dy;
|
||||
|
||||
if (d2 < 1e-24) {
|
||||
exact = true;
|
||||
exactValue = z[i];
|
||||
break;
|
||||
}
|
||||
|
||||
double w = 1.0 / Math.pow(d2, exponent);
|
||||
|
||||
numerator += w * z[i];
|
||||
denominator += w;
|
||||
}
|
||||
|
||||
if (exact) {
|
||||
out[iy * width + ix] = (float) exactValue;
|
||||
} else if (denominator > 0.0) {
|
||||
out[iy * width + ix] = (float) (numerator / denominator);
|
||||
} else {
|
||||
out[iy * width + ix] = Float.NaN;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new InterpolationResult(grid, out);
|
||||
}
|
||||
|
||||
private static Grid2D createGrid(double[] x, double[] y, int width, int height) {
|
||||
double xmin = Double.POSITIVE_INFINITY;
|
||||
double xmax = Double.NEGATIVE_INFINITY;
|
||||
double ymin = Double.POSITIVE_INFINITY;
|
||||
double ymax = Double.NEGATIVE_INFINITY;
|
||||
|
||||
for (int i = 0; i < x.length; i++) {
|
||||
if (isFinite(x[i])) {
|
||||
if (x[i] < xmin) xmin = x[i];
|
||||
if (x[i] > xmax) xmax = x[i];
|
||||
}
|
||||
|
||||
if (isFinite(y[i])) {
|
||||
if (y[i] < ymin) ymin = y[i];
|
||||
if (y[i] > ymax) ymax = y[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (xmin == xmax) {
|
||||
xmin -= 1.0;
|
||||
xmax += 1.0;
|
||||
}
|
||||
|
||||
if (ymin == ymax) {
|
||||
ymin -= 1.0;
|
||||
ymax += 1.0;
|
||||
}
|
||||
|
||||
double xpad = 0.03 * (xmax - xmin);
|
||||
double ypad = 0.03 * (ymax - ymin);
|
||||
|
||||
return new Grid2D(width, height,
|
||||
xmin - xpad,
|
||||
xmax + xpad,
|
||||
ymin - ypad,
|
||||
ymax + ypad);
|
||||
}
|
||||
|
||||
private static boolean isFinite(double v) {
|
||||
return !Double.isNaN(v) && !Double.isInfinite(v);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package sparseviewer.interp;
|
||||
|
||||
public enum InterpolationMethod {
|
||||
NEAREST,
|
||||
IDW
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package sparseviewer.interp;
|
||||
|
||||
public class InterpolationResult {
|
||||
|
||||
private final Grid2D grid;
|
||||
private final float[] pixels;
|
||||
private final double zmin;
|
||||
private final double zmax;
|
||||
|
||||
public InterpolationResult(Grid2D grid, float[] pixels) {
|
||||
this.grid = grid;
|
||||
this.pixels = pixels;
|
||||
|
||||
double min = Double.POSITIVE_INFINITY;
|
||||
double max = Double.NEGATIVE_INFINITY;
|
||||
|
||||
for (int i = 0; i < pixels.length; i++) {
|
||||
float v = pixels[i];
|
||||
|
||||
if (Float.isNaN(v) || Float.isInfinite(v)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (v < min) {
|
||||
min = v;
|
||||
}
|
||||
|
||||
if (v > max) {
|
||||
max = v;
|
||||
}
|
||||
}
|
||||
|
||||
if (min == Double.POSITIVE_INFINITY || max == Double.NEGATIVE_INFINITY) {
|
||||
min = 0.0;
|
||||
max = 1.0;
|
||||
}
|
||||
|
||||
if (min == max) {
|
||||
min -= 1.0;
|
||||
max += 1.0;
|
||||
}
|
||||
|
||||
this.zmin = min;
|
||||
this.zmax = max;
|
||||
}
|
||||
|
||||
public Grid2D getGrid() {
|
||||
return grid;
|
||||
}
|
||||
|
||||
public float[] getPixels() {
|
||||
return pixels;
|
||||
}
|
||||
|
||||
public double getZMin() {
|
||||
return zmin;
|
||||
}
|
||||
|
||||
public double getZMax() {
|
||||
return zmax;
|
||||
}
|
||||
|
||||
public float getValueAtIndex(int ix, int iy) {
|
||||
if (ix < 0 || iy < 0 || ix >= grid.getWidth() || iy >= grid.getHeight()) {
|
||||
return Float.NaN;
|
||||
}
|
||||
|
||||
return pixels[iy * grid.getWidth() + ix];
|
||||
}
|
||||
|
||||
public float getNearestValue(double x, double y) {
|
||||
int ix = grid.xToIndex(x);
|
||||
int iy = grid.yToIndex(y);
|
||||
return getValueAtIndex(ix, iy);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package sparseviewer.interp;
|
||||
|
||||
public class NearestInterpolator {
|
||||
|
||||
public static InterpolationResult interpolate(double[] x,
|
||||
double[] y,
|
||||
double[] z,
|
||||
int width,
|
||||
int height) {
|
||||
Grid2D grid = createGrid(x, y, width, height);
|
||||
float[] out = new float[width * height];
|
||||
|
||||
for (int iy = 0; iy < height; iy++) {
|
||||
double gy = grid.yAt(iy);
|
||||
|
||||
for (int ix = 0; ix < width; ix++) {
|
||||
double gx = grid.xAt(ix);
|
||||
|
||||
int best = -1;
|
||||
double bestD2 = Double.POSITIVE_INFINITY;
|
||||
|
||||
for (int i = 0; i < x.length; i++) {
|
||||
if (!isFinite(x[i]) || !isFinite(y[i]) || !isFinite(z[i])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
double dx = x[i] - gx;
|
||||
double dy = y[i] - gy;
|
||||
double d2 = dx * dx + dy * dy;
|
||||
|
||||
if (d2 < bestD2) {
|
||||
bestD2 = d2;
|
||||
best = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (best >= 0) {
|
||||
out[iy * width + ix] = (float) z[best];
|
||||
} else {
|
||||
out[iy * width + ix] = Float.NaN;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new InterpolationResult(grid, out);
|
||||
}
|
||||
|
||||
private static Grid2D createGrid(double[] x, double[] y, int width, int height) {
|
||||
double xmin = Double.POSITIVE_INFINITY;
|
||||
double xmax = Double.NEGATIVE_INFINITY;
|
||||
double ymin = Double.POSITIVE_INFINITY;
|
||||
double ymax = Double.NEGATIVE_INFINITY;
|
||||
|
||||
for (int i = 0; i < x.length; i++) {
|
||||
if (isFinite(x[i])) {
|
||||
if (x[i] < xmin) xmin = x[i];
|
||||
if (x[i] > xmax) xmax = x[i];
|
||||
}
|
||||
|
||||
if (isFinite(y[i])) {
|
||||
if (y[i] < ymin) ymin = y[i];
|
||||
if (y[i] > ymax) ymax = y[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (xmin == xmax) {
|
||||
xmin -= 1.0;
|
||||
xmax += 1.0;
|
||||
}
|
||||
|
||||
if (ymin == ymax) {
|
||||
ymin -= 1.0;
|
||||
ymax += 1.0;
|
||||
}
|
||||
|
||||
double xpad = 0.03 * (xmax - xmin);
|
||||
double ypad = 0.03 * (ymax - ymin);
|
||||
|
||||
return new Grid2D(width, height,
|
||||
xmin - xpad,
|
||||
xmax + xpad,
|
||||
ymin - ypad,
|
||||
ymax + ypad);
|
||||
}
|
||||
|
||||
private static boolean isFinite(double v) {
|
||||
return !Double.isNaN(v) && !Double.isInfinite(v);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,419 @@
|
||||
package sparseviewer.io;
|
||||
|
||||
import sparseviewer.mda.MdaDetector;
|
||||
import sparseviewer.mda.MdaPositioner;
|
||||
import sparseviewer.mda.MdaScan;
|
||||
import sparseviewer.mda.XdrInput;
|
||||
import sparseviewer.model.ScanDataset;
|
||||
import sparseviewer.mda.MdaFileData;
|
||||
|
||||
import ij.IJ;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MdaReader {
|
||||
|
||||
public static ScanDataset readFiles(List<File> files) throws IOException {
|
||||
if (files == null || files.isEmpty()) {
|
||||
throw new IOException("No MDA file selected.");
|
||||
}
|
||||
|
||||
if (files.size() > 1) {
|
||||
throw new IOException("MDA support currently expects a single file.");
|
||||
}
|
||||
|
||||
File file = files.get(0);
|
||||
|
||||
MdaFileData mda = readMdaFile(file);
|
||||
|
||||
if (mda.rank == 1) {
|
||||
return toScanDatasetRank1(mda, file);
|
||||
}
|
||||
|
||||
if (mda.rank == 2) {
|
||||
return toScanDatasetRank2(mda, file);
|
||||
}
|
||||
|
||||
throw new IOException("Only MDA rank 1 and rank 2 are supported currently. File rank = " + mda.rank);
|
||||
}
|
||||
private static MdaFileData readMdaFile(File file) throws IOException {
|
||||
XdrInput in = new XdrInput(file);
|
||||
|
||||
try {
|
||||
MdaFileData data = new MdaFileData();
|
||||
|
||||
data.version = in.readFloat();
|
||||
|
||||
if (Math.abs(data.version - 1.3f) > 0.02f
|
||||
&& Math.abs(data.version - 1.4f) > 0.02f) {
|
||||
throw new IOException("Unsupported MDA version: " + data.version);
|
||||
}
|
||||
|
||||
data.scanNumber = in.readInt();
|
||||
data.rank = in.readInt();
|
||||
|
||||
if (data.rank < 1 || data.rank > 4) {
|
||||
throw new IOException("Invalid MDA rank: " + data.rank);
|
||||
}
|
||||
|
||||
data.dimensions = in.readIntArray(data.rank);
|
||||
data.isRegular = in.readInt();
|
||||
data.pExtra = in.readInt();
|
||||
|
||||
long mainScanOffset = in.getFilePointer();
|
||||
|
||||
data.mainScan = readScan(in, mainScanOffset);
|
||||
|
||||
if (data.rank == 2) {
|
||||
readRank2InnerScans(in, data);
|
||||
}
|
||||
|
||||
IJ.log("MDA loaded: " + file.getName()
|
||||
+ ", version=" + data.version
|
||||
+ ", rank=" + data.rank
|
||||
+ ", scanNumber=" + data.scanNumber);
|
||||
|
||||
return data;
|
||||
|
||||
} finally {
|
||||
in.close();
|
||||
}
|
||||
}
|
||||
private static void readRank2InnerScans(XdrInput in, MdaFileData data) throws IOException {
|
||||
MdaScan outer = data.mainScan;
|
||||
|
||||
if (outer.lowerScanOffsets == null) {
|
||||
throw new IOException("Rank 2 MDA file has no lower scan offsets.");
|
||||
}
|
||||
|
||||
int nOuter = Math.min(outer.currPt, outer.lowerScanOffsets.length);
|
||||
|
||||
for (int i = 0; i < nOuter; i++) {
|
||||
int offset = outer.lowerScanOffsets[i];
|
||||
|
||||
if (offset <= 0) {
|
||||
data.innerScans.add(null);
|
||||
continue;
|
||||
}
|
||||
|
||||
MdaScan inner = readScan(in, offset);
|
||||
data.innerScans.add(inner);
|
||||
}
|
||||
}
|
||||
private static MdaScan readScan(XdrInput in, long offset) throws IOException {
|
||||
in.seek(offset);
|
||||
|
||||
MdaScan scan = new MdaScan();
|
||||
|
||||
scan.rank = in.readInt();
|
||||
|
||||
if (scan.rank < 0 || scan.rank > 20) {
|
||||
throw new IOException("Invalid scan rank at offset " + offset + ": " + scan.rank);
|
||||
}
|
||||
|
||||
scan.npts = in.readInt();
|
||||
scan.currPt = in.readInt();
|
||||
|
||||
if (scan.rank > 1) {
|
||||
scan.lowerScanOffsets = in.readIntArray(scan.npts);
|
||||
}
|
||||
|
||||
scan.name = in.readStringWithLeadingLength();
|
||||
scan.time = in.readStringWithLeadingLength();
|
||||
|
||||
scan.np = in.readInt();
|
||||
scan.nd = in.readInt();
|
||||
scan.nt = in.readInt();
|
||||
|
||||
for (int i = 0; i < scan.np; i++) {
|
||||
MdaPositioner p = new MdaPositioner();
|
||||
|
||||
p.number = in.readInt();
|
||||
p.fieldName = posName(p.number);
|
||||
|
||||
p.name = in.readStringWithLeadingLength();
|
||||
p.desc = in.readStringWithLeadingLength();
|
||||
p.stepMode = in.readStringWithLeadingLength();
|
||||
p.unit = in.readStringWithLeadingLength();
|
||||
|
||||
p.readbackName = in.readStringWithLeadingLength();
|
||||
p.readbackDesc = in.readStringWithLeadingLength();
|
||||
p.readbackUnit = in.readStringWithLeadingLength();
|
||||
|
||||
scan.positioners.add(p);
|
||||
}
|
||||
|
||||
for (int i = 0; i < scan.nd; i++) {
|
||||
MdaDetector d = new MdaDetector();
|
||||
|
||||
d.number = in.readInt();
|
||||
d.fieldName = detName(d.number);
|
||||
|
||||
d.name = in.readStringWithLeadingLength();
|
||||
d.desc = in.readStringWithLeadingLength();
|
||||
d.unit = in.readStringWithLeadingLength();
|
||||
|
||||
scan.detectors.add(d);
|
||||
}
|
||||
|
||||
// Triggers are not needed for ScanDataset, but must be consumed.
|
||||
for (int i = 0; i < scan.nt; i++) {
|
||||
in.readInt(); // trigger number
|
||||
in.readStringWithLeadingLength(); // trigger name
|
||||
in.readFloat(); // command
|
||||
}
|
||||
|
||||
readScanData(in, scan);
|
||||
|
||||
return scan;
|
||||
}
|
||||
private static void readScanData(XdrInput in, MdaScan scan) throws IOException {
|
||||
for (int p = 0; p < scan.np; p++) {
|
||||
double[] values = new double[scan.npts];
|
||||
|
||||
for (int i = 0; i < scan.npts; i++) {
|
||||
values[i] = in.readDouble();
|
||||
}
|
||||
|
||||
scan.positioners.get(p).data = values;
|
||||
}
|
||||
|
||||
for (int d = 0; d < scan.nd; d++) {
|
||||
float[] values = new float[scan.npts];
|
||||
|
||||
for (int i = 0; i < scan.npts; i++) {
|
||||
values[i] = in.readFloat();
|
||||
}
|
||||
|
||||
scan.detectors.get(d).data = values;
|
||||
}
|
||||
}
|
||||
private static ScanDataset toScanDatasetRank1(MdaFileData mda, File file) {
|
||||
MdaScan scan = mda.mainScan;
|
||||
|
||||
int rowCount = scan.currPt;
|
||||
int channelCount = scan.np + scan.nd;
|
||||
|
||||
String[] channelNames = new String[channelCount];
|
||||
double[][] columns = new double[channelCount][rowCount];
|
||||
int[] fileIndex = new int[rowCount];
|
||||
|
||||
int c = 0;
|
||||
|
||||
for (int p = 0; p < scan.np; p++) {
|
||||
MdaPositioner pos = scan.positioners.get(p);
|
||||
channelNames[c] = makePositionerName("rank1", pos);
|
||||
|
||||
for (int i = 0; i < rowCount; i++) {
|
||||
columns[c][i] = safeDouble(pos.data, i);
|
||||
}
|
||||
|
||||
c++;
|
||||
}
|
||||
|
||||
for (int d = 0; d < scan.nd; d++) {
|
||||
MdaDetector det = scan.detectors.get(d);
|
||||
channelNames[c] = makeDetectorName("rank1", det);
|
||||
|
||||
for (int i = 0; i < rowCount; i++) {
|
||||
columns[c][i] = safeFloat(det.data, i);
|
||||
}
|
||||
|
||||
c++;
|
||||
}
|
||||
|
||||
for (int i = 0; i < rowCount; i++) {
|
||||
fileIndex[i] = 0;
|
||||
}
|
||||
|
||||
List<File> sourceFiles = new ArrayList<File>();
|
||||
sourceFiles.add(file);
|
||||
|
||||
IJ.log("MDA rank 1 converted to ScanDataset: "
|
||||
+ rowCount + " rows, " + channelCount + " channels.");
|
||||
|
||||
return new ScanDataset(channelNames, columns, rowCount, fileIndex, sourceFiles);
|
||||
}
|
||||
private static ScanDataset toScanDatasetRank2(MdaFileData mda, File file) throws IOException {
|
||||
MdaScan outer = mda.mainScan;
|
||||
|
||||
MdaScan firstInner = findFirstInnerScan(mda);
|
||||
|
||||
if (firstInner == null) {
|
||||
throw new IOException("Rank 2 MDA file contains no readable inner scan.");
|
||||
}
|
||||
|
||||
int rowCount = 0;
|
||||
|
||||
for (int j = 0; j < mda.innerScans.size(); j++) {
|
||||
MdaScan inner = mda.innerScans.get(j);
|
||||
|
||||
if (inner != null) {
|
||||
rowCount += inner.currPt;
|
||||
}
|
||||
}
|
||||
|
||||
int channelCount = outer.np + outer.nd + firstInner.np + firstInner.nd;
|
||||
|
||||
String[] channelNames = new String[channelCount];
|
||||
double[][] columns = new double[channelCount][rowCount];
|
||||
int[] fileIndex = new int[rowCount];
|
||||
|
||||
int c = 0;
|
||||
|
||||
for (int p = 0; p < outer.np; p++) {
|
||||
channelNames[c++] = makePositionerName("outer", outer.positioners.get(p));
|
||||
}
|
||||
|
||||
for (int d = 0; d < outer.nd; d++) {
|
||||
channelNames[c++] = makeDetectorName("outer", outer.detectors.get(d));
|
||||
}
|
||||
|
||||
for (int p = 0; p < firstInner.np; p++) {
|
||||
channelNames[c++] = makePositionerName("inner", firstInner.positioners.get(p));
|
||||
}
|
||||
|
||||
for (int d = 0; d < firstInner.nd; d++) {
|
||||
channelNames[c++] = makeDetectorName("inner", firstInner.detectors.get(d));
|
||||
}
|
||||
|
||||
int row = 0;
|
||||
|
||||
for (int j = 0; j < mda.innerScans.size(); j++) {
|
||||
MdaScan inner = mda.innerScans.get(j);
|
||||
|
||||
if (inner == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int innerRows = inner.currPt;
|
||||
|
||||
for (int k = 0; k < innerRows; k++) {
|
||||
c = 0;
|
||||
|
||||
for (int p = 0; p < outer.np; p++) {
|
||||
columns[c++][row] = safeDouble(outer.positioners.get(p).data, j);
|
||||
}
|
||||
|
||||
for (int d = 0; d < outer.nd; d++) {
|
||||
columns[c++][row] = safeFloat(outer.detectors.get(d).data, j);
|
||||
}
|
||||
|
||||
for (int p = 0; p < firstInner.np; p++) {
|
||||
if (p < inner.positioners.size()) {
|
||||
columns[c++][row] = safeDouble(inner.positioners.get(p).data, k);
|
||||
} else {
|
||||
columns[c++][row] = Double.NaN;
|
||||
}
|
||||
}
|
||||
|
||||
for (int d = 0; d < firstInner.nd; d++) {
|
||||
if (d < inner.detectors.size()) {
|
||||
columns[c++][row] = safeFloat(inner.detectors.get(d).data, k);
|
||||
} else {
|
||||
columns[c++][row] = Double.NaN;
|
||||
}
|
||||
}
|
||||
|
||||
fileIndex[row] = 0;
|
||||
row++;
|
||||
}
|
||||
}
|
||||
|
||||
List<File> sourceFiles = new ArrayList<File>();
|
||||
sourceFiles.add(file);
|
||||
|
||||
IJ.log("MDA rank 2 converted to ScanDataset: "
|
||||
+ rowCount + " rows, " + channelCount + " channels.");
|
||||
|
||||
return new ScanDataset(channelNames, columns, rowCount, fileIndex, sourceFiles);
|
||||
}
|
||||
private static MdaScan findFirstInnerScan(MdaFileData mda) {
|
||||
for (int i = 0; i < mda.innerScans.size(); i++) {
|
||||
MdaScan scan = mda.innerScans.get(i);
|
||||
|
||||
if (scan != null) {
|
||||
return scan;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
private static String makePositionerName(String prefix, MdaPositioner p) {
|
||||
String pv = clean(p.name);
|
||||
String desc = clean(p.desc);
|
||||
|
||||
if (pv.length() > 0 && desc.length() > 0) {
|
||||
return prefix + "/" + p.fieldName + "/" + pv + " {" + desc + "}";
|
||||
}
|
||||
|
||||
if (pv.length() > 0) {
|
||||
return prefix + "/" + p.fieldName + "/" + pv;
|
||||
}
|
||||
|
||||
if (desc.length() > 0) {
|
||||
return prefix + "/" + p.fieldName + "/{" + desc + "}";
|
||||
}
|
||||
|
||||
return prefix + "/" + p.fieldName;
|
||||
}
|
||||
private static String makeDetectorName(String prefix, MdaDetector d) {
|
||||
String pv = clean(d.name);
|
||||
String desc = clean(d.desc);
|
||||
|
||||
if (pv.length() > 0 && desc.length() > 0) {
|
||||
return prefix + "/" + d.fieldName + "/" + pv + " {" + desc + "}";
|
||||
}
|
||||
|
||||
if (pv.length() > 0) {
|
||||
return prefix + "/" + d.fieldName + "/" + pv;
|
||||
}
|
||||
|
||||
if (desc.length() > 0) {
|
||||
return prefix + "/" + d.fieldName + "/{" + desc + "}";
|
||||
}
|
||||
|
||||
return prefix + "/" + d.fieldName;
|
||||
}
|
||||
private static String clean(String s) {
|
||||
return s == null ? "" : s.trim();
|
||||
}
|
||||
private static double safeDouble(double[] data, int index) {
|
||||
if (data == null || index < 0 || index >= data.length) {
|
||||
return Double.NaN;
|
||||
}
|
||||
|
||||
return data[index];
|
||||
}
|
||||
private static double safeFloat(float[] data, int index) {
|
||||
if (data == null || index < 0 || index >= data.length) {
|
||||
return Double.NaN;
|
||||
}
|
||||
|
||||
return data[index];
|
||||
}
|
||||
private static String posName(int i) {
|
||||
if (i < 4) {
|
||||
return "P" + (i + 1);
|
||||
}
|
||||
|
||||
return "?";
|
||||
}
|
||||
private static String detName(int i) {
|
||||
if (i < 100) {
|
||||
int n = i + 1;
|
||||
|
||||
if (n < 10) {
|
||||
return "D0" + n;
|
||||
}
|
||||
|
||||
return "D" + n;
|
||||
}
|
||||
|
||||
return "?";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,216 @@
|
||||
package sparseviewer.io;
|
||||
|
||||
import sparseviewer.model.ScanDataset;
|
||||
import ij.IJ;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
|
||||
public class TxtTableReader {
|
||||
|
||||
public static ScanDataset readFiles(List<File> files) throws IOException {
|
||||
if (files == null || files.isEmpty()) {
|
||||
throw new IOException("No files selected.");
|
||||
}
|
||||
|
||||
String[] referenceHeader = null;
|
||||
|
||||
List<double[]> allRows = new ArrayList<double[]>();
|
||||
List<Integer> fileIndices = new ArrayList<Integer>();
|
||||
|
||||
for (int fileIdx = 0; fileIdx < files.size(); fileIdx++) {
|
||||
File file = files.get(fileIdx);
|
||||
ParsedTxt parsed = readSingleFile(file);
|
||||
|
||||
if (referenceHeader == null) {
|
||||
referenceHeader = parsed.channelNames;
|
||||
} else {
|
||||
if (!sameHeader(referenceHeader, parsed.channelNames)) {
|
||||
throw new IOException(
|
||||
"Header mismatch in file:\n" + file.getAbsolutePath()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < parsed.rows.size(); i++) {
|
||||
allRows.add(parsed.rows.get(i));
|
||||
fileIndices.add(Integer.valueOf(fileIdx));
|
||||
}
|
||||
}
|
||||
|
||||
int rowCount = allRows.size();
|
||||
int colCount = referenceHeader.length;
|
||||
|
||||
double[][] columns = new double[colCount][rowCount];
|
||||
int[] fileIndex = new int[rowCount];
|
||||
|
||||
for (int r = 0; r < rowCount; r++) {
|
||||
double[] row = allRows.get(r);
|
||||
|
||||
for (int c = 0; c < colCount; c++) {
|
||||
columns[c][r] = row[c];
|
||||
}
|
||||
|
||||
fileIndex[r] = fileIndices.get(r).intValue();
|
||||
}
|
||||
|
||||
IJ.log("Sparse Scan Viewer: loaded " + files.size()
|
||||
+ " file(s), " + rowCount
|
||||
+ " rows, " + colCount + " channels.");
|
||||
|
||||
return new ScanDataset(referenceHeader, columns, rowCount, fileIndex, files);
|
||||
}
|
||||
|
||||
private static ParsedTxt readSingleFile(File file) throws IOException {
|
||||
BufferedReader br = null;
|
||||
|
||||
try {
|
||||
br = new BufferedReader(new FileReader(file));
|
||||
|
||||
String line;
|
||||
String[] channels = null;
|
||||
int expectedRows = -1;
|
||||
List<double[]> rows = new ArrayList<double[]>();
|
||||
|
||||
while ((line = br.readLine()) != null) {
|
||||
String trimmed = line.trim();
|
||||
|
||||
if (trimmed.length() == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (trimmed.startsWith("#table[")) {
|
||||
HeaderInfo info = parseHeader(trimmed);
|
||||
channels = info.channelNames;
|
||||
expectedRows = info.expectedRows;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (trimmed.startsWith("#")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (channels == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String[] parts = trimmed.split(";");
|
||||
|
||||
if (parts.length < channels.length) {
|
||||
continue;
|
||||
}
|
||||
|
||||
double[] row = new double[channels.length];
|
||||
boolean valid = true;
|
||||
|
||||
for (int i = 0; i < channels.length; i++) {
|
||||
try {
|
||||
row[i] = Double.parseDouble(parts[i].trim());
|
||||
} catch (NumberFormatException e) {
|
||||
valid = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (valid) {
|
||||
rows.add(row);
|
||||
}
|
||||
}
|
||||
|
||||
if (channels == null) {
|
||||
throw new IOException("No #table[...] header found in " + file.getName());
|
||||
}
|
||||
|
||||
if (expectedRows >= 0 && expectedRows != rows.size()) {
|
||||
IJ.log("Warning: " + file.getName()
|
||||
+ " header says " + expectedRows
|
||||
+ " rows, but parsed " + rows.size() + " rows.");
|
||||
}
|
||||
|
||||
ParsedTxt parsed = new ParsedTxt();
|
||||
parsed.channelNames = channels;
|
||||
parsed.rows = rows;
|
||||
return parsed;
|
||||
|
||||
} finally {
|
||||
if (br != null) {
|
||||
try {
|
||||
br.close();
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static HeaderInfo parseHeader(String line) throws IOException {
|
||||
int open = line.indexOf('[');
|
||||
int close = line.indexOf(']');
|
||||
|
||||
if (open < 0 || close < 0 || close <= open) {
|
||||
throw new IOException("Invalid #table header:\n" + line);
|
||||
}
|
||||
|
||||
int expectedRows = -1;
|
||||
|
||||
try {
|
||||
expectedRows = Integer.parseInt(line.substring(open + 1, close).trim());
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
String rest = line.substring(close + 1).trim();
|
||||
String[] rawChannels = rest.split(";");
|
||||
|
||||
Vector<String> names = new Vector<String>();
|
||||
|
||||
for (int i = 0; i < rawChannels.length; i++) {
|
||||
String name = rawChannels[i].trim();
|
||||
|
||||
if (name.length() > 0) {
|
||||
names.add(name);
|
||||
}
|
||||
}
|
||||
|
||||
if (names.isEmpty()) {
|
||||
throw new IOException("No channels found in header:\n" + line);
|
||||
}
|
||||
|
||||
HeaderInfo info = new HeaderInfo();
|
||||
info.expectedRows = expectedRows;
|
||||
info.channelNames = names.toArray(new String[names.size()]);
|
||||
return info;
|
||||
}
|
||||
|
||||
private static boolean sameHeader(String[] a, String[] b) {
|
||||
if (a == null || b == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (a.length != b.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int i = 0; i < a.length; i++) {
|
||||
if (!a[i].equals(b[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private static class HeaderInfo {
|
||||
int expectedRows;
|
||||
String[] channelNames;
|
||||
}
|
||||
|
||||
private static class ParsedTxt {
|
||||
String[] channelNames;
|
||||
List<double[]> rows;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package sparseviewer.mda;
|
||||
|
||||
public class MdaDetector {
|
||||
|
||||
public int number;
|
||||
public String fieldName;
|
||||
public String name;
|
||||
public String desc;
|
||||
public String unit;
|
||||
public float[] data;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package sparseviewer.mda;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
public class MdaFileData {
|
||||
|
||||
public float version;
|
||||
public int scanNumber;
|
||||
public int rank;
|
||||
public int[] dimensions;
|
||||
public int isRegular;
|
||||
public int pExtra;
|
||||
public MdaScan mainScan;
|
||||
public final List<MdaScan> innerScans = new ArrayList<MdaScan>();
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package sparseviewer.mda;
|
||||
|
||||
public class MdaPositioner {
|
||||
|
||||
public int number;
|
||||
public String fieldName;
|
||||
|
||||
public String name;
|
||||
public String desc;
|
||||
public String stepMode;
|
||||
public String unit;
|
||||
|
||||
public String readbackName;
|
||||
public String readbackDesc;
|
||||
public String readbackUnit;
|
||||
|
||||
public double[] data;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package sparseviewer.mda;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MdaScan {
|
||||
|
||||
public int rank;
|
||||
public int npts;
|
||||
public int currPt;
|
||||
|
||||
public int[] lowerScanOffsets;
|
||||
|
||||
public String name;
|
||||
public String time;
|
||||
|
||||
public int np;
|
||||
public int nd;
|
||||
public int nt;
|
||||
|
||||
public final List<MdaPositioner> positioners = new ArrayList<MdaPositioner>();
|
||||
public final List<MdaDetector> detectors = new ArrayList<MdaDetector>();
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package sparseviewer.mda;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.RandomAccessFile;
|
||||
|
||||
|
||||
public class XdrInput {
|
||||
|
||||
private final RandomAccessFile raf;
|
||||
|
||||
public XdrInput(File file) throws IOException {
|
||||
this.raf = new RandomAccessFile(file, "r");
|
||||
}
|
||||
public void close() throws IOException {
|
||||
raf.close();
|
||||
}
|
||||
public long getFilePointer() throws IOException {
|
||||
return raf.getFilePointer();
|
||||
}
|
||||
public void seek(long position) throws IOException {
|
||||
raf.seek(position);
|
||||
}
|
||||
public int readInt() throws IOException {
|
||||
return raf.readInt();
|
||||
}
|
||||
public float readFloat() throws IOException {
|
||||
return raf.readFloat();
|
||||
}
|
||||
public double readDouble() throws IOException {
|
||||
return raf.readDouble();
|
||||
}
|
||||
public int[] readIntArray(int n) throws IOException {
|
||||
int[] values = new int[n];
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
values[i] = readInt();
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
public String readXdrString() throws IOException {
|
||||
int length = readInt();
|
||||
|
||||
if (length <= 0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
byte[] bytes = new byte[length];
|
||||
raf.readFully(bytes);
|
||||
|
||||
int pad = padding(length);
|
||||
if (pad > 0) {
|
||||
raf.skipBytes(pad);
|
||||
}
|
||||
|
||||
return new String(bytes, "UTF-8");
|
||||
}
|
||||
|
||||
/**
|
||||
* MDA writes many strings as:
|
||||
* int n
|
||||
* if n > 0: xdr_string
|
||||
*
|
||||
* The xdr_string itself again contains length + bytes + padding.
|
||||
*/
|
||||
public String readStringWithLeadingLength() throws IOException {
|
||||
int n = readInt();
|
||||
|
||||
if (n <= 0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
return readXdrString();
|
||||
}
|
||||
|
||||
private int padding(int length) {
|
||||
int r = length % 4;
|
||||
|
||||
if (r == 0) {
|
||||
return 0;
|
||||
}
|
||||
return 4 - r;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package sparseviewer.model;
|
||||
|
||||
public class ChannelUtils {
|
||||
|
||||
public static int findChannelIndex(String[] channelNames, String targetName) {
|
||||
if (channelNames == null || targetName == null) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (int i = 0; i < channelNames.length; i++) {
|
||||
if (targetName.equals(channelNames[i])) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static int resolveChannelIndex(String[] channelNames,
|
||||
String storedName,
|
||||
int storedIndex,
|
||||
int defaultIndex) {
|
||||
int byName = findChannelIndex(channelNames, storedName);
|
||||
|
||||
if (byName >= 0) {
|
||||
return byName;
|
||||
}
|
||||
|
||||
if (storedIndex >= 0 && channelNames != null && storedIndex < channelNames.length) {
|
||||
return storedIndex;
|
||||
}
|
||||
|
||||
if (channelNames != null && channelNames.length > 0) {
|
||||
if (defaultIndex < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (defaultIndex >= channelNames.length) {
|
||||
return channelNames.length - 1;
|
||||
}
|
||||
|
||||
return defaultIndex;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static String shortName(String name) {
|
||||
if (name == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
String s = name;
|
||||
|
||||
int typeIdx = s.lastIndexOf(":float");
|
||||
if (typeIdx > 0) {
|
||||
s = s.substring(0, typeIdx);
|
||||
}
|
||||
|
||||
int idx = s.lastIndexOf(':');
|
||||
if (idx >= 0 && idx < s.length() - 1) {
|
||||
return s.substring(idx + 1);
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package sparseviewer.model;
|
||||
|
||||
public enum PlotMode {
|
||||
PLOT_1D_LINE_POINTS,
|
||||
PLOT_1D_LINE,
|
||||
PLOT_1D_POINTS,
|
||||
PLOT_2D_SCATTER,
|
||||
PLOT_2D_IMAGE
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package sparseviewer.model;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ScanDataset {
|
||||
|
||||
private final String[] channelNames;
|
||||
private final double[][] columns;
|
||||
private final int rowCount;
|
||||
|
||||
private final List<File> sourceFiles = new ArrayList<File>();
|
||||
private final int[] fileIndex;
|
||||
|
||||
public ScanDataset(String[] channelNames,
|
||||
double[][] columns,
|
||||
int rowCount,
|
||||
int[] fileIndex,
|
||||
List<File> sourceFiles) {
|
||||
this.channelNames = channelNames;
|
||||
this.columns = columns;
|
||||
this.rowCount = rowCount;
|
||||
this.fileIndex = fileIndex;
|
||||
|
||||
if (sourceFiles != null) {
|
||||
this.sourceFiles.addAll(sourceFiles);
|
||||
}
|
||||
}
|
||||
|
||||
public String[] getChannelNames() {
|
||||
return channelNames;
|
||||
}
|
||||
|
||||
public int getChannelCount() {
|
||||
return channelNames.length;
|
||||
}
|
||||
|
||||
public int getRowCount() {
|
||||
return rowCount;
|
||||
}
|
||||
|
||||
public double[] getColumn(int index) {
|
||||
return columns[index];
|
||||
}
|
||||
|
||||
public String getChannelName(int index) {
|
||||
return channelNames[index];
|
||||
}
|
||||
|
||||
public int[] getFileIndex() {
|
||||
return fileIndex;
|
||||
}
|
||||
|
||||
public List<File> getSourceFiles() {
|
||||
return sourceFiles;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package sparseviewer.otf;
|
||||
|
||||
public class DelayCorrection {
|
||||
|
||||
public static CorrectedXY correctXY(double[] x,
|
||||
double[] y,
|
||||
double shiftSamples) {
|
||||
double[] xc = shiftArray(x, shiftSamples);
|
||||
double[] yc = shiftArray(y, shiftSamples);
|
||||
|
||||
return new CorrectedXY(xc, yc);
|
||||
}
|
||||
|
||||
public static double[] shiftArray(double[] values, double shiftSamples) {
|
||||
if (values == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
double[] out = new double[values.length];
|
||||
|
||||
for (int i = 0; i < values.length; i++) {
|
||||
double sourceIndex = i - shiftSamples;
|
||||
out[i] = interpolateAt(values, sourceIndex);
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
private static double interpolateAt(double[] values, double index) {
|
||||
if (values == null || values.length == 0) {
|
||||
return Double.NaN;
|
||||
}
|
||||
|
||||
if (index < 0.0 || index > values.length - 1) {
|
||||
return Double.NaN;
|
||||
}
|
||||
|
||||
int i0 = (int) Math.floor(index);
|
||||
int i1 = i0 + 1;
|
||||
|
||||
if (i1 >= values.length) {
|
||||
return values[i0];
|
||||
}
|
||||
|
||||
double v0 = values[i0];
|
||||
double v1 = values[i1];
|
||||
|
||||
if (!isFinite(v0) || !isFinite(v1)) {
|
||||
return Double.NaN;
|
||||
}
|
||||
|
||||
double alpha = index - i0;
|
||||
|
||||
return (1.0 - alpha) * v0 + alpha * v1;
|
||||
}
|
||||
|
||||
private static boolean isFinite(double v) {
|
||||
return !Double.isNaN(v) && !Double.isInfinite(v);
|
||||
}
|
||||
|
||||
public static class CorrectedXY {
|
||||
|
||||
private final double[] x;
|
||||
private final double[] y;
|
||||
|
||||
public CorrectedXY(double[] x, double[] y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public double[] getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public double[] getY() {
|
||||
return y;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package sparseviewer.prefs;
|
||||
|
||||
import ij.Prefs;
|
||||
|
||||
public class PluginPrefs {
|
||||
|
||||
private static final String PREFIX = "sparseScanViewer.";
|
||||
|
||||
public static int getInt(String key, int defaultValue) {
|
||||
return (int) Prefs.get(PREFIX + key, defaultValue);
|
||||
}
|
||||
|
||||
public static void setInt(String key, int value) {
|
||||
Prefs.set(PREFIX + key, value);
|
||||
}
|
||||
|
||||
public static String getString(String key, String defaultValue) {
|
||||
return Prefs.get(PREFIX + key, defaultValue);
|
||||
}
|
||||
|
||||
public static void setString(String key, String value) {
|
||||
Prefs.set(PREFIX + key, value);
|
||||
}
|
||||
|
||||
public static void save() {
|
||||
Prefs.savePreferences();
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,656 @@
|
||||
package sparseviewer.ui;
|
||||
|
||||
import sparseviewer.model.PlotMode;
|
||||
import sparseviewer.interp.InterpolationResult;
|
||||
import sparseviewer.interp.Grid2D;
|
||||
|
||||
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import java.awt.BasicStroke;
|
||||
import java.awt.Color;
|
||||
import java.awt.FontMetrics;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.RenderingHints;
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseMotionAdapter;
|
||||
|
||||
public class PlotPanel extends JPanel {
|
||||
|
||||
private double[] x;
|
||||
private double[] y;
|
||||
private double[] z;
|
||||
|
||||
private InterpolationResult interpolationResult;
|
||||
private BufferedImage imageBuffer;
|
||||
private String xName = "X";
|
||||
private String yName = "Y";
|
||||
private String zName = "Z";
|
||||
|
||||
private PlotMode mode = PlotMode.PLOT_1D_LINE_POINTS;
|
||||
|
||||
private double xmin;
|
||||
private double xmax;
|
||||
private double ymin;
|
||||
private double ymax;
|
||||
private double zmin;
|
||||
private double zmax;
|
||||
|
||||
private boolean hasData = false;
|
||||
private boolean is2D = false;
|
||||
|
||||
private double crossX = Double.NaN;
|
||||
private double crossY = Double.NaN;
|
||||
|
||||
private boolean dragVertical = false;
|
||||
private boolean dragHorizontal = false;
|
||||
|
||||
private final int leftMargin = 80;
|
||||
private final int rightMargin = 45;
|
||||
private final int topMargin = 40;
|
||||
private final int bottomMargin = 70;
|
||||
|
||||
public PlotPanel() {
|
||||
setBackground(Color.WHITE);
|
||||
|
||||
addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
if (!hasData) {
|
||||
return;
|
||||
}
|
||||
|
||||
int px = dataToScreenX(crossX);
|
||||
int py = dataToScreenY(crossY);
|
||||
|
||||
if (Math.abs(e.getX() - px) < 8) {
|
||||
dragVertical = true;
|
||||
}
|
||||
|
||||
if (Math.abs(e.getY() - py) < 8) {
|
||||
dragHorizontal = true;
|
||||
}
|
||||
|
||||
if (!dragVertical && !dragHorizontal) {
|
||||
crossX = screenToDataX(e.getX());
|
||||
crossY = screenToDataY(e.getY());
|
||||
dragVertical = true;
|
||||
dragHorizontal = true;
|
||||
}
|
||||
|
||||
repaint();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
dragVertical = false;
|
||||
dragHorizontal = false;
|
||||
}
|
||||
});
|
||||
|
||||
addMouseMotionListener(new MouseMotionAdapter() {
|
||||
@Override
|
||||
public void mouseDragged(MouseEvent e) {
|
||||
if (!hasData) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (dragVertical) {
|
||||
crossX = screenToDataX(e.getX());
|
||||
}
|
||||
|
||||
if (dragHorizontal) {
|
||||
crossY = screenToDataY(e.getY());
|
||||
}
|
||||
|
||||
repaint();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
hasData = false;
|
||||
x = null;
|
||||
y = null;
|
||||
z = null;
|
||||
interpolationResult = null;
|
||||
imageBuffer = null;
|
||||
repaint();
|
||||
}
|
||||
|
||||
public void set1DData(double[] x,
|
||||
double[] y,
|
||||
String xName,
|
||||
String yName,
|
||||
PlotMode mode) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = null;
|
||||
this.xName = xName;
|
||||
this.yName = yName;
|
||||
this.zName = "";
|
||||
this.mode = mode;
|
||||
this.is2D = false;
|
||||
this.hasData = x != null
|
||||
&& y != null
|
||||
&& x.length > 0
|
||||
&& x.length == y.length;
|
||||
|
||||
computeBounds();
|
||||
|
||||
crossX = 0.5 * (xmin + xmax);
|
||||
crossY = 0.5 * (ymin + ymax);
|
||||
|
||||
repaint();
|
||||
}
|
||||
|
||||
public void set2DData(double[] x,
|
||||
double[] y,
|
||||
double[] z,
|
||||
String xName,
|
||||
String yName,
|
||||
String zName) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.xName = xName;
|
||||
this.yName = yName;
|
||||
this.zName = zName;
|
||||
this.mode = PlotMode.PLOT_2D_SCATTER;
|
||||
|
||||
this.interpolationResult = null;
|
||||
this.imageBuffer = null;
|
||||
|
||||
this.is2D = true;
|
||||
this.hasData = x != null
|
||||
&& y != null
|
||||
&& z != null
|
||||
&& x.length > 0
|
||||
&& x.length == y.length
|
||||
&& x.length == z.length;
|
||||
|
||||
computeBounds();
|
||||
|
||||
crossX = 0.5 * (xmin + xmax);
|
||||
crossY = 0.5 * (ymin + ymax);
|
||||
|
||||
repaint();
|
||||
}
|
||||
|
||||
private void computeBounds() {
|
||||
xmin = Double.POSITIVE_INFINITY;
|
||||
xmax = Double.NEGATIVE_INFINITY;
|
||||
ymin = Double.POSITIVE_INFINITY;
|
||||
ymax = Double.NEGATIVE_INFINITY;
|
||||
zmin = Double.POSITIVE_INFINITY;
|
||||
zmax = Double.NEGATIVE_INFINITY;
|
||||
|
||||
if (!hasData) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < x.length; i++) {
|
||||
if (isFinite(x[i])) {
|
||||
if (x[i] < xmin) {
|
||||
xmin = x[i];
|
||||
}
|
||||
|
||||
if (x[i] > xmax) {
|
||||
xmax = x[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (isFinite(y[i])) {
|
||||
if (y[i] < ymin) {
|
||||
ymin = y[i];
|
||||
}
|
||||
|
||||
if (y[i] > ymax) {
|
||||
ymax = y[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (is2D && z != null && isFinite(z[i])) {
|
||||
if (z[i] < zmin) {
|
||||
zmin = z[i];
|
||||
}
|
||||
|
||||
if (z[i] > zmax) {
|
||||
zmax = z[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!isFinite(xmin) || !isFinite(xmax) || !isFinite(ymin) || !isFinite(ymax)) {
|
||||
hasData = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (xmin == xmax) {
|
||||
xmin -= 1.0;
|
||||
xmax += 1.0;
|
||||
}
|
||||
|
||||
if (ymin == ymax) {
|
||||
ymin -= 1.0;
|
||||
ymax += 1.0;
|
||||
}
|
||||
|
||||
if (is2D) {
|
||||
if (!isFinite(zmin) || !isFinite(zmax)) {
|
||||
zmin = 0.0;
|
||||
zmax = 1.0;
|
||||
}
|
||||
|
||||
if (zmin == zmax) {
|
||||
zmin -= 1.0;
|
||||
zmax += 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
double xpad = 0.03 * (xmax - xmin);
|
||||
double ypad = 0.03 * (ymax - ymin);
|
||||
|
||||
xmin -= xpad;
|
||||
xmax += xpad;
|
||||
ymin -= ypad;
|
||||
ymax += ypad;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void paintComponent(Graphics g) {
|
||||
super.paintComponent(g);
|
||||
|
||||
Graphics2D g2 = (Graphics2D) g;
|
||||
g2.setRenderingHint(
|
||||
RenderingHints.KEY_ANTIALIASING,
|
||||
RenderingHints.VALUE_ANTIALIAS_ON
|
||||
);
|
||||
|
||||
drawAxes(g2);
|
||||
|
||||
if (!hasData) {
|
||||
g2.setColor(Color.GRAY);
|
||||
g2.drawString("Load TXT file(s) to start.", leftMargin + 20, topMargin + 30);
|
||||
return;
|
||||
}
|
||||
|
||||
if (is2D) {
|
||||
if (mode == PlotMode.PLOT_2D_IMAGE) {
|
||||
drawInterpolatedImage(g2);
|
||||
} else {
|
||||
drawScatter2D(g2);
|
||||
}
|
||||
} else {
|
||||
drawPlot1D(g2);
|
||||
}
|
||||
|
||||
drawCrosshair(g2);
|
||||
drawReadout(g2);
|
||||
}
|
||||
|
||||
private void drawAxes(Graphics2D g2) {
|
||||
int w = getWidth();
|
||||
int h = getHeight();
|
||||
|
||||
int x0 = leftMargin;
|
||||
int y0 = h - bottomMargin;
|
||||
int x1 = w - rightMargin;
|
||||
int y1 = topMargin;
|
||||
|
||||
g2.setColor(Color.BLACK);
|
||||
g2.drawLine(x0, y0, x1, y0);
|
||||
g2.drawLine(x0, y0, x0, y1);
|
||||
|
||||
g2.drawString(shortName(xName), x0 + 10, h - 25);
|
||||
g2.drawString(shortName(yName), 15, y1 + 15);
|
||||
|
||||
if (is2D) {
|
||||
g2.drawString("Color: " + shortName(zName), x0 + 10, 22);
|
||||
}
|
||||
}
|
||||
|
||||
private void drawPlot1D(Graphics2D g2) {
|
||||
boolean drawLine = mode == PlotMode.PLOT_1D_LINE
|
||||
|| mode == PlotMode.PLOT_1D_LINE_POINTS;
|
||||
|
||||
boolean drawPoints = mode == PlotMode.PLOT_1D_POINTS
|
||||
|| mode == PlotMode.PLOT_1D_LINE_POINTS;
|
||||
|
||||
g2.setColor(new Color(30, 90, 180));
|
||||
g2.setStroke(new BasicStroke(1.3f));
|
||||
|
||||
int prevX = 0;
|
||||
int prevY = 0;
|
||||
boolean havePrev = false;
|
||||
|
||||
for (int i = 0; i < x.length; i++) {
|
||||
if (!isFinite(x[i]) || !isFinite(y[i])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int sx = dataToScreenX(x[i]);
|
||||
int sy = dataToScreenY(y[i]);
|
||||
|
||||
if (drawLine && havePrev) {
|
||||
g2.drawLine(prevX, prevY, sx, sy);
|
||||
}
|
||||
|
||||
if (drawPoints) {
|
||||
g2.fillOval(sx - 3, sy - 3, 6, 6);
|
||||
}
|
||||
|
||||
prevX = sx;
|
||||
prevY = sy;
|
||||
havePrev = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void drawScatter2D(Graphics2D g2) {
|
||||
for (int i = 0; i < x.length; i++) {
|
||||
if (!isFinite(x[i]) || !isFinite(y[i]) || !isFinite(z[i])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int sx = dataToScreenX(x[i]);
|
||||
int sy = dataToScreenY(y[i]);
|
||||
|
||||
g2.setColor(colorForValue(z[i]));
|
||||
g2.fillOval(sx - 3, sy - 3, 6, 6);
|
||||
}
|
||||
|
||||
drawColorScale(g2);
|
||||
}
|
||||
|
||||
private void drawColorScale(Graphics2D g2) {
|
||||
int w = getWidth();
|
||||
int h = getHeight();
|
||||
|
||||
int x0 = w - 30;
|
||||
int y0 = topMargin;
|
||||
int barH = h - topMargin - bottomMargin;
|
||||
|
||||
for (int i = 0; i < barH; i++) {
|
||||
double t = 1.0 - (double) i / Math.max(1, barH - 1);
|
||||
double val = zmin + t * (zmax - zmin);
|
||||
|
||||
g2.setColor(colorForValue(val));
|
||||
g2.drawLine(x0, y0 + i, x0 + 12, y0 + i);
|
||||
}
|
||||
|
||||
g2.setColor(Color.BLACK);
|
||||
g2.drawRect(x0, y0, 12, barH);
|
||||
|
||||
g2.drawString(format(zmax), x0 - 65, y0 + 10);
|
||||
g2.drawString(format(zmin), x0 - 65, y0 + barH);
|
||||
}
|
||||
|
||||
private void drawCrosshair(Graphics2D g2) {
|
||||
if (!isFinite(crossX) || !isFinite(crossY)) {
|
||||
return;
|
||||
}
|
||||
|
||||
int sx = dataToScreenX(crossX);
|
||||
int sy = dataToScreenY(crossY);
|
||||
|
||||
int w = getWidth();
|
||||
int h = getHeight();
|
||||
|
||||
g2.setColor(new Color(0, 0, 0, 150));
|
||||
g2.setStroke(new BasicStroke(1.0f));
|
||||
|
||||
g2.drawLine(sx, topMargin, sx, h - bottomMargin);
|
||||
g2.drawLine(leftMargin, sy, w - rightMargin, sy);
|
||||
}
|
||||
|
||||
private void drawReadout(Graphics2D g2) {
|
||||
int h = getHeight();
|
||||
|
||||
String text = "X=" + format(crossX) + " Y=" + format(crossY);
|
||||
|
||||
if (is2D) {
|
||||
if (mode == PlotMode.PLOT_2D_IMAGE && interpolationResult != null) {
|
||||
float value = interpolationResult.getNearestValue(crossX, crossY);
|
||||
|
||||
text += " Z(interp)=" + format(value);
|
||||
|
||||
int idx = nearestPoint(crossX, crossY);
|
||||
if (idx >= 0 && z != null) {
|
||||
text += " nearest raw Z=" + format(z[idx])
|
||||
+ " idx=" + idx;
|
||||
}
|
||||
} else {
|
||||
int idx = nearestPoint(crossX, crossY);
|
||||
|
||||
if (idx >= 0) {
|
||||
text += " nearest Z=" + format(z[idx])
|
||||
+ " idx=" + idx;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int idx = nearestX(crossX);
|
||||
|
||||
if (idx >= 0) {
|
||||
text += " nearest Y=" + format(y[idx])
|
||||
+ " idx=" + idx;
|
||||
}
|
||||
}
|
||||
|
||||
g2.setColor(Color.BLACK);
|
||||
g2.drawString(text, leftMargin + 10, h - 8);
|
||||
}
|
||||
private void drawInterpolatedImage(Graphics2D g2) {
|
||||
if (imageBuffer == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
int x0 = leftMargin;
|
||||
int y0 = topMargin;
|
||||
int w = getWidth() - leftMargin - rightMargin;
|
||||
int h = getHeight() - topMargin - bottomMargin;
|
||||
|
||||
g2.drawImage(imageBuffer, x0, y0, w, h, null);
|
||||
|
||||
g2.setColor(Color.BLACK);
|
||||
g2.drawRect(x0, y0, w, h);
|
||||
|
||||
drawColorScale(g2);
|
||||
}
|
||||
private int nearestX(double xv) {
|
||||
int best = -1;
|
||||
double bestD = Double.POSITIVE_INFINITY;
|
||||
|
||||
for (int i = 0; i < x.length; i++) {
|
||||
if (!isFinite(x[i])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
double d = Math.abs(x[i] - xv);
|
||||
|
||||
if (d < bestD) {
|
||||
bestD = d;
|
||||
best = i;
|
||||
}
|
||||
}
|
||||
|
||||
return best;
|
||||
}
|
||||
|
||||
private int nearestPoint(double xv, double yv) {
|
||||
int best = -1;
|
||||
double bestD = Double.POSITIVE_INFINITY;
|
||||
|
||||
double xr = xmax - xmin;
|
||||
double yr = ymax - ymin;
|
||||
|
||||
for (int i = 0; i < x.length; i++) {
|
||||
if (!isFinite(x[i]) || !isFinite(y[i])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
double dx = (x[i] - xv) / xr;
|
||||
double dy = (y[i] - yv) / yr;
|
||||
double d = dx * dx + dy * dy;
|
||||
|
||||
if (d < bestD) {
|
||||
bestD = d;
|
||||
best = i;
|
||||
}
|
||||
}
|
||||
|
||||
return best;
|
||||
}
|
||||
|
||||
private int dataToScreenX(double xv) {
|
||||
int w = getWidth();
|
||||
double t = (xv - xmin) / (xmax - xmin);
|
||||
|
||||
return leftMargin + (int) Math.round(t * (w - leftMargin - rightMargin));
|
||||
}
|
||||
|
||||
private int dataToScreenY(double yv) {
|
||||
int h = getHeight();
|
||||
double t = (yv - ymin) / (ymax - ymin);
|
||||
|
||||
return h - bottomMargin
|
||||
- (int) Math.round(t * (h - topMargin - bottomMargin));
|
||||
}
|
||||
private void rebuildImageBuffer() {
|
||||
if (interpolationResult == null) {
|
||||
imageBuffer = null;
|
||||
return;
|
||||
}
|
||||
|
||||
Grid2D grid = interpolationResult.getGrid();
|
||||
int width = grid.getWidth();
|
||||
int height = grid.getHeight();
|
||||
|
||||
imageBuffer = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
|
||||
float[] pixels = interpolationResult.getPixels();
|
||||
|
||||
for (int iy = 0; iy < height; iy++) {
|
||||
for (int ix = 0; ix < width; ix++) {
|
||||
float v = pixels[iy * width + ix];
|
||||
|
||||
Color c;
|
||||
|
||||
if (Float.isNaN(v) || Float.isInfinite(v)) {
|
||||
c = Color.GRAY;
|
||||
} else {
|
||||
c = colorForValue(v);
|
||||
}
|
||||
|
||||
imageBuffer.setRGB(ix, height - 1 - iy, c.getRGB());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void set2DImageData(double[] x,
|
||||
double[] y,
|
||||
double[] z,
|
||||
String xName,
|
||||
String yName,
|
||||
String zName,
|
||||
InterpolationResult result) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.xName = xName;
|
||||
this.yName = yName;
|
||||
this.zName = zName;
|
||||
this.mode = PlotMode.PLOT_2D_IMAGE;
|
||||
this.is2D = true;
|
||||
this.hasData = result != null;
|
||||
this.interpolationResult = result;
|
||||
|
||||
if (result != null) {
|
||||
Grid2D grid = result.getGrid();
|
||||
|
||||
this.xmin = grid.getXMin();
|
||||
this.xmax = grid.getXMax();
|
||||
this.ymin = grid.getYMin();
|
||||
this.ymax = grid.getYMax();
|
||||
this.zmin = result.getZMin();
|
||||
this.zmax = result.getZMax();
|
||||
|
||||
this.crossX = 0.5 * (xmin + xmax);
|
||||
this.crossY = 0.5 * (ymin + ymax);
|
||||
|
||||
rebuildImageBuffer();
|
||||
}
|
||||
|
||||
repaint();
|
||||
}
|
||||
|
||||
private double screenToDataX(int sx) {
|
||||
int w = getWidth();
|
||||
|
||||
double t = (double) (sx - leftMargin)
|
||||
/ Math.max(1, w - leftMargin - rightMargin);
|
||||
|
||||
return xmin + t * (xmax - xmin);
|
||||
}
|
||||
|
||||
private double screenToDataY(int sy) {
|
||||
int h = getHeight();
|
||||
|
||||
double t = (double) (h - bottomMargin - sy)
|
||||
/ Math.max(1, h - topMargin - bottomMargin);
|
||||
|
||||
return ymin + t * (ymax - ymin);
|
||||
}
|
||||
|
||||
private Color colorForValue(double v) {
|
||||
double t = (v - zmin) / (zmax - zmin);
|
||||
|
||||
if (t < 0) {
|
||||
t = 0;
|
||||
}
|
||||
|
||||
if (t > 1) {
|
||||
t = 1;
|
||||
}
|
||||
|
||||
float hue = (float) (0.66 - 0.66 * t);
|
||||
|
||||
return Color.getHSBColor(hue, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
private boolean isFinite(double v) {
|
||||
return !Double.isNaN(v) && !Double.isInfinite(v);
|
||||
}
|
||||
|
||||
private String format(double v) {
|
||||
if (!isFinite(v)) {
|
||||
return "NaN";
|
||||
}
|
||||
|
||||
return String.format("%.6g", v);
|
||||
}
|
||||
|
||||
private String shortName(String name) {
|
||||
if (name == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
String s = name;
|
||||
|
||||
int typeIdx = s.lastIndexOf(":float");
|
||||
|
||||
if (typeIdx > 0) {
|
||||
s = s.substring(0, typeIdx);
|
||||
}
|
||||
|
||||
int idx = s.lastIndexOf(':');
|
||||
|
||||
if (idx >= 0 && idx < s.length() - 1) {
|
||||
return s.substring(idx + 1);
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="30" pref="30" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="jLabel1" linkSize="1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="spStart" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="jLabel2" linkSize="1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="spEnd" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="jLabel3" linkSize="1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="spStep" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace pref="129" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" pref="50" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spStart" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spEnd" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spStep" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="39" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Start:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spStart">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="780.0" maximum="1000.0" minimum="700.0" numberType="java.lang.Float" stepSize="1.0" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="End:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spEnd">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="800.0" maximum="1000.0" minimum="700.0" numberType="java.lang.Float" stepSize="1.0" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel3">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Step:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spStep">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="1.0" maximum="10.0" minimum="0.1" numberType="java.lang.Float" stepSize="1.0" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
@@ -0,0 +1,159 @@
|
||||
|
||||
import ch.psi.pshell.framework.ScriptProcessor;
|
||||
import ch.psi.pshell.framework.Task;
|
||||
import ch.psi.pshell.utils.State;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class panel_template extends ScriptProcessor {
|
||||
|
||||
//TODO: set script name
|
||||
public static final String SCRIPT_NAME = "beamline_alignment/Development/panel_template";
|
||||
|
||||
public panel_template() {
|
||||
initComponents();
|
||||
}
|
||||
|
||||
|
||||
//Overridable callbacks
|
||||
@Override
|
||||
public void onInitialize(int runCount) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStateChange(State state, State former) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onExecutedFile(String fileName, Object result) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTaskFinished(Task task) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onTimer() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onLoaded() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onUnloaded() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onStartingExecution(Map<String, Object> args) throws Exception{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onFinishedExecution(Map<String, Object> args, Object ret, Throwable t) throws Exception{
|
||||
}
|
||||
|
||||
|
||||
//Invoked by 'update()' to update components in the event thread
|
||||
@Override
|
||||
protected void doUpdate() {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getScript(){
|
||||
return SCRIPT_NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getArgs(){
|
||||
//TODO: add script arguments
|
||||
Map<String, Object> ret = new HashMap<>();
|
||||
ret.put("START", spStart.getValue());
|
||||
ret.put("END", spEnd.getValue());
|
||||
ret.put("STEP_SIZE", spStep.getValue());
|
||||
return ret;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
|
||||
jLabel1 = new javax.swing.JLabel();
|
||||
spStart = new javax.swing.JSpinner();
|
||||
jLabel2 = new javax.swing.JLabel();
|
||||
spEnd = new javax.swing.JSpinner();
|
||||
jLabel3 = new javax.swing.JLabel();
|
||||
spStep = new javax.swing.JSpinner();
|
||||
|
||||
jLabel1.setText("Start:");
|
||||
|
||||
spStart.setModel(new javax.swing.SpinnerNumberModel(Float.valueOf(780.0f), Float.valueOf(700.0f), Float.valueOf(1000.0f), Float.valueOf(1.0f)));
|
||||
|
||||
jLabel2.setText("End:");
|
||||
|
||||
spEnd.setModel(new javax.swing.SpinnerNumberModel(Float.valueOf(800.0f), Float.valueOf(700.0f), Float.valueOf(1000.0f), Float.valueOf(1.0f)));
|
||||
|
||||
jLabel3.setText("Step:");
|
||||
|
||||
spStep.setModel(new javax.swing.SpinnerNumberModel(Float.valueOf(1.0f), Float.valueOf(0.1f), Float.valueOf(10.0f), Float.valueOf(1.0f)));
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||
this.setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(30, 30, 30)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(jLabel1)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(spStart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(jLabel2)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(spEnd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(jLabel3)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(spStep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addContainerGap(129, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel1, jLabel2, jLabel3});
|
||||
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(50, 50, 50)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel1)
|
||||
.addComponent(spStart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel2)
|
||||
.addComponent(spEnd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel3)
|
||||
.addComponent(spStep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap(39, Short.MAX_VALUE))
|
||||
);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private javax.swing.JLabel jLabel2;
|
||||
private javax.swing.JLabel jLabel3;
|
||||
private javax.swing.JSpinner spEnd;
|
||||
private javax.swing.JSpinner spStart;
|
||||
private javax.swing.JSpinner spStep;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
[ "Multidimensional", [ [ "Channel", "X11MA-FE-SL1:CENTERX", -0.5, 0.5, 20.0 ], [ "Channel", "X11MA-FE-SL1:CENTERY", -0.5, 0.5, 20.0 ] ], [ [ "Channel", "X11MA-FE-SL1:CENTERX-PosAct", 1, 0, "Enabled" ], [ "Channel", "X11MA-FE-SL1:CENTERY-PosAct", 1, 0, "Enabled" ] ], false, [ ], "", 50, 1.0, 0.0, false, false, false, true, "", "", " ", "", 0, null, null, "Positioner", true, true ]
|
||||
@@ -41,6 +41,4 @@ def select_Keithley_11_range():
|
||||
Keithley_11_range = get_string(msg, default = "AUTO", alternatives = ["AUTO", "20 mA", "2 mA", "200 uA", "20 uA","2 uA", "200 nA", "20 nA", "2 nA", "200 pA", "20 pA"], password = False)
|
||||
# print(Keithley_11_range)
|
||||
return Keithley_11_range
|
||||
|
||||
|
||||
|
||||
c(5.0)
|
||||
|
||||
@@ -25,7 +25,9 @@ from javax.swing import JFrame, JFileChooser
|
||||
from javax.swing.filechooser import FileNameExtensionFilter
|
||||
from java.io import File
|
||||
|
||||
BEAMLINE_PARAMETERS_FILE = "/home/gac-x11ma/pshell/home/script/beamline_alignment/bml_align_params.json"
|
||||
|
||||
BEAMLINE_PARAMETERS_FILE = "/sls/x11ma/config/pshell/home/script/beamline_alignment/bml_align_params.json"
|
||||
#BEAMLINE_PARAMETERS_FILE = "/home/gac-x11ma/pshell/home/script/beamline_alignment/bml_align_params.json"
|
||||
DATA_FILE = "/home/gac-x11ma/pshell/home/data/2025_11/20251113/Monocam_AU_131.json"
|
||||
DATA_DIR = "/home/gac-x11ma/network_drives/home/Data/2025_11/"
|
||||
|
||||
@@ -374,6 +376,7 @@ def bml_restore_saved_settings(selected_components=None):
|
||||
try:
|
||||
with open(restore_file, "r") as f:
|
||||
saved_data = json.load(f, object_pairs_hook=OrderedDict)
|
||||
print("Restore:", restore_file)
|
||||
except:
|
||||
print("Error loading restore file:", restore_file)
|
||||
return
|
||||
@@ -475,6 +478,7 @@ def bml_display_saved_settings(selected_components=None):
|
||||
try:
|
||||
with open(restore_file, "r") as f:
|
||||
saved_data = json.load(f, object_pairs_hook=OrderedDict)
|
||||
print("Display:", restore_file)
|
||||
except:
|
||||
print("Error loading restore file:", restore_file)
|
||||
return
|
||||
@@ -545,6 +549,7 @@ def bml_show_difference_to_saved_settings(selected_components=None):
|
||||
try:
|
||||
with open(restore_file, "r") as f:
|
||||
saved_data = json.load(f, object_pairs_hook=OrderedDict)
|
||||
print("Compare to:", restore_file)
|
||||
except:
|
||||
print("Error loading restore file:", restore_file)
|
||||
return
|
||||
@@ -615,7 +620,7 @@ def bml_show_difference_to_saved_settings(selected_components=None):
|
||||
difference = "NaN"
|
||||
# print(read_cmd + " = " + str(display_value) + ", diff = " + str(round(difference, 5)) + ", tolerance = " + str(round(tolerance, 5)))
|
||||
if float(difference) > float(tolerance):
|
||||
print(key + " - Differs from saved value: " + str(round(saved_value, 5)))
|
||||
print(key + " Current value: " + str(round(display_value, 5)) + " - Differs from saved value: " + str(round(saved_value, 5)))
|
||||
# write_cmd_new = "\"" + write_cmd + "\""
|
||||
# print(write_cmd_new)
|
||||
# caput(write_cmd, float(saved_value))a
|
||||
|
||||
Executable → Regular
-1
@@ -62,7 +62,6 @@ def scan_2dfe_center():
|
||||
|
||||
BML_FE_centerX.move(xmin)
|
||||
BML_FE_centerY.move(ymin)
|
||||
|
||||
sensors = [BML_FE_CX_RBV, BML_FE_CY_RBV, BML_FE_CX_RBV, BML_FE_CX_RBV, BML_FE_CX_RBV, CADC2]
|
||||
#sensors = [BML_FE_CX_RBV, BML_FE_CY_RBV, BML_XBPM_B_SUM, BML_XBPM_B_POS_X, BML_XBPM_B_POS_Y, CADC2]
|
||||
#detector = Keithley_2_raw
|
||||
|
||||
@@ -59,17 +59,17 @@ def scan_2D_FE_slits():
|
||||
# FE_centerX = -1.15
|
||||
# FE_centerY = 1.45
|
||||
|
||||
FE_centerX = -1.25
|
||||
FE_centerY = 1.0
|
||||
FE_centerX = -0.3
|
||||
FE_centerY = 0.3
|
||||
|
||||
FE_sizeX = 0.1
|
||||
FE_sizeY = 0.1
|
||||
FE_sizeX = 0.15
|
||||
FE_sizeY = 0.15
|
||||
|
||||
x_range = 1.0
|
||||
x_range = 1.5
|
||||
y_range = 1.0
|
||||
|
||||
x_steps = 0.05
|
||||
y_steps = 0.05
|
||||
x_steps = 0.1
|
||||
y_steps = 0.1
|
||||
|
||||
xmin = FE_centerX - x_range/2
|
||||
xmax = FE_centerX + x_range/2
|
||||
@@ -92,7 +92,7 @@ def scan_2D_FE_slits():
|
||||
|
||||
sleep(1.0)
|
||||
|
||||
ascan([BML_FE_centerX, BML_FE_centerY], sensors, [xmin, ymin], [xmax, ymax], [xsteps, ysteps], latency=0.1, zigzag=True)
|
||||
ascan([BML_FE_centerX, BML_FE_centerY], sensors, [xmin, ymin], [xmax, ymax], [xsteps, ysteps], latency=0.1, zigzag=False)
|
||||
|
||||
# 5 Put back to initial settings
|
||||
|
||||
@@ -166,7 +166,7 @@ def scan_3D_FE_slits(Scan_params, Sensors):
|
||||
|
||||
started = time.strftime("%H:%M:%S", time.localtime())
|
||||
|
||||
ascan([BML_energy, BML_FE_centerX, BML_FE_centerY], sensors, [emin, xmin, ymin,], [emax, xmax, ymax], [esteps, xsteps, ysteps], latency=0.1, zigzag=False)
|
||||
ascan([BML_energy_set, BML_FE_centerX, BML_FE_centerY], Sensors, [emin, xmin, ymin,], [emax, xmax, ymax], [esteps, xsteps, ysteps], latency=0.1, zigzag=False)
|
||||
|
||||
# 5 Put back to initial settings
|
||||
|
||||
|
||||
@@ -38,10 +38,10 @@ def scan_CMU_zRy():
|
||||
|
||||
sensors = [Keithley_2_raw, CADC2, BML_CMU_z_RBV, BML_CMU_Ry_RBV]
|
||||
|
||||
centerTRZ = 1.0
|
||||
centerROY = -0.14
|
||||
centerTRZ = 1.23
|
||||
centerROY = 0.2
|
||||
|
||||
TRZ_range = 3.0
|
||||
TRZ_range = 2.0
|
||||
ROY_range = 0.2
|
||||
|
||||
TRZ_steps = 0.2
|
||||
|
||||
@@ -58,13 +58,13 @@ def scan_FMU_TRX_ROTY():
|
||||
|
||||
sensors = [Keithley_2_raw, CADC2, BML_FMU_X, BML_FMU_YAW]
|
||||
|
||||
centerTRX = 1.0
|
||||
centerROTY = -0.10
|
||||
centerTRX = 0.3
|
||||
centerROTY = -0.38
|
||||
TRX_range = 6.0
|
||||
ROTY_range = 0.2 # 0.1 mm corresponds to 0.25 mrad!
|
||||
ROTY_range = 0.4 # 0.1 mm corresponds to 0.25 mrad!
|
||||
|
||||
TRX_steps = 0.3
|
||||
ROTY_steps = 0.01
|
||||
TRX_steps = 0.6
|
||||
ROTY_steps = 0.02
|
||||
|
||||
xmin = centerTRX - TRX_range/2
|
||||
xmax = centerTRX + TRX_range/2
|
||||
|
||||
@@ -23,8 +23,10 @@ def scan_energy(scan_energy_values, sensors):
|
||||
print(sen)
|
||||
|
||||
started = time.strftime("%H:%M:%S", time.localtime())
|
||||
lscan(BML_energy_set, sensors, emin, emax, esteps, latency)
|
||||
BML_energy.update()
|
||||
lscan(BML_energy, sensors, emin, emax, esteps, latency)
|
||||
#This is working: lscan (BML_energy, SR_current, 780.0, 800.0, 1.0)
|
||||
#lscan(BML_energy, sensors, 680.0, 720.0, 2.0, 0.1)
|
||||
|
||||
json_path = get_exec_pars().path
|
||||
bml_save_scan_settings_json(json_path)
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
#class PseudoPositioner(Writable):
|
||||
# def write(self,pos):
|
||||
# sleep(3.0)
|
||||
# print "Step = " + str(pos)
|
||||
# caput
|
||||
#
|
||||
#positioner=PseudoPositioner()
|
||||
#
|
||||
|
||||
def scan_energy(scan_energy_values, sensors):
|
||||
|
||||
|
||||
# 1 Set scan parameters
|
||||
|
||||
emin = scan_energy_values[0]
|
||||
emax = scan_energy_values[1]
|
||||
esteps = scan_energy_values[2]
|
||||
latency = scan_energy_values[3]
|
||||
|
||||
for s in scan_energy_values:
|
||||
print(s)
|
||||
for sen in sensors:
|
||||
print(sen)
|
||||
|
||||
started = time.strftime("%H:%M:%S", time.localtime())
|
||||
BML_energy.update()
|
||||
lscan(BML_energy, sensors, emin, emax, esteps, latency)
|
||||
#This is working: lscan (BML_energy, SR_current, 780.0, 800.0, 1.0)
|
||||
#lscan(BML_energy, sensors, 680.0, 720.0, 2.0, 0.1)
|
||||
|
||||
json_path = get_exec_pars().path
|
||||
bml_save_scan_settings_json(json_path)
|
||||
|
||||
stopped = time.strftime("%H:%M:%S", time.localtime())
|
||||
print("started: " + started)
|
||||
print("stopped: " + stopped)
|
||||
@@ -0,0 +1,10 @@
|
||||
# From Alexandre Gobbo, see MS Teams
|
||||
# After you run it the first time you must configure the device, and the initialize it:
|
||||
|
||||
class EnergyPGM(Positioner):
|
||||
def doWrite(self, val):
|
||||
energy_pgm.getSetpoint().write(val)
|
||||
caput ("X11MA-PGM:setE.PROC", 1)
|
||||
|
||||
add_device(EnergyPGM("energy_pgm", "X11MA-PGM:energy", "X11MA-PGM:rbkenergy"), True)
|
||||
energy_pgm.monitored=True
|
||||
@@ -0,0 +1 @@
|
||||
lscan(energy_pgm, Keithley_2_raw, 375.0, 415.0, 0.5, 0.2)
|
||||
@@ -5,14 +5,15 @@
|
||||
def scan_2DFE_energy():
|
||||
# 1 Define detector and scan parameters
|
||||
|
||||
sensors = [Keithley_2_raw.getAlias(), CADC2.getAlias(), SR_current.getAlias(), BML_energy_RBV.getAlias()]
|
||||
#sensors = [Keithley_2_raw.getAlias(), CADC2.getAlias(), SR_current.getAlias(), BML_energy_RBV.getAlias()]
|
||||
sensors = [Keithley_2_raw, CADC2, SR_current, BML_energy]
|
||||
Keithley_channel = Keithley_2_raw.getChannelName()
|
||||
Keithley_range = "2 uA"
|
||||
#Keithley range: "AUTO", "20 mA", "2 mA", "200 uA", "20 uA", "2 uA", "200 nA", "20 nA", "2 nA", "200 pA", "20 pA"
|
||||
|
||||
emin = 450.0
|
||||
emax = 470.0
|
||||
esteps = 5.0
|
||||
emin = 400
|
||||
emax = 415
|
||||
esteps = 20
|
||||
|
||||
#FE_centerX = -0.75
|
||||
#FE_centerY = 1.25
|
||||
@@ -22,11 +23,20 @@ def scan_2DFE_energy():
|
||||
FE_size_x = 0.1
|
||||
FE_size_y = 0.1
|
||||
|
||||
x_range = 4.0
|
||||
y_range = 4.0
|
||||
x_range = 3.0
|
||||
y_range = 3.0
|
||||
|
||||
x_steps = 0.1
|
||||
y_steps = 0.1
|
||||
|
||||
xmin = FE_centerX - x_range/2
|
||||
xmax = FE_centerX + x_range/2
|
||||
|
||||
ymin = FE_centerY - y_range/2
|
||||
ymax = FE_centerY + y_range/2
|
||||
|
||||
xsteps = x_steps
|
||||
ysteps = y_steps
|
||||
|
||||
|
||||
# Set detector and slit parameters for scan>
|
||||
@@ -42,11 +52,22 @@ def scan_2DFE_energy():
|
||||
BML_FE_sizeX.write(FE_size_x)
|
||||
BML_FE_sizeY.write(FE_size_y)
|
||||
|
||||
Scan_params = [emin, emax, esteps, FE_centerX, FE_centerY, FE_size_x, FE_size_y, x_range, y_range, x_steps, y_steps]
|
||||
#Scan_params = [emin, emax, esteps, FE_centerX, FE_centerY, FE_size_x, FE_size_y, x_range, y_range, x_steps, y_steps]
|
||||
|
||||
# 3 Perform scans
|
||||
|
||||
scan_3D_FE_slits(Scan_params, sensors)
|
||||
|
||||
for energy in range(emin, emax, esteps):
|
||||
print(energy)
|
||||
BML_energy.update()
|
||||
BML_energy.move(float(energy))
|
||||
print(BML_energy.read())
|
||||
ascan([BML_FE_centerX, BML_FE_centerY], sensors, [xmin, ymin], [xmax, ymax], [xsteps, ysteps], latency=0.1, zigzag=False)
|
||||
json_path = get_exec_pars().path
|
||||
bml_save_scan_settings_json(json_path)
|
||||
BML_energy.update()
|
||||
|
||||
|
||||
# scan_3D_FE_slits(Scan_params, sensors)
|
||||
|
||||
|
||||
# 4 Restore FE motor speed
|
||||
@@ -118,48 +139,87 @@ def scan_harmonic_energy_pol():
|
||||
# 6 +45 deg
|
||||
# 7 -45 deg
|
||||
|
||||
sensors = [Keithley_1_raw.getAlias(), CADC1.getAlias(), SR_current.getAlias(), BML_energy_RBV.getAlias()]
|
||||
polarizations = [1,2,3,4,5,6]
|
||||
sensors = [Keithley_2_raw.getAlias(), CADC2.getAlias(), SR_current.getAlias(), BML_energy.getAlias()]
|
||||
polarizations = [1]
|
||||
# polarizations = ["Linear H", "Linear V+", "Linear V-","Circular+", "Circular-", "+45 deg", "-45 deg"]
|
||||
Keithley_channel = Keithley_2_raw.getChannelName()
|
||||
Keithley_range = "AUTO"
|
||||
#Keithley range: "AUTO", "20 mA", "2 mA", "200 uA", "20 uA", "2 uA", "200 nA", "20 nA", "2 nA", "200 pA", "20 pA"
|
||||
|
||||
emin = 500.0
|
||||
emax = 900.0
|
||||
esteps = 0.1
|
||||
latency = 1.0
|
||||
emax = 800.0
|
||||
esteps = 5.0
|
||||
latency = 0.1
|
||||
|
||||
FE_centerX = 0.0
|
||||
FE_centerY = 0.0
|
||||
FE_size_x = 4.0
|
||||
FE_size_y = 4.0
|
||||
|
||||
energy_slit = 200.0
|
||||
energy_slit = 20.0
|
||||
|
||||
# # Set detector and slit parameters for scan>
|
||||
# range_number = range_to_number(Keithley_range)
|
||||
# Keithley_range_cmd = Keithley_channel.replace('READOUT', 'RANGE')
|
||||
# caput(Keithley_range_cmd, range_number) # 6 --> 200 nA
|
||||
#
|
||||
# Set detector and slit parameters for scan>
|
||||
range_number = range_to_number(Keithley_range)
|
||||
Keithley_range_cmd = Keithley_channel.replace('READOUT', 'RANGE')
|
||||
caput(Keithley_range_cmd, range_number) # 6 --> 200 nA
|
||||
|
||||
BML_FE_sizeX.update()
|
||||
BML_FE_sizeY.update()
|
||||
BML_FE_centerX.update()
|
||||
BML_FE_centerY.update()
|
||||
|
||||
# BML_FE_centerX.write(FE_centerX)
|
||||
# BML_FE_centerY.write(FE_centerY)
|
||||
# BML_FE_sizeX.write(FE_size_x)
|
||||
# BML_FE_sizeY.write(FE_size_y)
|
||||
#
|
||||
# exit_slit.move(energy_slit)
|
||||
|
||||
exit_slit.move(energy_slit)
|
||||
|
||||
scan_energy_values = [emin, emax, esteps,latency]
|
||||
|
||||
for p in polarizations:
|
||||
print(p)
|
||||
caput("X11MA-UIND2:MODE", p)
|
||||
BML_energy_set.write(emin)
|
||||
# caput("X11MA-UIND2:MODE", p)
|
||||
BML_energy.write(emin)
|
||||
# ID2_mode.move("Linear H")
|
||||
sleep(300)
|
||||
sleep(1)
|
||||
ID_state = caget("X11MA-UIND2:MODE")
|
||||
print(ID_state)
|
||||
ID_energy = caget("X11MA-UIND2:ENERGY-RBV")
|
||||
print(ID_energy)
|
||||
scan_energy(scan_energy_values, sensors)
|
||||
|
||||
BML_FE_sizeX.write(0.0)
|
||||
BML_FE_sizeY.write(0.0)
|
||||
# BML_FE_sizeX.write(0.0)
|
||||
# BML_FE_sizeY.write(0.0)
|
||||
#
|
||||
def scan_2DFE_energy_OTF():
|
||||
|
||||
for energy in range(380, 420, 5):
|
||||
print(energy)
|
||||
BML_energy.update()
|
||||
BML_energy.move(float(energy))
|
||||
BML_energy.update()
|
||||
run_parallel_scan()
|
||||
|
||||
|
||||
def scan_2DFE_energy_OTF_pol():
|
||||
|
||||
# polarizations = [7,6,5,4,3,2,1]
|
||||
polarizations = [2,7,1]
|
||||
# polarizations = ["Linear H", "Linear V+", "Linear V-","Circular+", "Circular-", "+45 deg", "-45 deg"]
|
||||
for p in polarizations:
|
||||
print(p)
|
||||
caput("X11MA-PGM:energy", 1650.0)
|
||||
caput("X11MA-PGM:setE.PROC", 1)
|
||||
# caput("X11MA-UIND2:ENERGY-SP", 1650.0)
|
||||
# sleep(10)
|
||||
caput("X11MA-UIND2:MODE", p)
|
||||
sleep(300)
|
||||
for i in range(16500, 17500, 50): # 0.2 → Faktor 10
|
||||
energy = i / 10.0
|
||||
print(energy)
|
||||
caput("X11MA-PGM:energy", energy)
|
||||
caput("X11MA-PGM:setE.PROC", 1)
|
||||
# caput("X11MA-UIND2:ENERGY-SP", energy)
|
||||
sleep(10)
|
||||
run_parallel_scan()
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
#tscan(['ca://X11MA-FE-SL1:TRXW-PosAct', CADC2], points=50, interval=0.001, keep=False, save=False, name='Unknown', domain_axis='Time')
|
||||
#
|
||||
####################################################################################################
|
||||
## Example on running simultaneous scans.
|
||||
####################################################################################################
|
||||
#
|
||||
##Simple example running 2 simultaneous scans, not manipulating same writables.
|
||||
##Each scan plots to a different context.
|
||||
#def scan1():
|
||||
# print "scan1"
|
||||
# return lscan(ao1, ai1, 0, 40, 20, 0.1, title = "scan1", tag = "scan_1")
|
||||
#
|
||||
#def scan2():
|
||||
# print "scan2"
|
||||
# return lscan(ao2, wf1, 0, 40, 20, 0.1, title = "scan2", tag = "scan_2")
|
||||
#
|
||||
#parallelize(scan1, scan2)
|
||||
#
|
||||
#
|
||||
#
|
||||
##Example of simultaneous scans, running one at a time in passes, manipulating same writable.
|
||||
##All scans plot to default context.
|
||||
#
|
||||
#REGIONS = [("R1",(1.0, 2.0, 0.1)), ("R2",(2.0, 8.0, 0.5)), ("R3",(8.0, 9.0, 0.2)), ]
|
||||
#PASSES = 3
|
||||
#
|
||||
#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
|
||||
# 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, initial_move=False)
|
||||
#
|
||||
#parallelize(* [[scan,[i,]] for i in range(len(REGIONS))])
|
||||
#
|
||||
|
||||
def FE_scan_prepare():
|
||||
|
||||
FE_centerX_ini = BML_FE_centerX.read()
|
||||
FE_centerY_ini = BML_FE_centerY.read()
|
||||
FE_speedcX_ini = BML_FE_centerX.getSpeed()
|
||||
FE_speedcY_ini = BML_FE_centerY.getSpeed()
|
||||
FE_sizeX_ini = BML_FE_sizeX.read()
|
||||
FE_sizeY_ini = BML_FE_sizeY.read()
|
||||
FE_speedsX_ini = BML_FE_sizeX.getSpeed()
|
||||
FE_speedsY_ini = BML_FE_sizeY.getSpeed()
|
||||
|
||||
BML_FE_sizeX.setSpeed(1.0)
|
||||
BML_FE_sizeY.setSpeed(1.0)
|
||||
BML_FE_centerX.setSpeed(1.0)
|
||||
BML_FE_centerY.setSpeed(1.0)
|
||||
|
||||
FE_centerX = 0.0
|
||||
FE_centerY = 0.0
|
||||
|
||||
FE_sizeX = 0.1
|
||||
FE_sizeY = 0.1
|
||||
|
||||
x_range = 4.0
|
||||
y_range = 4.0
|
||||
|
||||
x_steps = 0.2
|
||||
y_steps = 0.2
|
||||
|
||||
xmin = FE_centerX - x_range/2
|
||||
xmax = FE_centerX + x_range/2
|
||||
|
||||
ymin = FE_centerY - y_range/2
|
||||
ymax = FE_centerY + y_range/2
|
||||
|
||||
xsteps = x_steps
|
||||
ysteps = y_steps
|
||||
|
||||
BML_FE_sizeX.update()
|
||||
BML_FE_sizeY.update()
|
||||
BML_FE_centerX.update()
|
||||
BML_FE_centerY.update()
|
||||
|
||||
# started = time.strftime("%H:%M:%S", time.localtime())
|
||||
|
||||
BML_FE_sizeX.move(FE_sizeX)
|
||||
BML_FE_sizeY.move(FE_sizeY)
|
||||
|
||||
BML_FE_centerX.move(xmin)
|
||||
BML_FE_centerY.move(ymin)
|
||||
|
||||
def FE_scan_move():
|
||||
|
||||
BML_FE_sizeX.update()
|
||||
BML_FE_sizeY.update()
|
||||
BML_FE_centerX.update()
|
||||
BML_FE_centerY.update()
|
||||
|
||||
BML_FE_centerY.setSpeed(0.05)
|
||||
BML_FE_centerY.moveAsync(2.0)
|
||||
|
||||
for i in range(0,10):
|
||||
|
||||
BML_FE_sizeX.update()
|
||||
BML_FE_sizeY.update()
|
||||
BML_FE_centerX.update()
|
||||
BML_FE_centerY.update()
|
||||
|
||||
BML_FE_centerX.move(2.0)
|
||||
|
||||
BML_FE_sizeX.update()
|
||||
BML_FE_sizeY.update()
|
||||
BML_FE_centerX.update()
|
||||
BML_FE_centerY.update()
|
||||
|
||||
BML_FE_centerX.move(-2.0)
|
||||
print(i)
|
||||
# BML_FE_centerY.move(ymin)
|
||||
|
||||
# stopped = time.strftime("%H:%M:%S", time.localtime())
|
||||
# print("started: " + started)
|
||||
# print("stopped: " + stopped)
|
||||
|
||||
def time_scan_2DFE():
|
||||
sensors = [CADC2, 'ca://X11MA-FE-SL1:TRXR-VelAct', 'ca://X11MA-FE-SL1:TRXW-VelAct', 'ca://X11MA-FE-SL1:TRXR-PosAct', 'ca://X11MA-FE-SL1:TRXW-PosAct', 'ca://X11MA-FE-SL1:TRYB-VelAct', 'ca://X11MA-FE-SL1:TRYT-VelAct', 'ca://X11MA-FE-SL1:TRYB-PosAct', 'ca://X11MA-FE-SL1:TRYT-PosAct']
|
||||
# tscan(sensors, points=850, interval=0.1, keep=False, save=False, name='Unknown', domain_axis='Time')
|
||||
tscan(sensors, 850, 0.1, domain_axis='Time')
|
||||
json_path = get_exec_pars().path
|
||||
bml_save_scan_settings_json(json_path)
|
||||
|
||||
def run_parallel_scan():
|
||||
FE_scan_prepare()
|
||||
parallelize(FE_scan_move, time_scan_2DFE)
|
||||
@@ -0,0 +1,89 @@
|
||||
# Added this as "Parameters" in device definitions
|
||||
|
||||
#X11MA-UIND1-MOVER:X-SP X11MA-UIND1-MOVER:X-RBV
|
||||
#X11MA-UIND1-MOVER:Y-SP X11MA-UIND1-MOVER:Y-RBV
|
||||
#X11MA-UIND1-MOVER:YAW-SP X11MA-UIND1-MOVER:YAW-RBV
|
||||
#X11MA-UIND1-MOVER:PITCH-SP X11MA-UIND1-MOVER:PITCH-RBV
|
||||
|
||||
#X11MA-UIND2-MOVER:X-SP X11MA-UIND2-MOVER:X-RBV
|
||||
#X11MA-UIND2-MOVER:Y-SP X11MA-UIND2-MOVER:Y-RBV
|
||||
#X11MA-UIND2-MOVER:YAW-SP X11MA-UIND2-MOVER:YAW-RBV
|
||||
#X11MA-UIND2-MOVER:PITCH-SP X11MA-UIND2-MOVER:PITCH-RBV
|
||||
|
||||
#lscan(BML_energy, Keithley_2_raw, 375.0, 415.0, 0.5, 0.2)
|
||||
|
||||
|
||||
Pos_X_ini = -0.0408
|
||||
Pos_Y_ini = -0.090
|
||||
YAW_ini = -0.0999
|
||||
PITCH_ini = -0.1250
|
||||
|
||||
ID1_X_POS.write(Pos_X_ini)
|
||||
ID1_Y_POS.write(Pos_Y_ini)
|
||||
ID1_YAW.write(YAW_ini)
|
||||
ID1_PITCH.write(PITCH_ini)
|
||||
|
||||
polarizations = [1,2,4,5,6,7,3]
|
||||
|
||||
for p in polarizations:
|
||||
|
||||
print(p)
|
||||
caput("X11MA-UIND1:MODE", p)
|
||||
sleep(60)
|
||||
ID_state = caget("X11MA-UIND1:MODE")
|
||||
print(ID_state)
|
||||
ID_energy = caget("X11MA-UIND1:ENERGY-RBV")
|
||||
print(ID_energy)
|
||||
|
||||
print("Scan X_POS")
|
||||
for i in range(-30, 31, 5):
|
||||
|
||||
x = i / 100.0
|
||||
print(x)
|
||||
ID1_X_POS.write(x)
|
||||
sleep(3.0)
|
||||
lscan(energy_pgm, Keithley_2_raw, 375.0, 415.0, 0.5, 0.2)
|
||||
#lscan(BML_energy, Keithley_2_raw, 375.0, 415.0, 0.5, 0.2)
|
||||
#json_path = get_exec_pars().path
|
||||
#json_enum = get_exec_pars().index
|
||||
#bml_save_scan_settings_json(json_path)
|
||||
|
||||
ID1_X_POS.write(Pos_X_ini)
|
||||
sleep(3.0)
|
||||
|
||||
print("Scan Y_POS")
|
||||
for i in range(-30, 31, 5):
|
||||
|
||||
x = i / 100.0
|
||||
print(x)
|
||||
ID1_Y_POS.write(x)
|
||||
sleep(3.0)
|
||||
lscan(energy_pgm, Keithley_2_raw, 375.0, 415.0, 0.5, 0.2)
|
||||
|
||||
ID1_Y_POS.write(Pos_Y_ini)
|
||||
sleep(3.0)
|
||||
|
||||
print("Scan YAW")
|
||||
|
||||
for i in range(-150, 151, 25):
|
||||
x = i / 1000.0
|
||||
print(x)
|
||||
ID1_YAW.write(x)
|
||||
sleep(3.0)
|
||||
lscan(energy_pgm, Keithley_2_raw, 375.0, 415.0, 0.5, 0.2)
|
||||
|
||||
ID1_YAW.write(YAW_ini)
|
||||
sleep(3.0)
|
||||
|
||||
print("Scan PITCH")
|
||||
|
||||
for i in range(-150, 151, 25):
|
||||
x = i / 1000.0
|
||||
print(x)
|
||||
ID1_PITCH.write(x)
|
||||
sleep(3.0)
|
||||
lscan(energy_pgm, Keithley_2_raw, 375.0, 415.0, 0.5, 0.2)
|
||||
|
||||
ID1_PITCH.write(PITCH_ini)
|
||||
sleep(3.0)
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
# Added this as "Parameters" in device definitions
|
||||
|
||||
#X11MA-UIND1-MOVER:X-SP X11MA-UIND1-MOVER:X-RBV
|
||||
#X11MA-UIND1-MOVER:Y-SP X11MA-UIND1-MOVER:Y-RBV
|
||||
#X11MA-UIND1-MOVER:YAW-SP X11MA-UIND1-MOVER:YAW-RBV
|
||||
#X11MA-UIND1-MOVER:PITCH-SP X11MA-UIND1-MOVER:PITCH-RBV
|
||||
|
||||
#X11MA-UIND2-MOVER:X-SP X11MA-UIND2-MOVER:X-RBV
|
||||
#X11MA-UIND2-MOVER:Y-SP X11MA-UIND2-MOVER:Y-RBV
|
||||
#X11MA-UIND2-MOVER:YAW-SP X11MA-UIND2-MOVER:YAW-RBV
|
||||
#X11MA-UIND2-MOVER:PITCH-SP X11MA-UIND2-MOVER:PITCH-RBV
|
||||
|
||||
#lscan(BML_energy, Keithley_2_raw, 375.0, 415.0, 0.5, 0.2)
|
||||
|
||||
|
||||
Pos_X_ini = -0.0408
|
||||
Pos_Y_ini = -0.090
|
||||
YAW_ini = -0.0999
|
||||
PITCH_ini = -0.1250
|
||||
|
||||
ID1_X_POS.write(Pos_X_ini)
|
||||
ID1_Y_POS.write(Pos_Y_ini)
|
||||
ID1_YAW.write(YAW_ini)
|
||||
ID1_PITCH.write(PITCH_ini)
|
||||
|
||||
polarizations = [2,3,6,7]
|
||||
|
||||
for p in polarizations:
|
||||
|
||||
print(p)
|
||||
caput("X11MA-UIND1:MODE", p)
|
||||
sleep(60)
|
||||
ID_state = caget("X11MA-UIND1:MODE")
|
||||
print(ID_state)
|
||||
ID_energy = caget("X11MA-UIND1:ENERGY-RBV")
|
||||
print(ID_energy)
|
||||
|
||||
p
|
||||
print("Scan YAW")
|
||||
|
||||
for i in range(-300, 301, 50):
|
||||
x = i / 1000.0
|
||||
print(x)
|
||||
ID1_YAW.write(x)
|
||||
sleep(3.0)
|
||||
lscan(energy_pgm, Keithley_2_raw, 375.0, 415.0, 0.5, 0.2)
|
||||
|
||||
ID1_YAW.write(YAW_ini)
|
||||
sleep(3.0)
|
||||
|
||||
print("Scan PITCH")
|
||||
|
||||
for i in range(-300, 301, 50):
|
||||
x = i / 1000.0
|
||||
print(x)
|
||||
ID1_PITCH.write(x)
|
||||
sleep(3.0)
|
||||
lscan(energy_pgm, Keithley_2_raw, 375.0, 415.0, 0.5, 0.2)
|
||||
|
||||
ID1_PITCH.write(PITCH_ini)
|
||||
sleep(3.0)
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
# Added this as "Parameters" in device definitions
|
||||
|
||||
#X11MA-UIND1-MOVER:X-SP X11MA-UIND1-MOVER:X-RBV
|
||||
#X11MA-UIND1-MOVER:Y-SP X11MA-UIND1-MOVER:Y-RBV
|
||||
#X11MA-UIND1-MOVER:YAW-SP X11MA-UIND1-MOVER:YAW-RBV
|
||||
#X11MA-UIND1-MOVER:PITCH-SP X11MA-UIND1-MOVER:PITCH-RBV
|
||||
|
||||
#X11MA-UIND2-MOVER:X-SP X11MA-UIND2-MOVER:X-RBV
|
||||
#X11MA-UIND2-MOVER:Y-SP X11MA-UIND2-MOVER:Y-RBV
|
||||
#X11MA-UIND2-MOVER:YAW-SP X11MA-UIND2-MOVER:YAW-RBV
|
||||
#X11MA-UIND2-MOVER:PITCH-SP X11MA-UIND2-MOVER:PITCH-RBV
|
||||
|
||||
#lscan(BML_energy, Keithley_2_raw, 375.0, 415.0, 0.5, 0.2)
|
||||
|
||||
|
||||
Pos_X_ini = -0.0393
|
||||
Pos_Y_ini = -0.0702
|
||||
YAW_ini = 0.0499
|
||||
PITCH_ini = -0.0099
|
||||
|
||||
ID2_X_POS.write(Pos_X_ini)
|
||||
ID2_Y_POS.write(Pos_Y_ini)
|
||||
ID2_YAW.write(YAW_ini)
|
||||
ID2_PITCH.write(PITCH_ini)
|
||||
|
||||
polarizations = [1,6,7,3]
|
||||
|
||||
for p in polarizations:
|
||||
|
||||
print(p)
|
||||
caput("X11MA-UIND2:MODE", p)
|
||||
sleep(60)
|
||||
ID_state = caget("X11MA-UIND2:MODE")
|
||||
print(ID_state)
|
||||
ID_energy = caget("X11MA-UIND2:ENERGY-RBV")
|
||||
print(ID_energy)
|
||||
|
||||
print("Scan X_POS")
|
||||
for i in range(-30, 31, 5):
|
||||
|
||||
x = i / 100.0
|
||||
print(x)
|
||||
ID2_X_POS.write(x)
|
||||
sleep(3.0)
|
||||
lscan(energy_pgm, [Keithley_2_raw, ID2_X_POS, ID2_Y_POS, ID2_YAW, ID2_PITCH], 380.0, 420.0, 0.5, 0.2)
|
||||
#lscan(BML_energy, Keithley_2_raw, 375.0, 415.0, 0.5, 0.2)
|
||||
#json_path = get_exec_pars().path
|
||||
#json_enum = get_exec_pars().index
|
||||
#bml_save_scan_settings_json(json_path)
|
||||
|
||||
ID2_X_POS.write(Pos_X_ini)
|
||||
sleep(3.0)
|
||||
|
||||
print("Scan Y_POS")
|
||||
for i in range(-30, 31, 5):
|
||||
|
||||
x = i / 100.0
|
||||
print(x)
|
||||
ID2_Y_POS.write(x)
|
||||
sleep(3.0)
|
||||
lscan(energy_pgm, [Keithley_2_raw, ID2_X_POS, ID2_Y_POS, ID2_YAW, ID2_PITCH], 380.0, 420.0, 0.5, 0.2)
|
||||
|
||||
ID2_Y_POS.write(Pos_Y_ini)
|
||||
sleep(3.0)
|
||||
|
||||
print("Scan YAW")
|
||||
|
||||
for i in range(-300, 301, 50):
|
||||
x = i / 1000.0
|
||||
print(x)
|
||||
ID2_YAW.write(x)
|
||||
sleep(3.0)
|
||||
lscan(energy_pgm, [Keithley_2_raw, ID2_X_POS, ID2_Y_POS, ID2_YAW, ID2_PITCH], 380.0, 420.0, 0.5, 0.2)
|
||||
|
||||
ID2_YAW.write(YAW_ini)
|
||||
sleep(3.0)
|
||||
|
||||
print("Scan PITCH")
|
||||
|
||||
for i in range(-300, 301, 50):
|
||||
x = i / 1000.0
|
||||
print(x)
|
||||
ID2_PITCH.write(x)
|
||||
sleep(3.0)
|
||||
lscan(energy_pgm, [Keithley_2_raw, ID2_X_POS, ID2_Y_POS, ID2_YAW, ID2_PITCH], 380.0, 420.0, 0.5, 0.2)
|
||||
|
||||
ID2_PITCH.write(PITCH_ini)
|
||||
sleep(3.0)
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
#import numpy as np
|
||||
#n_steps = 256
|
||||
#theta_deg = np.linspace(0, 360, n_steps, endpoint=True)
|
||||
#theta_rad = np.deg2rad(theta_deg)
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#vector = [ [1,1] , [1,2] , [1,3] , [1,4] ,
|
||||
# [1.5,2.5] ,
|
||||
# [2,1] , [2,2] , [2,3] , [2,4] ,
|
||||
# [2.5,2.5] ,
|
||||
# [3,1] , [3,2] , [3,3] , [3,4] ]
|
||||
#
|
||||
#r3 = vscan((m1,m2),(ai1,ai2),vector,False, 0.1, title = "2D Vector")
|
||||
|
||||
|
||||
Pos_X_ini = -0.0408
|
||||
Pos_Y_ini = -0.090
|
||||
YAW_ini = -0.0999
|
||||
PITCH_ini = -0.1250
|
||||
|
||||
ID1_X_POS.write(Pos_X_ini)
|
||||
ID1_Y_POS.write(Pos_Y_ini)
|
||||
ID1_YAW.write(YAW_ini)
|
||||
ID1_PITCH.write(PITCH_ini)
|
||||
|
||||
|
||||
ID1_Y_POS.write(0.3)
|
||||
|
||||
from org.apache.commons.math3.util import FastMath
|
||||
|
||||
vector = [
|
||||
[
|
||||
0.3 * FastMath.sin(2.0 * FastMath.PI * i / 256.0),
|
||||
0.3 * FastMath.cos(2.0 * FastMath.PI * i / 256.0)
|
||||
]
|
||||
for i in range(256)
|
||||
]
|
||||
|
||||
r3 = vscan((ID1_X_POS,ID1_Y_POS),[Keithley_2_raw, ID1_X_POS, ID1_Y_POS, ID1_YAW, ID1_PITCH, energy_pgm],vector,False, 1.0, title = "ID 1 Circumfence Scan")
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#lscan(exit_slit, CADC2, 30.0, -20.0, 1.0, 0.1)
|
||||
#print("YAW")
|
||||
#print("YAW")
|
||||
|
||||
|
||||
dsg
|
||||
# ID1
|
||||
Pos_X_ini = -0.0408
|
||||
Pos_Y_ini = -0.090
|
||||
YAW_ini = -0.0999
|
||||
PITCH_ini = -0.1250
|
||||
|
||||
ID1_X_POS.write(Pos_X_ini)
|
||||
ID1_Y_POS.write(Pos_Y_ini)
|
||||
ID1_YAW.write(YAW_ini)
|
||||
ID1_PITCH.write(PITCH_ini)
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
# Added this as "Parameters" in device definitions
|
||||
|
||||
#X11MA-UIND1-MOVER:X-SP X11MA-UIND1-MOVER:X-RBV
|
||||
#X11MA-UIND1-MOVER:Y-SP X11MA-UIND1-MOVER:Y-RBV
|
||||
#X11MA-UIND1-MOVER:YAW-SP X11MA-UIND1-MOVER:YAW-RBV
|
||||
#X11MA-UIND1-MOVER:PITCH-SP X11MA-UIND1-MOVER:PITCH-RBV
|
||||
|
||||
#X11MA-UIND2-MOVER:X-SP X11MA-UIND2-MOVER:X-RBV
|
||||
#X11MA-UIND2-MOVER:Y-SP X11MA-UIND2-MOVER:Y-RBV
|
||||
#X11MA-UIND2-MOVER:YAW-SP X11MA-UIND2-MOVER:YAW-RBV
|
||||
#X11MA-UIND2-MOVER:PITCH-SP X11MA-UIND2-MOVER:PITCH-RBV
|
||||
|
||||
#lscan(BML_energy, Keithley_2_raw, 375.0, 415.0, 0.5, 0.2)
|
||||
|
||||
|
||||
# ID1
|
||||
Pos_X_ini = -0.0408
|
||||
Pos_Y_ini = -0.090
|
||||
YAW_ini = -0.0999
|
||||
PITCH_ini = -0.1250
|
||||
|
||||
ID1_X_POS.write(Pos_X_ini)
|
||||
ID1_Y_POS.write(Pos_Y_ini)
|
||||
ID1_YAW.write(YAW_ini)
|
||||
ID1_PITCH.write(PITCH_ini)
|
||||
|
||||
polarizations = [1,2,3,6,7]
|
||||
|
||||
for p in polarizations:
|
||||
|
||||
print(p)
|
||||
caput("X11MA-UIND1:MODE", p)
|
||||
sleep(60)
|
||||
ID_state = caget("X11MA-UIND1:MODE")
|
||||
print(ID_state)
|
||||
ID_energy = caget("X11MA-UIND1:ENERGY-RBV")
|
||||
print(ID_energy)
|
||||
|
||||
p
|
||||
print("Scan YAW")
|
||||
|
||||
for i in range(-300, 301, 50):
|
||||
x = i / 1000.0
|
||||
print(x)
|
||||
ID1_YAW.write(x)
|
||||
sleep(3.0)
|
||||
lscan(energy_pgm, Keithley_2_raw, 375.0, 415.0, 0.5, 0.2)
|
||||
|
||||
ID1_YAW.write(YAW_ini)
|
||||
sleep(3.0)
|
||||
|
||||
print("Scan PITCH")
|
||||
|
||||
for i in range(-300, 301, 50):
|
||||
x = i / 1000.0
|
||||
print(x)
|
||||
ID1_PITCH.write(x)
|
||||
sleep(3.0)
|
||||
lscan(energy_pgm, Keithley_2_raw, 375.0, 415.0, 0.5, 0.2)
|
||||
|
||||
ID1_PITCH.write(PITCH_ini)
|
||||
sleep(3.0)
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
# From Alexandre Gobbo, see MS Teams
|
||||
# After you run it the first time you must configure the device, and the initialize it:
|
||||
|
||||
class EnergyPGM(Positioner):
|
||||
def doWrite(self, val):
|
||||
energy_pgm.getSetpoint().write(val)
|
||||
caput ("X11MA-PGM:setE.PROC", 1)
|
||||
|
||||
add_device(EnergyPGM("energy_pgm", "X11MA-PGM:energy", "X11MA-PGM:rbkenergy"), True)
|
||||
energy_pgm.monitored=True
|
||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
@@ -0,0 +1,9 @@
|
||||
index=0
|
||||
|
||||
def after_read(rec):
|
||||
if rec[ai2] < 0:
|
||||
time.sleep(1.0)
|
||||
rec.invalidate()
|
||||
|
||||
|
||||
a= lscan((m1), (ai1,ai2), (0,), (0.4,), 20, 0.1, after_read=after_read)
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
testing = get_exec_pars().getSource()==CommandSource.ui
|
||||
if testing:
|
||||
START=780.0
|
||||
END= 800.0
|
||||
STEP_SIZE=1.0
|
||||
|
||||
|
||||
|
||||
|
||||
lscan (BML_energy, CADC2, START, END, STEP_SIZE)
|
||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
+32
-12
@@ -19,6 +19,24 @@
|
||||
"TOT_bump_Y": {"read_cmd": "AGEBD-ORBITBUMP:X11MA-OFFSET-Y-TOTAL", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
"TOT_bump_YP": {"read_cmd": "AGEBD-ORBITBUMP:X11MA-OFFSET-YP-TOTAL", "write_cmd": "None", "tolerance": 0.0001, "restorable": false}
|
||||
},
|
||||
"ID1": {
|
||||
"ID1_energy": {"read_cmd": "X11MA-UIND1:ENERGY-RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
"ID1_mode": {"read_cmd": "X11MA-UIND1:MODE", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
"ID1_gap": {"read_cmd": "X11MA-UIND1:GAP-RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
"ID1_offset": {"read_cmd": "X11MA-UIND1:ENERGY-OFFS", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
"ID1_TO_RAD": {"read_cmd": "X11MA-UIND1:TO-RAD-RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
"ID1_BO_RAD": {"read_cmd": "X11MA-UIND1:BO-RAD-RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
"ID1_TI_RAD": {"read_cmd": "X11MA-UIND1:TI-RAD-RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
"ID1_BI_RAD": {"read_cmd": "X11MA-UIND1:BI-RAD-RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
"ID1_TO_SHIFT": {"read_cmd": "X11MA-UIND1:TO-SHIFT-RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
"ID1_BO_SHIFT": {"read_cmd": "X11MA-UIND1:BO-SHIFT-RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
"ID1_TI_SHIFT": {"read_cmd": "X11MA-UIND1:TI-SHIFT-RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
"ID1_BI_SHIFT": {"read_cmd": "X11MA-UIND1:BI-SHIFT-RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
"ID1_X_POS": {"read_cmd": "X11MA-UIND1-MOVER:X-RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
"ID1_Y_POS": {"read_cmd": "X11MA-UIND1-MOVER:Y-RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
"ID1_YAW": {"read_cmd": "X11MA-UIND1-MOVER:YAW-RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
"ID1_PITCH": {"read_cmd": "X11MA-UIND1-MOVER:PITCH-RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false}
|
||||
},
|
||||
"ID2": {
|
||||
"ID2_energy": {"read_cmd": "X11MA-UIND2:ENERGY-RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
"ID2_mode": {"read_cmd": "X11MA-UIND2:MODE", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
@@ -28,10 +46,14 @@
|
||||
"ID2_BO_RAD": {"read_cmd": "X11MA-UIND2:BO-RAD-RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
"ID2_TI_RAD": {"read_cmd": "X11MA-UIND2:TI-RAD-RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
"ID2_BI_RAD": {"read_cmd": "X11MA-UIND2:BI-RAD-RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
"ID2_TO_SHIFT": {"read_cmd": "X11MA-UIND2:TO-SHIFT-RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
"ID2_TO_SHIFT": {"read_cmd": "X11MA-UIND2:TO-SHIFT-RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
"ID2_BO_SHIFT": {"read_cmd": "X11MA-UIND2:BO-SHIFT-RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
"ID2_TI_SHIFT": {"read_cmd": "X11MA-UIND2:TI-SHIFT-RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
"ID2_BI_SHIFT": {"read_cmd": "X11MA-UIND2:BI-SHIFT-RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false}
|
||||
"ID2_BI_SHIFT": {"read_cmd": "X11MA-UIND2:BI-SHIFT-RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
"ID2_X_POS": {"read_cmd": "X11MA-UIND2-MOVER:X-RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
"ID2_Y_POS": {"read_cmd": "X11MA-UIND2-MOVER:Y-RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
"ID2_YAW": {"read_cmd": "X11MA-UIND2-MOVER:YAW-RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
"ID2_PITCH": {"read_cmd": "X11MA-UIND2-MOVER:PITCH-RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false}
|
||||
},
|
||||
"XBPM1": {
|
||||
"XBPM1_X_motor": {"read_cmd": "X11MA-FE-XBPM1:TRX.RBV", "write_cmd": "None", "tolerance": 0.0001, "restorable": false},
|
||||
@@ -105,13 +127,12 @@
|
||||
"FMU": {
|
||||
"FMU_X": {"read_cmd": "X11MA-OP-FM:X.RBV", "write_cmd": "X11MA-OP-FM:X", "tolerance": 0.001, "restorable": false},
|
||||
"FMU_Y": {"read_cmd": "X11MA-OP-FM:Y.RBV", "write_cmd": "X11MA-OP-FM:Y", "tolerance": 0.001, "restorable": false},
|
||||
"FMU_PITCH": {"read_cmd": "X11MA-OP-FM:PITCH.RBV", "write_cmd": "X11MA-OP-FM:PITCH", "tolerance": 0.001, "restorable": false},
|
||||
"FMU_ROLL": {"read_cmd": "X11MA-OP-FM:ROLL.RBV", "write_cmd": "X11MA-OP-FM:ROLL", "tolerance": 0.001, "restorable": false},
|
||||
"FMU_YAW": {"read_cmd": "X11MA-OP-FM:YAW.RBV", "write_cmd": "X11MA-OP-FM:YAW", "tolerance": 0.001, "restorable": false},
|
||||
"FMU_ROTX": {"read_cmd": "X11MA-OP-FM:ROTX.RBV", "write_cmd": "X11MA-OP-FM:ROTX", "tolerance": 0.001, "restorable": false},
|
||||
"FMU_ROTZ": {"read_cmd": "X11MA-OP-FM:ROTZ.RBV", "write_cmd": "X11MA-OP-FM:ROTZ", "tolerance": 0.001, "restorable": false},
|
||||
"FMU_TRYD": {"read_cmd": "X11MA-OP-FM:TRYD.RBV", "write_cmd": "X11MA-OP-FM:TRYD", "tolerance": 0.001, "restorable": true},
|
||||
"FMU_TRYUR": {"read_cmd": "X11MA-OP-FM:TRYUR.RBV", "write_cmd": "X11MA-OP-FM:TRYUR", "tolerance": 0.001, "restorable": true},
|
||||
"FMU_TRYUR": {"read_cmd": "X11MA-OP-FM:TRYUR.RBV", "write_cmd": "X11MA-OP-FM:TRYUR", "tolerance": 0.001, "restorable": true},
|
||||
"FMU_TRYUW": {"read_cmd": "X11MA-OP-FM:TRYUW.RBV", "write_cmd": "X11MA-OP-FM:TRYUW", "tolerance": 0.001, "restorable": true},
|
||||
"FMU_TRX": {"read_cmd": "X11MA-OP-FM:TRX.RBV", "write_cmd": "X11MA-OP-FM:TRX", "tolerance": 0.001, "restorable": true},
|
||||
"FMU_TRX": {"read_cmd": "X11MA-OP-FM:TRX.RBV", "write_cmd": "X11MA-OP-FM:TRX", "tolerance": 0.001, "restorable": true},
|
||||
"FMU_ROTY": {"read_cmd": "X11MA-OP-FM:ROTY.RBV", "write_cmd": "X11MA-OP-FM:ROTY", "tolerance": 0.001, "restorable": true}
|
||||
},
|
||||
"ESLIT": {
|
||||
@@ -125,13 +146,12 @@
|
||||
"RMU1": {
|
||||
"RMU1_X": {"read_cmd": "X11MA-OP-RM1:X.RBV", "write_cmd": "X11MA-OP-RM1:X", "tolerance": 0.001, "restorable": false},
|
||||
"RMU1_Y": {"read_cmd": "X11MA-OP-RM1:Y.RBV", "write_cmd": "X11MA-OP-RM1:Y", "tolerance": 0.001, "restorable": false},
|
||||
"RMU1_PITCH": {"read_cmd": "X11MA-OP-RM1:PITCH.RBV", "write_cmd": "X11MA-OP-RM1:PITCH", "tolerance": 0.001, "restorable": false},
|
||||
"RMU1_ROLL": {"read_cmd": "X11MA-OP-RM1:ROLL.RBV", "write_cmd": "X11MA-OP-RM1:ROLL", "tolerance": 0.001, "restorable": false},
|
||||
"RMU1_YAW": {"read_cmd": "X11MA-OP-RM1:YAW.RBV", "write_cmd": "X11MA-OP-RM1:YAW", "tolerance": 0.001, "restorable": false},
|
||||
"RMU1_ROTX": {"read_cmd": "X11MA-OP-RM1:ROTX.RBV", "write_cmd": "X11MA-OP-RM1:ROTX", "tolerance": 0.001, "restorable": false},
|
||||
"RMU1_ROTZ": {"read_cmd": "X11MA-OP-RM1:ROTZ.RBV", "write_cmd": "X11MA-OP-RM1:ROTZ", "tolerance": 0.001, "restorable": false},
|
||||
"RMU1_TRYU": {"read_cmd": "X11MA-OP-RM1:TRYU.RBV", "write_cmd": "X11MA-OP-RM1:TRYU", "tolerance": 0.001, "restorable": true},
|
||||
"RMU1_TRYDW": {"read_cmd": "X11MA-OP-RM1:TRYDW.RBV", "write_cmd": "X11MA-OP-RM1:TRYDW", "tolerance": 0.001, "restorable": true},
|
||||
"RMU1_TRYDW": {"read_cmd": "X11MA-OP-RM1:TRYDW.RBV", "write_cmd": "X11MA-OP-RM1:TRYDW", "tolerance": 0.001, "restorable": true},
|
||||
"RMU1_TRYDR": {"read_cmd": "X11MA-OP-RM1:TRYDR.RBV", "write_cmd": "X11MA-OP-RM1:TRYDR", "tolerance": 0.001, "restorable": true},
|
||||
"RMU1_TRX": {"read_cmd": "X11MA-OP-RM1:TRX.RBV", "write_cmd": "X11MA-OP-RM1:TRX", "tolerance": 0.001, "restorable": true},
|
||||
"RMU1_TRX": {"read_cmd": "X11MA-OP-RM1:TRX.RBV", "write_cmd": "X11MA-OP-RM1:TRX", "tolerance": 0.001, "restorable": true},
|
||||
"RMU1_ROTY": {"read_cmd": "X11MA-OP-RM1:ROTY.RBV", "write_cmd": "X11MA-OP-RM1:ROTY", "tolerance": 0.001, "restorable": true}
|
||||
},
|
||||
"PEEM_Girder": {
|
||||
|
||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user