sardana-nxsrecorder 3.19.0__py3-none-any.whl → 3.20.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.
- {sardana_nxsrecorder-3.19.0.dist-info → sardana_nxsrecorder-3.20.0.dist-info}/METADATA +4 -1
- sardana_nxsrecorder-3.20.0.dist-info/RECORD +6 -0
- sardananxsrecorder/__init__.py +1 -1
- sardananxsrecorder/nxsrecorder.py +55 -0
- sardana_nxsrecorder-3.19.0.dist-info/RECORD +0 -6
- {sardana_nxsrecorder-3.19.0.dist-info → sardana_nxsrecorder-3.20.0.dist-info}/WHEEL +0 -0
- {sardana_nxsrecorder-3.19.0.dist-info → sardana_nxsrecorder-3.20.0.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sardana-nxsrecorder
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.20.0
|
|
4
4
|
Summary: NeXus Sardana Scan Recorder
|
|
5
5
|
Home-page: https://github.com/nexdatas/sardana-nxs-filerecorder/
|
|
6
6
|
Author: Jan Kotanski
|
|
@@ -247,3 +247,6 @@ The NeXus file recorder uses the following sardana environment variables
|
|
|
247
247
|
* **SciCatDatasetListFileLocal** *(bool)* - add the hostname to the scicat dataset list file extension, default: ``False``
|
|
248
248
|
* **SciCatAutoGrouping** *(bool)* - group all scans with the measurement name set to the base scan filename, default: ``False``
|
|
249
249
|
* **MetadataScript** *(str)* - a python module file name containing ``main()`` which provides a dictionary with user metadata stored in the INIT mode, default: ``""``
|
|
250
|
+
* **ScicatMeasurements** *(dict)* - a dictionary of measurement names indexed by ``ScanDir`` and used by ``scingestor``, default: ``{}``
|
|
251
|
+
* **CreateMeasurementFile** *(bool)* - create a measurement file with its filename releated to ``ScicatMeasurements`` or ``ScanFile``, default: ``False``
|
|
252
|
+
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
sardananxsrecorder/__init__.py,sha256=qCNV0aQdC8ohuF2JgGo7uBXYvYjAK526JuafDfEQMWY,896
|
|
2
|
+
sardananxsrecorder/nxsrecorder.py,sha256=xVjPC7eVFpuilKfExOvbTjKECOXH9USDJXIxQknVtHY,52738
|
|
3
|
+
sardana_nxsrecorder-3.20.0.dist-info/METADATA,sha256=Lsdfz2ISL5AcIPCehARWC0fVEtw8cu55YjfjTBLi2HE,7565
|
|
4
|
+
sardana_nxsrecorder-3.20.0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
|
5
|
+
sardana_nxsrecorder-3.20.0.dist-info/top_level.txt,sha256=YdD3m417i-jlYyQWgiizgZ8lQQcOjM8y-bmUHrGkfY4,19
|
|
6
|
+
sardana_nxsrecorder-3.20.0.dist-info/RECORD,,
|
sardananxsrecorder/__init__.py
CHANGED
|
@@ -35,6 +35,15 @@ try:
|
|
|
35
35
|
except Exception:
|
|
36
36
|
import PyTango as tango
|
|
37
37
|
|
|
38
|
+
try:
|
|
39
|
+
NXSWRITER = True
|
|
40
|
+
try:
|
|
41
|
+
from nxstools import h5cppwriter as h5writer
|
|
42
|
+
except Exception:
|
|
43
|
+
from nxstools import h5pywriter as h5writer
|
|
44
|
+
except Exception:
|
|
45
|
+
NXSWRITER = False
|
|
46
|
+
|
|
38
47
|
|
|
39
48
|
from sardana.macroserver.scan.recorder.storage import BaseFileRecorder
|
|
40
49
|
|
|
@@ -1157,6 +1166,9 @@ class NXS_FileRecorder(BaseFileRecorder):
|
|
|
1157
1166
|
vl = self.__getEnvVar("NXSAppendSciCatDataset", None)
|
|
1158
1167
|
if vl:
|
|
1159
1168
|
self.__appendSciCatDataset(vl)
|
|
1169
|
+
cmf = self.__getEnvVar("CreateMeasurementFile", False)
|
|
1170
|
+
if cmf and NXSWRITER:
|
|
1171
|
+
self.__createMeasurementFile()
|
|
1160
1172
|
|
|
1161
1173
|
def beamtime_id(self, bmtfpath, bmtfprefix, bmtfext):
|
|
1162
1174
|
""" code for beamtimeid datasource
|
|
@@ -1227,6 +1239,7 @@ class NXS_FileRecorder(BaseFileRecorder):
|
|
|
1227
1239
|
|
|
1228
1240
|
# auto grouping
|
|
1229
1241
|
grouping = bool(self.__getEnvVar('SciCatAutoGrouping', False))
|
|
1242
|
+
|
|
1230
1243
|
if grouping:
|
|
1231
1244
|
commands = []
|
|
1232
1245
|
try:
|
|
@@ -1254,6 +1267,48 @@ class NXS_FileRecorder(BaseFileRecorder):
|
|
|
1254
1267
|
with open(dslfile, "a+") as fl:
|
|
1255
1268
|
fl.write("\n%s" % sname)
|
|
1256
1269
|
|
|
1270
|
+
def __createMeasurementFile(self):
|
|
1271
|
+
""" create measurement file """
|
|
1272
|
+
|
|
1273
|
+
fdir, fname = os.path.split(self.filename)
|
|
1274
|
+
_, bfname = os.path.split(self.__base_filename)
|
|
1275
|
+
sname, fext = os.path.splitext(fname)
|
|
1276
|
+
# beamtimeid = self.beamtimeid()
|
|
1277
|
+
|
|
1278
|
+
try:
|
|
1279
|
+
scanname, _ = os.path.splitext(bfname % "")
|
|
1280
|
+
except Exception:
|
|
1281
|
+
scanname, _ = os.path.splitext(bfname)
|
|
1282
|
+
|
|
1283
|
+
try:
|
|
1284
|
+
sm = dict(self.__getEnvVar('SciCatMeasurements', {}))
|
|
1285
|
+
except Exception:
|
|
1286
|
+
sm = {}
|
|
1287
|
+
|
|
1288
|
+
entryname = "scan"
|
|
1289
|
+
appendentry = self.__getConfVar("AppendEntry", False)
|
|
1290
|
+
variables = self.__getConfVar("ConfigVariables", None, True)
|
|
1291
|
+
if isinstance(variables, dict) and "entryname" in variables:
|
|
1292
|
+
entryname = variables["entryname"]
|
|
1293
|
+
|
|
1294
|
+
mntname = scanname
|
|
1295
|
+
if fdir in sm.keys() and sm[fdir]:
|
|
1296
|
+
mntname = sm[fdir]
|
|
1297
|
+
if not appendentry or mntname != scanname:
|
|
1298
|
+
mntfile = os.path.join(fdir, mntname + fext)
|
|
1299
|
+
|
|
1300
|
+
if not os.path.exists(mntfile):
|
|
1301
|
+
fl = h5writer.create_file(mntfile)
|
|
1302
|
+
self.info("Measurement file '%s' created " % mntname)
|
|
1303
|
+
else:
|
|
1304
|
+
fl = h5writer.open_file(mntfile, readonly=False)
|
|
1305
|
+
rt = fl.root()
|
|
1306
|
+
if sname not in rt.names():
|
|
1307
|
+
h5writer.link("%s:/%s" % (self.filename, entryname), rt, sname)
|
|
1308
|
+
self.debug("Link '%s' in '%s' created " % (sname, mntname))
|
|
1309
|
+
rt.close()
|
|
1310
|
+
fl.close()
|
|
1311
|
+
|
|
1257
1312
|
def _addCustomData(self, value, name, group="data", remove=False,
|
|
1258
1313
|
**kwargs):
|
|
1259
1314
|
""" adds custom data to configuration variables, i.e. from macros
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
sardananxsrecorder/__init__.py,sha256=rLcTXm_38KYJIRnRCt1AfVFOQ2GhZpYWKK2oUylp-Pk,896
|
|
2
|
-
sardananxsrecorder/nxsrecorder.py,sha256=uzkFUa_-wU56pNyo_EAp-cV5eC-W4O4psOh9nO-NHKA,50834
|
|
3
|
-
sardana_nxsrecorder-3.19.0.dist-info/METADATA,sha256=MVRRZwJnbuW2_JkreByCSKsrdZY-ogqzfTMXjpzp6L0,7269
|
|
4
|
-
sardana_nxsrecorder-3.19.0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
|
5
|
-
sardana_nxsrecorder-3.19.0.dist-info/top_level.txt,sha256=YdD3m417i-jlYyQWgiizgZ8lQQcOjM8y-bmUHrGkfY4,19
|
|
6
|
-
sardana_nxsrecorder-3.19.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|