sardana-nxsrecorder 3.22.0__py3-none-any.whl → 3.24.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.24.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,6 @@ 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
255
+ * **NeXusWriterProperties** *(dict)* - a dictionary of TangoDataWriter (NXSDataWriter) properties (starting with a small letter)
252
256
 
@@ -0,0 +1,6 @@
1
+ sardananxsrecorder/__init__.py,sha256=hMiS-40RFpQGJHFLwDY7Sy0gsO6e8bykEjdo-YgNxmY,896
2
+ sardananxsrecorder/nxsrecorder.py,sha256=bVa7W85rxWLvHttxK5zaXZrZRvUka8ZCfHHmT65tbyE,57212
3
+ sardana_nxsrecorder-3.24.0.dist-info/METADATA,sha256=FonANvw1tfIiizSe_R104MF6D8Q5hJj03Y8dgi7035k,7883
4
+ sardana_nxsrecorder-3.24.0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
5
+ sardana_nxsrecorder-3.24.0.dist-info/top_level.txt,sha256=YdD3m417i-jlYyQWgiizgZ8lQQcOjM8y-bmUHrGkfY4,19
6
+ sardana_nxsrecorder-3.24.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.24.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
 
@@ -540,6 +543,18 @@ class NXS_FileRecorder(BaseFileRecorder):
540
543
  if self.__nexuswriter_device is None:
541
544
  from nxswriter import TangoDataWriter
542
545
  self.__nexuswriter_device = TangoDataWriter.TangoDataWriter()
546
+ try:
547
+ properties = dict(
548
+ self.__getEnvVar("NeXusWriterProperties", {}))
549
+ except Exception as e:
550
+ self.warning(
551
+ "Cannot load NeXusWriterProperties %s" % (str(e)))
552
+ self.__macro().warning(
553
+ "Cannot load NeXusWriterProperties %s" % (str(e)))
554
+ properties = {}
555
+ for ky, vl in properties.items():
556
+ if hasattr(self.__nexuswriter_device, ky):
557
+ setattr(self.__nexuswriter_device, ky, vl)
543
558
 
544
559
  def __get_alias(self, name):
545
560
  """ provides a device alias
@@ -1020,6 +1035,10 @@ class NXS_FileRecorder(BaseFileRecorder):
1020
1035
  # self.debug('START_DATA: %s' % str(envRec))
1021
1036
 
1022
1037
  self.__nexuswriter_device.jsonrecord = rec
1038
+ self.skipAcquisitionModes = self.__skipAcquisitionModes()
1039
+ if "INIT" in self.skipAcquisitionModes:
1040
+ self.__nexuswriter_device.skipAcquisition = True
1041
+
1023
1042
  self.__command(self.__nexuswriter_device, "openEntry")
1024
1043
  except Exception:
1025
1044
  self.__removeDynamicComponent()
@@ -1106,6 +1125,8 @@ class NXS_FileRecorder(BaseFileRecorder):
1106
1125
  rec = json.dumps(
1107
1126
  envrecord, cls=NXS_FileRecorder.numpyEncoder)
1108
1127
  self.__nexuswriter_device.jsonrecord = rec
1128
+ if "STEP" in self.skipAcquisitionModes:
1129
+ self.__nexuswriter_device.skipAcquisition = True
1109
1130
 
1110
1131
  # self.debug('DATA: {"data":%s}' % json.dumps(
1111
1132
  # record.data,
@@ -1174,6 +1195,8 @@ class NXS_FileRecorder(BaseFileRecorder):
1174
1195
  rec = json.dumps(
1175
1196
  envrecord, cls=NXS_FileRecorder.numpyEncoder)
1176
1197
  self.__nexuswriter_device.jsonrecord = rec
1198
+ if "FINAL" in self.skipAcquisitionModes:
1199
+ self.__nexuswriter_device.skipAcquisition = True
1177
1200
  self.__command(self.__nexuswriter_device, "closeEntry")
1178
1201
  self.__command(self.__nexuswriter_device, "closeFile")
1179
1202
  except Exception:
@@ -1220,6 +1243,19 @@ class NXS_FileRecorder(BaseFileRecorder):
1220
1243
  beamtimeid = self.beamtime_id(bmtfpath, bmtfprefix, bmtfext)
1221
1244
  return beamtimeid or "00000000"
1222
1245
 
1246
+ def __skipAcquisitionModes(self):
1247
+ """ find skip acquisition modes
1248
+ """
1249
+ try:
1250
+ skip_acq = self.__macro().getEnv('NeXusSkipAcquisitionModes')
1251
+ except Exception:
1252
+ skip_acq = []
1253
+ if isinstance(skip_acq, str):
1254
+ skip_acq = re.split(r"[-;,.\s]\s*", skip_acq)
1255
+ if skip_acq:
1256
+ self.debug('Skip Acquisition Modes: %s' % str(skip_acq))
1257
+ return skip_acq
1258
+
1223
1259
  def __rawfilename(self, serial):
1224
1260
  """ find scan name
1225
1261
  """
@@ -1309,6 +1345,8 @@ class NXS_FileRecorder(BaseFileRecorder):
1309
1345
  sid = self.__vars["vars"]["scan_id"]
1310
1346
  sname = "%s::/%s_%05i;%s_%05i" % (
1311
1347
  scanname, entryname, sid, scanname, sid)
1348
+ if "INIT" in self.skipAcquisitionModes:
1349
+ sname = "%s:%s" % (sname, time.time())
1312
1350
 
1313
1351
  # auto grouping
1314
1352
  grouping = bool(self.__getEnvVar('SciCatAutoGrouping', False))
@@ -1370,7 +1408,6 @@ class NXS_FileRecorder(BaseFileRecorder):
1370
1408
  "{ScanID" not in self.__raw_filename:
1371
1409
  sname = sname + ("_%05i" % sid)
1372
1410
  entryname = entryname + ("_%05i" % sid)
1373
-
1374
1411
  mntname = scanname
1375
1412
  if fdir in sm.keys() and sm[fdir]:
1376
1413
  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,,