sardana-nxsrecorder 3.22.0__py3-none-any.whl → 3.23.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sardana-nxsrecorder
3
- Version: 3.22.0
3
+ Version: 3.23.0
4
4
  Summary: NeXus Sardana Scan Recorder
5
5
  Home-page: https://github.com/nexdatas/sardana-nxs-filerecorder/
6
6
  Author: Jan Kotanski
@@ -236,6 +236,8 @@ The NeXus file recorder uses the following sardana environment variables
236
236
 
237
237
  * **ActiveMntGrp** *(str)* - active measurement group
238
238
  * **ScanID** *(int)* - the last scan identifier number, default: ``-1``
239
+ * **ScanDir** *(str)* - the scan directory
240
+ * **ScanFile** *(list)* - a list of scan files
239
241
  * **NeXusSelectorDevice** *(str)* - NXSRecSelector tango device if more installed, otherwise first one found
240
242
 
241
243
  * **NXSAppendSciCatDataset** *(bool)* - append scan name to scicat dataset list file, default: ``False``
@@ -249,4 +251,5 @@ The NeXus file recorder uses the following sardana environment variables
249
251
  * **MetadataScript** *(str)* - a python module file name containing ``main()`` which provides a dictionary with user metadata stored in the INIT mode, default: ``""``
250
252
  * **ScicatMeasurements** *(dict)* - a dictionary of measurement names indexed by ``ScanDir`` and used by ``scingestor``, default: ``{}``
251
253
  * **CreateMeasurementFile** *(bool)* - create a measurement file with its filename releated to ``ScicatMeasurements`` or ``ScanFile``, default: ``False``
254
+ * **NeXusSkipAcquisitionModes** *(list)* - a list of strategy modes for which acquisition is skip
252
255
 
@@ -0,0 +1,6 @@
1
+ sardananxsrecorder/__init__.py,sha256=O9h2gzx1FiXbkHFd9NliK_0e85u2JA-f9k6zTeVMkLI,896
2
+ sardananxsrecorder/nxsrecorder.py,sha256=EvZfHZQjjbJIrdwG45mDLmvNSyN1G-rdKCFKHY9lifI,56598
3
+ sardana_nxsrecorder-3.23.0.dist-info/METADATA,sha256=ub3XFGmi9fxleiiirGulzNeSSXvDAADqDkbhQCOyEQI,7754
4
+ sardana_nxsrecorder-3.23.0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
5
+ sardana_nxsrecorder-3.23.0.dist-info/top_level.txt,sha256=YdD3m417i-jlYyQWgiizgZ8lQQcOjM8y-bmUHrGkfY4,19
6
+ sardana_nxsrecorder-3.23.0.dist-info/RECORD,,
@@ -20,4 +20,4 @@
20
20
  """ Sardana Scan Recorders """
21
21
 
22
22
  #: package version
23
- __version__ = "3.22.0"
23
+ __version__ = "3.23.0"
@@ -155,6 +155,9 @@ class NXS_FileRecorder(BaseFileRecorder):
155
155
  #: (:obj:`dict` <:obj:`str` , :obj:`str`>) NeXus configuration
156
156
  self.__conf = {}
157
157
 
158
+ #: (:obj:`list` <:obj:`str`>) skip Acquisition Modes
159
+ self.skipAcquisitionModes = []
160
+
158
161
  #: (:obj:`dict` <:obj:`str` , `any`>) User data
159
162
  self.__udata = None
160
163
 
@@ -1020,6 +1023,10 @@ class NXS_FileRecorder(BaseFileRecorder):
1020
1023
  # self.debug('START_DATA: %s' % str(envRec))
1021
1024
 
1022
1025
  self.__nexuswriter_device.jsonrecord = rec
1026
+ self.skipAcquisitionModes = self.__skipAcquisitionModes()
1027
+ if "INIT" in self.skipAcquisitionModes:
1028
+ self.__nexuswriter_device.skipAcquisition = True
1029
+
1023
1030
  self.__command(self.__nexuswriter_device, "openEntry")
1024
1031
  except Exception:
1025
1032
  self.__removeDynamicComponent()
