Script Tests

This commit is contained in:
gac-x11ma
2021-05-12 09:55:11 +02:00
parent d886999e06
commit fee5f5ffba
4 changed files with 75 additions and 43 deletions

View File

@@ -1,10 +1,9 @@
#Tue May 11 14:15:16 CEST 2021
#Wed May 12 09:47:57 CEST 2021
proposal=proposal
RSYNC_USER=
ENERGY=710
OUTLIERS_THRESHOLD=1000000000
proposer=proposer
POL_ID_1=Circ_Plus
NORM_FILE=/sls/X11MA/data/X11MA/Data1/2021/Yona250121/s250121
AUTO_SWITCH_VALVE=true
RSYNC_HOST=
@@ -12,9 +11,9 @@ sample=sample
RSYNC_PATH=
DRY_RUN=false
pgroup=pgroup
POL_ID_2=Circ_Minus
POL_ID_2=Lin_Hor
RSYNC_DEL=true
ID=ID1_ID2
ID=ID2
AVERAGING_DETECTOR=true
FdaBrowser=false
authors=author1|author2

View File

@@ -1,4 +1,4 @@
#Tue May 11 14:08:17 CEST 2021
LastRunDate=210511
FileSequentialNumber=7542
DaySequentialNumber=71
#Wed May 12 09:49:36 CEST 2021
LastRunDate=210512
FileSequentialNumber=7552
DaySequentialNumber=18

View File

@@ -358,25 +358,23 @@ public class Eiger extends Panel {
}// </editor-fold>//GEN-END:initComponents
private void comboDepthActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboDepthActionPerformed
comboDepth.setEnabled(false);
new Thread( ()-> {
try{
try{
if (!updatingControls){
ch.psi.pshell.device.Camera eiger = (ch.psi.pshell.device.Camera) getDevice("eiger");
if (comboDepth.getSelectedIndex()!=comboDepth.getItemCount()) {
if (eiger.isStarted()){
buttonStopDetectorActionPerformed(null);
eiger.waitState(State.Ready, 10000); //Timeout of 10s
}
if (eiger.isStarted()){
buttonDoneActionPerformed(null);
eiger.waitState(State.Ready, 10000); //Timeout of 10s
}
//((ch.psi.pshell.device.Camera) getDevice("eiger")).stop();
//TimeUnit.SECONDS.sleep(1);
if (comboDepth.getSelectedIndex()!=comboDepth.getItemCount()) {
Integer value = Integer.valueOf((String)comboDepth.getSelectedItem());
bitDepth.write(value);
bitDepth.write(value);
}
} catch (Exception ex){
showException(ex);
}
finally{
comboDepth.setEnabled(true);
}
}).start();
} catch (Exception ex){
showException(ex);
}
}//GEN-LAST:event_comboDepthActionPerformed
private void buttonStartDetectorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonStartDetectorActionPerformed
@@ -393,45 +391,41 @@ public class Eiger extends Panel {
}//GEN-LAST:event_buttonStartDetectorActionPerformed
private void comboModeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboModeActionPerformed
comboMode.setEnabled(false);
new Thread( ()-> {
try{
try{
if (!updatingControls){
ch.psi.pshell.device.Camera eiger = (ch.psi.pshell.device.Camera) getDevice("eiger");
if (eiger.isStarted()){
buttonStopDetectorActionPerformed(null);
buttonDoneActionPerformed(null);
eiger.waitState(State.Ready, 10000); //Timeout of 10s
}
//((ch.psi.pshell.device.Camera) getDevice("eiger")).stop();
//TimeUnit.SECONDS.sleep(1);
Integer value = comboMode.getSelectedIndex();
if (value==1){
value++;
}
mode.write(value);
} catch (Exception ex){
showException(ex);
}
finally{
comboMode.setEnabled(true);
}
}).start();
} catch (Exception ex){
showException(ex);
}
}//GEN-LAST:event_comboModeActionPerformed
private void spinnerExposureStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerExposureStateChanged
spinnerExposure.setEnabled(false);
new Thread( ()-> {
try{
try{
if (!updatingControls){
ch.psi.pshell.device.Camera eiger = (ch.psi.pshell.device.Camera) getDevice("eiger");
if (eiger.isStarted()){
buttonStopDetectorActionPerformed(null);
buttonDoneActionPerformed(null);
eiger.waitState(State.Ready, 10000); //Timeout of 10s
}
//((ch.psi.pshell.device.Camera) getDevice("eiger")).stop();
//TimeUnit.SECONDS.sleep(1);
exposure.write((Double)spinnerExposure.getValue());
} catch (Exception ex){
showException(ex);
}
finally{
spinnerExposure.setEnabled(true);
}
}).start();
} catch (Exception ex){
showException(ex);
}
}//GEN-LAST:event_spinnerExposureStateChanged
private void buttonStopDetectorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonStopDetectorActionPerformed

View File

@@ -0,0 +1,39 @@
##Constants
AVERAGE = 1
EXPOSURE = 1.0
MEASUREMENTS = 5
##TakeImage at 710 eV at the given polarization
change_energy(712)
take_image(scans=1, switch_pol=False, measurements=MEASUREMENTS, exposure=EXPOSURE, average=AVERAGE)
time.sleep(2.0)
#
#TwoImages Two Pol with C+/C- and ID1 + ID2, tune-detune, at 710 eV
set_beamline_setup(id ="ID1_ID2", en=710, pol1="Circ_Plus", alp1=0.0, har1=1, off1=0.0, pol2="Circ_Minus", alp2=0.0, har2=1, off2=0.0)
two_pol(switching="Tune_Detune", sequence="A", measurements=MEASUREMENTS, exposure=EXPOSURE, average=AVERAGE)
time.sleep(2.0)
#TwoEnergies with lin hor polarization ID2 only (normal)
set_beamline_setup(id ="ID2", en=710, pol2="Lin_Hor")
two_energies(705, 710, measurements=MEASUREMENTS, exposure=EXPOSURE, average=AVERAGE)
time.sleep(2.0)
#abs_spec(ranges=[[500.0, 1000.0, 100.0],], switch_pol=False, scans=1, exposure=EXPOSURE, average=AVERAGE) #Use manulally defined ranges and rois defined in GUI
abs_spec(ranges="Fe_L3_fine", roi="test", switch_pol=False, scans=1, exposure=EXPOSURE, average=AVERAGE)
#Direct functions to change energy, pol, offset:
#change_energy(700)
#change_pol(1, "Circ_Plus" ) #Pol on ID1: "Circ_Plus", "Circ_Minus" , "Lin_Hor", "Lin_Ver"
#change_pol(1, "Lin" , alpha = "0" ) #Lin pol on ID 1
#change_offset(1, 0.0) #offset on ID1
#Auto-switching:
#switch_pol()
#Restoring beamline state defined in last set_beamline_setut:
#restore_beamline_setup()