diff --git a/config/jcae.properties b/config/jcae.properties
index 8af012c..a8cd043 100644
--- a/config/jcae.properties
+++ b/config/jcae.properties
@@ -1,8 +1,8 @@
-#Fri Aug 27 09:00:46 CEST 2021
+#Thu Jan 20 17:13:38 CET 2022
ch.psi.jcae.ContextFactory.addressList=
ch.psi.jcae.ContextFactory.serverPort=
-ch.psi.jcae.ContextFactory.maxArrayBytes=20000000
-ch.psi.jcae.ContextFactory.maxSendArrayBytes=10000000
+ch.psi.jcae.ContextFactory.maxArrayBytes=40000000
+ch.psi.jcae.ContextFactory.maxSendArrayBytes=20000000
ch.psi.jcae.ChannelFactory.retries=2
ch.psi.jcae.ChannelFactory.timeout=1500
ch.psi.jcae.impl.DefaultChannelService.retries=1
diff --git a/config/plugins.properties b/config/plugins.properties
index be9fea4..9381d95 100644
--- a/config/plugins.properties
+++ b/config/plugins.properties
@@ -1,4 +1,2 @@
-NewJPanel.java=disabled
-Test.java=disabled
SIStem.java=enabled
EnergyScan.java=disabled
diff --git a/config/variables.properties b/config/variables.properties
index 6400f9f..83a3e3d 100644
--- a/config/variables.properties
+++ b/config/variables.properties
@@ -1,4 +1,4 @@
-#Wed Jan 19 10:05:40 CET 2022
-LastRunDate=220119
+#Thu Jan 27 11:28:54 CET 2022
+LastRunDate=220127
DaySequentialNumber=1
-FileSequentialNumber=97
+FileSequentialNumber=180
diff --git a/plugins/SIStem.form b/plugins/SIStem.form
index be62243..6268088 100644
--- a/plugins/SIStem.form
+++ b/plugins/SIStem.form
@@ -24,6 +24,10 @@
+
+
+
+
@@ -67,6 +71,8 @@
+
+
@@ -1379,5 +1385,16 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/plugins/SIStem.java b/plugins/SIStem.java
index 49adfd4..2c6f665 100644
--- a/plugins/SIStem.java
+++ b/plugins/SIStem.java
@@ -15,8 +15,12 @@ import ch.psi.pshell.plot.MatrixPlotSeries;
import ch.psi.pshell.plot.Plot;
import ch.psi.pshell.swing.DataPanel;
import ch.psi.pshell.swing.DevicePanel;
+import ch.psi.pshell.ui.App;
import ch.psi.pshell.ui.PanelProcessor;
+import ch.psi.pshell.ui.Preferences;
+import ch.psi.pshell.ui.Processor;
import ch.psi.pshell.ui.QueueProcessor;
+import ch.psi.pshell.ui.View;
import ch.psi.utils.Arr;
import ch.psi.utils.Convert;
import ch.psi.utils.IO;
@@ -77,7 +81,29 @@ public class SIStem extends PanelProcessor {
final JComboBox[] deviceCombos;
String[] additionalPositioners ;
boolean intialized;
-
+
+ static{
+ QueueProcessor.DEFAULT_INFO_COLUMN = "Time";
+ View view = App.getInstance().getMainFrame();
+ if (view!=null){
+ List queues =view.getQueues();
+ for (QueueProcessor qp : queues){
+ String filename = qp.getFileName();
+ if ((filename!=null)&&(!filename.isBlank())&&!qp.hasChanged()){
+ System.out.println("Reload: " + filename);
+ try {
+ view.getDocumentsTab().remove(qp.getPanel());
+ view.openProcessor(QueueProcessor.class, filename);
+ } catch (Exception ex) {
+ Logger.getLogger(SIStem.class.getName()).log(Level.SEVERE, null, ex);
+ ex.printStackTrace();
+ }
+ }
+ }
+ }
+
+ }
+
public SIStem() {
initComponents();
modelInactive = (DefaultTableModel) tableInactive.getModel();
@@ -184,6 +210,7 @@ public class SIStem extends PanelProcessor {
detectorPlot.getAxis(Plot.AxisId.X).setLabel("X-Scale (energy)");
detectorPlot.getAxis(Plot.AxisId.Y).setLabel("Y-Scale (distance or angle)");
clear();
+ startTimer(2000, 100);
}
void addDevice(ProcessVariable dev, DefaultTableModel model, int row, Object[] data) {
@@ -223,8 +250,10 @@ public class SIStem extends PanelProcessor {
//Overridable callbacks
@Override
public void onInitialize(int runCount) {
- if ((runCount == 0)&&(getFileName()==null)) {
- clear();
+ if (runCount == 0) {
+ if (getFileName()==null){
+ clear();
+ }
}
if (!intialized) {
@@ -283,6 +312,13 @@ public class SIStem extends PanelProcessor {
public void onExecutedFile(String fileName, Object result) {
}
+ @Override
+ public void onTimer() {
+ if (getState().isInitialized()){
+ updateTime();
+ }
+ }
+
//Callback to perform update - in event thread
@Override
protected void doUpdate() {
@@ -504,6 +540,8 @@ public class SIStem extends PanelProcessor {
}
} finally{
updateControls();
+ updatingTime=false;
+ updateTime();
}
}
@@ -553,6 +591,7 @@ public class SIStem extends PanelProcessor {
getLogger().log(Level.WARNING, null, ex);
}
}
+ textTime.setText("");
}
@Override
@@ -601,22 +640,29 @@ public class SIStem extends PanelProcessor {
if (currentFile == null) {
return;
}
-
+ Processor p = getView().getRunningProcessor(true);
HashMap args = new HashMap();
- args.put("NAME", getScanName());
-
- this.runAsync("templates/SIStem", args).handle((ret, ex) -> {
- if (ex != null) {
- }
- try {
- } catch (Exception e) {
- Logger.getLogger(SIStem.class.getName()).log(Level.SEVERE, null, e);
- }
+ args.put("NAME", getScanName());
+ this.runAsync("templates/SIStem", args).handle((ret, ex) -> {
+ if (ex != null) {
+ if ((p==null)||!(p instanceof QueueProcessor)){
+ if (getView().getPreferences().getScriptPopupDialog() != Preferences.ScriptPopupDialog.None) {
+ if (!getContext().isAborted()) {
+ showException((Exception)ex);
+ }
+ }
+ }
+ }
return ret;
});
}
-
+
+ @Override
+ public Object getResult() {
+ return getContext().getLastScriptResult();
+ }
+
String getScanName() {
String scan = null;
if (currentFile != null) {
@@ -945,6 +991,56 @@ public class SIStem extends PanelProcessor {
void onPlotHide() {
detectorPlot.clear();
}
+
+ volatile boolean updatingTime;
+ void updateTime(){
+ if (!updatingTime){
+ String cmd="calc_acquisition_time(";
+ int samples = 1;
+ for (int i = 0; i < modelScanned.getRowCount(); i++) {
+ Integer points = (Integer) modelScanned.getValueAt(i, 3);
+ samples*=points;
+ }
+ cmd+="samples="+Math.max(samples,1) + ", ";
+
+ if (!((String)comboAcquisition.getSelectedItem()).isBlank()){
+ cmd+="mode='"+String.valueOf(comboAcquisition.getSelectedItem()) + "', ";
+ }
+ if (!textLowEnergy.getText().isBlank()){
+ cmd+="enl="+(String)textLowEnergy.getText() + ", ";
+ }
+ if (!textHighEnergy.getText().isBlank()){
+ cmd+="enh="+(String)textHighEnergy.getText() + ", ";
+ }
+ if (!textStepEnergy.getText().isBlank()){
+ cmd+="ens="+(String)textStepEnergy.getText() + ", ";
+ }
+ if (!textLowThetaY.getText().isBlank()){
+ cmd+="tyl="+(String)textLowThetaY.getText() + ", ";
+ }
+ if (!textHighThetaY.getText().isBlank()){
+ cmd+="tyh="+(String)textHighThetaY.getText() + ", ";
+ }
+ if (!textStepThetaY.getText().isBlank()){
+ cmd+="tys="+(String)textStepThetaY.getText() + ", ";
+ }
+ cmd+=")";
+ updatingTime=true;
+ try {
+ this.evalAsync(cmd, true).handle((ret, ex) -> {
+ String text = ((ex != null) || (ret==null)) ? "" : String.valueOf(ret);
+ SwingUtilities.invokeLater(()->{
+ textTime.setText(text);
+ });
+ updatingTime=false;
+ return ret;
+ });
+ } catch (Context.ContextStateException ex) {
+ Logger.getLogger(SIStem.class.getName()).log(Level.WARNING, null, ex);
+ updatingTime=false;
+ }
+ }
+ }
@SuppressWarnings("unchecked")
// //GEN-BEGIN:initComponents
@@ -1053,6 +1149,8 @@ public class SIStem extends PanelProcessor {
buttonSave = new javax.swing.JButton();
buttonClear = new javax.swing.JButton();
buttonData = new javax.swing.JButton();
+ jLabel2 = new javax.swing.JLabel();
+ textTime = new javax.swing.JTextField();
buttonScienta.setText("Scienta Panel");
buttonScienta.addActionListener(new java.awt.event.ActionListener() {
@@ -1919,6 +2017,11 @@ public class SIStem extends PanelProcessor {
}
});
+ jLabel2.setText("Acquisition Time:");
+
+ textTime.setEditable(false);
+ textTime.setHorizontalAlignment(javax.swing.JTextField.CENTER);
+
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
@@ -1931,6 +2034,10 @@ public class SIStem extends PanelProcessor {
.addComponent(buttonScienta)
.addGap(18, 18, 18)
.addComponent(buttonData)
+ .addGap(18, 18, Short.MAX_VALUE)
+ .addComponent(jLabel2)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(textTime, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonStart)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
@@ -1974,7 +2081,9 @@ public class SIStem extends PanelProcessor {
.addComponent(buttonScienta)
.addComponent(buttonStart)
.addComponent(buttonAbort)
- .addComponent(buttonData))
+ .addComponent(buttonData)
+ .addComponent(jLabel2)
+ .addComponent(textTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
);
}// //GEN-END:initComponents
@@ -2060,7 +2169,13 @@ public class SIStem extends PanelProcessor {
getView().getDocumentsTab().setSelectedComponent(tq);
}
if (currentFile != null) {
- tq.addNewFile(currentFile.getPath());
+
+ if (tq.getTableInfoCol()!=null){
+ tq.addNewFile(currentFile.getPath(), "", textTime.getText());
+ } else {
+ String args = (textTime.getText().isBlank()) ? "": "\"Time\":"+textTime.getText();
+ tq.addNewFile(currentFile.getPath(), args);
+ }
}
} catch (Exception ex) {
showException(ex);
@@ -2196,6 +2311,7 @@ public class SIStem extends PanelProcessor {
private javax.swing.JLabel jLabel17;
private javax.swing.JLabel jLabel18;
private javax.swing.JLabel jLabel19;
+ private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel20;
private javax.swing.JLabel jLabel21;
private javax.swing.JLabel jLabel22;
@@ -2252,6 +2368,7 @@ public class SIStem extends PanelProcessor {
private javax.swing.JTextArea textSnapshots;
private javax.swing.JTextField textStepEnergy;
private javax.swing.JTextField textStepThetaY;
+ private javax.swing.JTextField textTime;
private javax.swing.JTextField textXChannelMax;
private javax.swing.JTextField textXChannelMin;
private javax.swing.JTextField textYChannelMax;
diff --git a/script/local.py b/script/local.py
index b89878a..d98d53c 100644
--- a/script/local.py
+++ b/script/local.py
@@ -2,6 +2,7 @@
# Deployment specific global definitions - executed after startup.py
###################################################################################################
+
def get_additional_positioners():
ret = []
try:
@@ -299,8 +300,15 @@ def trigger_scienta():
"""
Trigger new acquisition
"""
- scienta.start()
- scienta.waitNewImage(-1)
+ #scienta.start()
+ #scienta.waitNewImage(-1)
+ if scienta.isSimulated():
+ time.sleep(0.1)
+ else:
+ image_id = scienta.currentImageCount
+ scienta.start()
+ scienta.waitReady(-1)
+ scienta.waitNewImage(3000, image_id)
def dummy_trigger_scienta():
@@ -355,3 +363,42 @@ def fit(ydata, xdata = None):
p.addMarker(max_x, None, "Max="+str(round(max_x,2)), Color.GRAY)
print "Invalid gaussian fit: " + str(mean)
return (None, None, None)
+
+
+def calc_acquisition_time(samples=1,exp=None, iter=None, images=None, mode=None, enl=None, enh=None, ens=None, tyl=None, tyh=None, tys=None, as_string=True):
+ if exp is None: exp = scienta.getExposure()
+ if iter is None: iter = scienta.getIterations()
+ if images is None: images = scienta.getNumImages()
+ if mode is None: mode = str(scienta.getAcquisitionMode())
+ if enl is None: enl = scienta.getLowEnergy().take()
+ if enh is None: enh = scienta.getHighEnergy().take()
+ if ens is None: ens = scienta.getEnergyStepSize().take()
+ if tyl is None: tyl = scienta.getLowThetaY().take()
+ if tyh is None: tyh = scienta.getHighThetaY().take()
+ if tys is None: tys = scienta.getThetaYStepSize().take()
+ pass_energy=float(scienta.getPassEnergy())
+
+ time_s = float(exp)*iter*images
+ if mode in ("Swept_Energy", "Swept_Energy_ThetaY"):
+ time_s = time_s * ((abs(enh - enl)+(pass_energy*0.08)) / ens + 3.0)
+ if mode in ("Swept_ThetaY", "Swept_Energy_ThetaY"):
+ time_s = time_s * (abs(tyh - tyl) / tys + 3.0)
+
+ time_s = time_s * samples
+ time_s = time_s + 1
+
+ if not as_string:
+ return time_s
+ #return time.strftime("%H:%M:%S" , time.gmtime(time_s))
+ dec= math.modf(time_s)[0]
+ hours = time_s // (60*60)
+ time_s %= (60*60)
+ minutes = time_s // 60
+ time_s %= 60
+ #if (hours==minutes==0) and (time_s<10) :
+ if (hours==minutes==time_s==0):
+ ret= "%0.3f" % (time_s)
+ else:
+ ret= "%02i:%02i:%02i" % (hours, minutes, time_s)
+ return ret
+
\ No newline at end of file
diff --git a/script/queues/test.que b/script/queues/test.que
index 117ac67..69ea4b2 100644
--- a/script/queues/test.que
+++ b/script/queues/test.que
@@ -1 +1 @@
-[ [ [ true, "/sls/X09LA/data/X09LA/pshell/home/parameters/Test1.ens", "", "Resume", "" ], [ true, "templates/EnergyScan.py", "\"FILE\":\"\", \"REGIONS\":[[523.0,527.0,2.0],[527.0,535.0,4.0],[535.0,558.0,2.0]], \"NAME\":\"tst\"", "Resume", "" ] ] ]
\ No newline at end of file
+[ [ [ true, "scans/test/nick.json", "\"Time\":2.500", "Resume", "Failure" ], [ false, "scans/test/nick2d.json", "", "Resume", "Disabled" ], [ true, "scans/test/nick.json", "", "Resume", "Success" ], [ true, "scans/test/nick.json", "", "Resume", "Failure" ], [ true, "scans/test/nick.json", "\"Time\":2.500", "Resume", "Success" ], [ true, "scans/test/scan2.json", "", "Resume", "Failure" ], [ true, "scans/test/scan2.json", "\"Time\":5.000", "Resume", "Success" ], [ true, "scans/test/scan2.json", "\"Time\":5.000", "Resume", "Failure" ] ] ]
\ No newline at end of file
diff --git a/script/queues/test2.que b/script/queues/test2.que
new file mode 100644
index 0000000..f635db0
--- /dev/null
+++ b/script/queues/test2.que
@@ -0,0 +1 @@
+[ [ ] ]
\ No newline at end of file
diff --git a/script/queues/test3.que b/script/queues/test3.que
new file mode 100644
index 0000000..792b3ec
--- /dev/null
+++ b/script/queues/test3.que
@@ -0,0 +1 @@
+[ [ [ true, "scans/test/nick2d.json", "", "Resume", "Failure", "00:00:12" ], [ true, "scans/test/nick2d.json", "", "Resume", "Failure", "00:00:12" ], [ true, "scans/test/test.json", "", "Resume", "Failure", "00:00:01" ] ] ]
\ No newline at end of file
diff --git a/script/queues/test4.que b/script/queues/test4.que
new file mode 100644
index 0000000..ebeeb37
--- /dev/null
+++ b/script/queues/test4.que
@@ -0,0 +1 @@
+[ [ [ true, "scans/test/test.json", "", "Resume", "", "00:00:01" ], [ true, "scans/test/test.json", "", "Resume", "", "00:00:01" ] ] ]
\ No newline at end of file
diff --git a/script/scans/test/nick.json b/script/scans/test/nick.json
new file mode 100644
index 0000000..3258503
--- /dev/null
+++ b/script/scans/test/nick.json
@@ -0,0 +1,29 @@
+{
+ "PASSES" : 1,
+ "STOP" : [ 1.0 ],
+ "DIAGS" : [ "phi", "theta", "tilt", "x", "y", "z" ],
+ "PRE_ACTIONS" : {
+ "scienta.passEnergyDev" : "10",
+ "scienta.acquisitionModeDev" : "Fixed",
+ "scienta.energyModeDev" : "Kinetic",
+ "scienta.lensModeDev" : "A30L_01",
+ "scienta.detectorModeDev" : "ADC",
+ "scienta.lowEnergy" : 33.0,
+ "scienta.centerEnergy" : 34.5,
+ "scienta.highEnergy" : 35.0,
+ "scienta.energyStepSize" : 0.005,
+ "scienta.centerThetaX" : 0.0,
+ "scienta.slices" : 601,
+ "scienta.channels" : 801
+ },
+ "COMPRESSION" : true,
+ "SENSORS" : [ "scienta.dataMatrix", "current" ],
+ "ZIGZAG" : false,
+ "SETTLING_TIME" : 0.0,
+ "MONITORS" : [ "current" ],
+ "START" : [ 0.0 ],
+ "RANGE" : [ 900, 100, 750, 150 ],
+ "POSITIONERS" : [ "x" ],
+ "STEPS" : [ 9 ],
+ "SNAPS" : [ "acmi", "cff", "energy", "exit_slit", "fe_horiz_width", "fe_vert_width", "helium_valve", "master", "pgm_cff", "photon_energy", "tcmp", "temp_boot1", "temp_boot2", "temp_cryopump", "temp_cryostat", "temp_headmech", "temp_sample1", "temp_sample2", "temp_shield" ]
+}
\ No newline at end of file
diff --git a/script/scans/test/nick2d.json b/script/scans/test/nick2d.json
new file mode 100644
index 0000000..0da0598
--- /dev/null
+++ b/script/scans/test/nick2d.json
@@ -0,0 +1,29 @@
+{
+ "PASSES" : 1,
+ "STOP" : [ 1.0, 1.0 ],
+ "DIAGS" : [ "phi", "theta", "tilt", "x", "y", "z" ],
+ "PRE_ACTIONS" : {
+ "scienta.passEnergyDev" : "10",
+ "scienta.acquisitionModeDev" : "Fixed",
+ "scienta.energyModeDev" : "Kinetic",
+ "scienta.lensModeDev" : "A30L_01",
+ "scienta.detectorModeDev" : "ADC",
+ "scienta.lowEnergy" : 33.0,
+ "scienta.centerEnergy" : 34.5,
+ "scienta.highEnergy" : 35.0,
+ "scienta.energyStepSize" : 0.005,
+ "scienta.centerThetaX" : 0.0,
+ "scienta.slices" : 601,
+ "scienta.channels" : 801
+ },
+ "COMPRESSION" : true,
+ "SENSORS" : [ "scienta.dataMatrix", "current" ],
+ "ZIGZAG" : false,
+ "SETTLING_TIME" : 0.0,
+ "MONITORS" : [ "current" ],
+ "START" : [ 0.0, 0.0 ],
+ "RANGE" : [ 900, 100, 750, 150 ],
+ "POSITIONERS" : [ "x", "y" ],
+ "STEPS" : [ 4, 4 ],
+ "SNAPS" : [ "acmi", "cff", "energy", "exit_slit", "fe_horiz_width", "fe_vert_width", "helium_valve", "master", "pgm_cff", "photon_energy", "tcmp", "temp_boot1", "temp_boot2", "temp_cryopump", "temp_cryostat", "temp_headmech", "temp_sample1", "temp_sample2", "temp_shield" ]
+}
\ No newline at end of file
diff --git a/script/scans/test/scan1.json b/script/scans/test/scan1.json
index 6e32354..6324ee3 100644
--- a/script/scans/test/scan1.json
+++ b/script/scans/test/scan1.json
@@ -1,25 +1,16 @@
{
"PASSES" : 1,
- "STOP" : [ 1.0 ],
+ "STOP" : [ ],
"DIAGS" : [ "phi", "theta", "tilt", "x", "y", "z" ],
- "PRE_ACTIONS" : {
- "scienta.passEnergyDev" : "20",
- "scienta.acquisitionModeDev" : "Fixed",
- "scienta.energyModeDev" : "Kinetic",
- "scienta.lensModeDev" : "Transmission",
- "scienta.detectorModeDev" : "ADC",
- "scienta.slices" : 512,
- "scienta.channels" : 512,
- "y" : 0.1
- },
+ "PRE_ACTIONS" : { },
"COMPRESSION" : true,
- "SENSORS" : [ "scienta.dataMatrix", "keithley11" ],
- "ZIGZAG" : true,
+ "SENSORS" : [ "scienta.dataMatrix" ],
+ "ZIGZAG" : false,
"SETTLING_TIME" : 0.0,
"MONITORS" : [ "current" ],
- "START" : [ 0.0 ],
+ "START" : [ ],
"RANGE" : [ null, null, null, null ],
- "POSITIONERS" : [ "x" ],
- "STEPS" : [ 9 ],
- "SNAPS" : [ "acmi", "energy", "exit_slit", "fe_horiz_width", "fe_vert_width", "helium_valve", "master", "tcmp", "temp_boot1", "temp_boot2", "temp_cryopump", "temp_cryostat", "temp_headmech", "temp_sample1", "temp_sample2", "temp_shield" ]
+ "POSITIONERS" : [ ],
+ "STEPS" : [ ],
+ "SNAPS" : [ "acmi", "cff", "energy", "exit_slit", "fe_horiz_width", "fe_vert_width", "helium_valve", "master", "pgm_cff", "photon_energy", "tcmp", "temp_boot1", "temp_boot2", "temp_cryopump", "temp_cryostat", "temp_headmech", "temp_sample1", "temp_sample2", "temp_shield" ]
}
\ No newline at end of file
diff --git a/script/scans/test/test.json b/script/scans/test/test.json
index 42b9d34..6b5465c 100644
--- a/script/scans/test/test.json
+++ b/script/scans/test/test.json
@@ -2,9 +2,7 @@
"PASSES" : 1,
"STOP" : [ ],
"DIAGS" : [ "phi", "theta", "tilt", "x", "y", "z" ],
- "PRE_ACTIONS" : {
- "scienta.lensModeDev" : "A14_08"
- },
+ "PRE_ACTIONS" : { },
"COMPRESSION" : true,
"SENSORS" : [ "scienta.dataMatrix" ],
"ZIGZAG" : false,
diff --git a/script/templates/SIStem.py b/script/templates/SIStem.py
index 6f48543..e69b268 100644
--- a/script/templates/SIStem.py
+++ b/script/templates/SIStem.py
@@ -1,5 +1,6 @@
from collections import OrderedDict
-
+time.sleep(2.0)
+1/0
#Debugging
if get_exec_pars().args is None:
PRE_ACTIONS = {z:0.1}
@@ -77,11 +78,19 @@ if COMPRESSION:
def before_read(pos, scan):
trigger_scienta()
-
-def after_read(rec, scan):
- #handle_diagnostics(rec)
- pass
+data_3d = (scienta.dataMatrix in sensors) and (str(scienta.getAcquisitionMode())=="Swept_Energy_ThetaY")
+def after_read(rec, scan):
+ global data_3d
+ #handle_diagnostics(rec)
+ #data_3d = (scienta.dataMatrix in sensors) and (scienta.arraySize2.read()>1)
+ if data_3d:
+ try:
+ path = get_exec_pars().scanPath + ("/3d_images/%04d" % rec.index)
+ data = scienta.takeStack()
+ save_dataset(path, data)
+ except:
+ log(sys.exc_info()[1])
try:
if len(positioners)==0:
ret= tscan (sensors, 1,0, passes=passes, \