@@ -1106,6 +1113,8 @@ class NXS_FileRecorder(BaseFileRecorder):
1106
1113
  rec = json.dumps(
1107
1114
  envrecord, cls=NXS_FileRecorder.numpyEncoder)
1108
1115
  self.__nexuswriter_device.jsonrecord = rec
1116
+ if "STEP" in self.skipAcquisitionModes:
1117
+ self.__nexuswriter_device.skipAcquisition = True
1109
1118
 
1110
1119
  # self.debug('DATA: {"data":%s}' % json.dumps(
1111
1120
  # record.data,
@@ -1174,6 +1183,8 @@ class NXS_FileRecorder(BaseFileRecorder):
1174
1183
  rec = json.dumps(
1175
1184
  envrecord, cls=NXS_FileRecorder.numpyEncoder)
1176
1185
  self.__nexuswriter_device.jsonrecord = rec
1186
+ if "FINAL" in self.skipAcquisitionModes:
1187
+ self.__nexuswriter_device.skipAcquisition = True
1177
1188
  self.__command(self.__nexuswriter_device, "closeEntry")
1178
1189
  self.__command(self.__nexuswriter_device, "closeFile")
1179
1190
  except Exception:
@@ -1220,6 +1231,19 @@ class NXS_FileRecorder(BaseFileRecorder):
1220
1231
  beamtimeid = self.beamtime_id(bmtfpath, bmtfprefix, bmtfext)
1221
1232
  return beamtimeid or "00000000"
1222
1233
 
1234
+ def __skipAcquisitionModes(self):
1235
+ """ find skip acquisition modes
1236
+ """
1237
+ try:
1238
+ skip_acq = self.__macro().getEnv('NeXusSkipAcquisitionModes')
1239
+ except Exception:
1240
+ skip_acq = []
1241
+ if isinstance(skip_acq, str):
1242
+ skip_acq = re.split(r"[-;,.\s]\s*", skip_acq)
1243
+ if skip_acq:
1244
+ self.debug('Skip Acquisition Modes: %s' % str(skip_acq))
1245
+ return skip_acq
1246
+
1223
1247
  def __rawfilename(self, serial):
1224
1248
  """ find scan name
1225
1249
  """
@@ -1309,6 +1333,8 @@ class NXS_FileRecorder(BaseFileRecorder):
1309
1333
  sid = self.__vars["vars"]["scan_id"]
1310
1334
  sname = "%s::/%s_%05i;%s_%05i" % (
1311
1335
  scanname, entryname, sid, scanname, sid)
1336
+ if "INIT" in self.skipAcquisitionModes:
1337
+ sname = "%s:%s" % (sname, time.time())
1312
1338
 
1313
1339
  # auto grouping
1314
1340
  grouping = bool(self.__getEnvVar('SciCatAutoGrouping', False))
@@ -1370,7 +1396,6 @@ class NXS_FileRecorder(BaseFileRecorder):
1370
1396
  "{ScanID" not in self.__raw_filename:
1371
1397
  sname = sname + ("_%05i" % sid)
1372
1398
  entryname = entryname + ("_%05i" % sid)
1373
-
1374
1399
  mntname = scanname
1375
1400
  if fdir in sm.keys() and sm[fdir]:
1376
1401
  mntname = sm[fdir]
@@ -1,6 +0,0 @@
1
- sardananxsrecorder/__init__.py,sha256=gUu5k6aJRyRksDS_IRn8O6fVbNsgLNZVeuowa4MISt4,896
2
- sardananxsrecorder/nxsrecorder.py,sha256=ypWSER8Y-DiWs8KPf81EBxjYD0LtL5Iw6kJMAXj7j9I,55536
3
- sardana_nxsrecorder-3.22.0.dist-info/METADATA,sha256=m8tvcIFVtkqFb5RHHpXcicV-UvudHoTUXNaiADVdm3o,7566
4
- sardana_nxsrecorder-3.22.0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
5
- sardana_nxsrecorder-3.22.0.dist-info/top_level.txt,sha256=YdD3m417i-jlYyQWgiizgZ8lQQcOjM8y-bmUHrGkfY4,19
6
- sardana_nxsrecorder-3.22.0.dist-info/RECORD,,