sardana-nxsrecorder 3.21.0__tar.gz → 3.22.0__tar.gz
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.21.0 → sardana-nxsrecorder-3.22.0}/ChangeLog +8 -0
- {sardana-nxsrecorder-3.21.0/sardana_nxsrecorder.egg-info → sardana-nxsrecorder-3.22.0}/PKG-INFO +1 -1
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/man/sardananxsrecorder.1 +26 -18
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0/sardana_nxsrecorder.egg-info}/PKG-INFO +1 -1
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/sardananxsrecorder/__init__.py +1 -1
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/sardananxsrecorder/nxsrecorder.py +109 -33
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/.ci/debian10_py2/Dockerfile +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/.ci/debian10_py3/Dockerfile +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/.ci/debian8_py2/Dockerfile +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/.ci/debian8_py3/Dockerfile +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/.ci/debian9_py2/Dockerfile +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/.ci/debian9_py3/Dockerfile +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/.ci/install.sh +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/.ci/run.sh +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/.ci/ubuntu16.04_py2/Dockerfile +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/.ci/ubuntu16.04_py3/Dockerfile +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/.ci/ubuntu18.04_py2/Dockerfile +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/.ci/ubuntu18.04_py3/Dockerfile +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/.ci/ubuntu20.04_py3/Dockerfile +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/.flake8 +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/.github/workflows/tests.yml +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/.gitignore +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/COPYRIGHT +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/MANIFEST.in +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/README.rst +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/doc/Makefile +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/doc/conf.py +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/doc/index.rst +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/doc/make.bat +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/doc/sardananxsrecorder.rst +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/sardana_nxsrecorder.egg-info/SOURCES.txt +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/sardana_nxsrecorder.egg-info/dependency_links.txt +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/sardana_nxsrecorder.egg-info/not-zip-safe +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/sardana_nxsrecorder.egg-info/requires.txt +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/sardana_nxsrecorder.egg-info/top_level.txt +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/setup.cfg +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/setup.py +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/test/__init__.py +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/test/__main__.py +0 -0
- {sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/test/main.py +0 -0
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
2024-06-03 Jan Kotanski <jankotan@gmail.com>
|
|
2
|
+
* improve support for ScanFile formating wih _%05d and _{ScanID:05d} (#114)
|
|
3
|
+
* tagged as 3.22.0
|
|
4
|
+
|
|
5
|
+
2024-05-23 Jan Kotanski <jankotan@gmail.com>
|
|
6
|
+
* replace deprecated tz.localize() with datetime.replace() (#111)
|
|
7
|
+
* tagged as 3.21.1
|
|
8
|
+
|
|
1
9
|
2024-05-22 Jan Kotanski <jankotan@gmail.com>
|
|
2
10
|
* improve support for creating measurement files in appendentry mode (#108)
|
|
3
11
|
* change entryname in the appendentry mode to '%s_%05i' (#108)
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
.\" Man page generated from reStructuredText.
|
|
2
2
|
.
|
|
3
|
-
.TH "SARDANANXSRECORDER" "1" "Nov 09, 2022" "3.12" "Sardana NeXus Recorder"
|
|
4
|
-
.SH NAME
|
|
5
|
-
sardananxsrecorder \- sardananxsrecorder Documentation
|
|
6
3
|
.
|
|
7
4
|
.nr rst2man-indent-level 0
|
|
8
5
|
.
|
|
@@ -30,6 +27,9 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
|
|
30
27
|
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
|
31
28
|
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
|
|
32
29
|
..
|
|
30
|
+
.TH "SARDANANXSRECORDER" "1" "Jun 03, 2024" "3.22" "Sardana NeXus Recorder"
|
|
31
|
+
.SH NAME
|
|
32
|
+
sardananxsrecorder \- sardananxsrecorder Documentation
|
|
33
33
|
.sp
|
|
34
34
|
\fI\%\fP
|
|
35
35
|
\fI\%\fP
|
|
@@ -79,7 +79,7 @@ defining the package location, e.g.
|
|
|
79
79
|
.sp
|
|
80
80
|
.SS Debian packages
|
|
81
81
|
.sp
|
|
82
|
-
Debian Bookworm, Bullseye, Buster and Ubuntu Lunar, Jammy
|
|
82
|
+
Debian Bookworm, Bullseye, Buster and Ubuntu Lunar, Jammy and Focal packages can be found in the HDRI repository.
|
|
83
83
|
.sp
|
|
84
84
|
To install the debian packages, add the PGP repository key
|
|
85
85
|
.INDENT 0.0
|
|
@@ -330,17 +330,25 @@ The NeXus file recorder uses the following sardana environment variables
|
|
|
330
330
|
.IP \(bu 2
|
|
331
331
|
\fBNXSAppendSciCatDataset\fP \fI(bool)\fP \- append scan name to scicat dataset list file, default: \fBFalse\fP
|
|
332
332
|
.IP \(bu 2
|
|
333
|
-
\fBBeamtimeFilePath\fP \fI(str)\fP \- beamtime file path to search beamtime metadata file, default: \fB
|
|
333
|
+
\fBBeamtimeFilePath\fP \fI(str)\fP \- beamtime file path to search beamtime metadata file, default: \fB\(dq/gpfs/current\(dq\fP
|
|
334
334
|
.IP \(bu 2
|
|
335
|
-
\fBBeamtimeFilePrefix\fP \fI(str)\fP \- beamtime metadata file prefix, default: \fB
|
|
335
|
+
\fBBeamtimeFilePrefix\fP \fI(str)\fP \- beamtime metadata file prefix, default: \fB\(dqbeamtime\-metadata\-\(dq\fP
|
|
336
336
|
.IP \(bu 2
|
|
337
|
-
\fBBeamtimeFileExt\fP \fI(str)\fP \- beamtime metadata file extension, default: \fB
|
|
337
|
+
\fBBeamtimeFileExt\fP \fI(str)\fP \- beamtime metadata file extension, default: \fB\(dq.json\(dq\fP
|
|
338
338
|
.IP \(bu 2
|
|
339
|
-
\fBSciCatDatasetListFilePrefix\fP \fI(str)\fP \- scicat dataset list file prefix, default: \fB
|
|
339
|
+
\fBSciCatDatasetListFilePrefix\fP \fI(str)\fP \- scicat dataset list file prefix, default: \fB\(dqscicat\-datasets\-\(dq\fP
|
|
340
340
|
.IP \(bu 2
|
|
341
|
-
\fBSciCatDatasetListFileExt\fP \fI(str)\fP \- scicat dataset list file extension, default: \fB
|
|
341
|
+
\fBSciCatDatasetListFileExt\fP \fI(str)\fP \- scicat dataset list file extension, default: \fB\(dq.lst\(dq\fP
|
|
342
342
|
.IP \(bu 2
|
|
343
343
|
\fBSciCatDatasetListFileLocal\fP \fI(bool)\fP \- add the hostname to the scicat dataset list file extension, default: \fBFalse\fP
|
|
344
|
+
.IP \(bu 2
|
|
345
|
+
\fBSciCatAutoGrouping\fP \fI(bool)\fP \- group all scans with the measurement name set to the base scan filename, default: \fBFalse\fP
|
|
346
|
+
.IP \(bu 2
|
|
347
|
+
\fBMetadataScript\fP \fI(str)\fP \- a python module file name containing \fBmain()\fP which provides a dictionary with user metadata stored in the INIT mode, default: \fB\(dq\(dq\fP
|
|
348
|
+
.IP \(bu 2
|
|
349
|
+
\fBScicatMeasurements\fP \fI(dict)\fP \- a dictionary of measurement names indexed by \fBScanDir\fP and used by \fBscingestor\fP, default: \fB{}\fP
|
|
350
|
+
.IP \(bu 2
|
|
351
|
+
\fBCreateMeasurementFile\fP \fI(bool)\fP \- create a measurement file with its filename releated to \fBScicatMeasurements\fP or \fBScanFile\fP, default: \fBFalse\fP
|
|
344
352
|
.UNINDENT
|
|
345
353
|
.sp
|
|
346
354
|
Contents:
|
|
@@ -351,8 +359,8 @@ Contents:
|
|
|
351
359
|
This is the macro server scan data NeXus recorder module
|
|
352
360
|
.INDENT 0.0
|
|
353
361
|
.TP
|
|
354
|
-
.B class
|
|
355
|
-
Bases: \
|
|
362
|
+
.B class sardananxsrecorder.nxsrecorder.NXS_FileRecorder(filename=None, macro=None, **pars)
|
|
363
|
+
Bases: \fI\%BaseFileRecorder\fP
|
|
356
364
|
.sp
|
|
357
365
|
This recorder saves data to a NeXus file making use of NexDaTaS Writer
|
|
358
366
|
.sp
|
|
@@ -430,7 +438,7 @@ and records in INIT mode
|
|
|
430
438
|
.UNINDENT
|
|
431
439
|
.INDENT 7.0
|
|
432
440
|
.TP
|
|
433
|
-
.B formats
|
|
441
|
+
.B formats = {\(aqh5\(aq: \(aq.h5\(aq, \(aqndf\(aq: \(aq.ndf\(aq, \(aqnx\(aq: \(aq.nx\(aq, \(aqnxs\(aq: \(aq.nxs\(aq}
|
|
434
442
|
(\fI\%dict\fP <\fI\%str\fP, \fI\%str\fP > ) recoder format
|
|
435
443
|
.UNINDENT
|
|
436
444
|
.INDENT 7.0
|
|
@@ -448,8 +456,8 @@ the output file format
|
|
|
448
456
|
.UNINDENT
|
|
449
457
|
.INDENT 7.0
|
|
450
458
|
.TP
|
|
451
|
-
.B class
|
|
452
|
-
Bases: \
|
|
459
|
+
.B class numpyEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)
|
|
460
|
+
Bases: \fBJSONEncoder\fP
|
|
453
461
|
.sp
|
|
454
462
|
numpy json encoder with list
|
|
455
463
|
.sp
|
|
@@ -465,7 +473,7 @@ ensure_ascii is false, the output can contain non\-ASCII characters.
|
|
|
465
473
|
.sp
|
|
466
474
|
If check_circular is true, then lists, dicts, and custom encoded
|
|
467
475
|
objects will be checked for circular references during encoding to
|
|
468
|
-
prevent an infinite recursion (which would cause an
|
|
476
|
+
prevent an infinite recursion (which would cause an RecursionError).
|
|
469
477
|
Otherwise, no such check takes place.
|
|
470
478
|
.sp
|
|
471
479
|
If allow_nan is true, then NaN, Infinity, and \-Infinity will be
|
|
@@ -507,11 +515,11 @@ default encoder
|
|
|
507
515
|
Sardana Scan Recorders
|
|
508
516
|
.INDENT 0.0
|
|
509
517
|
.IP \(bu 2
|
|
510
|
-
|
|
518
|
+
\fI\%Index\fP
|
|
511
519
|
.IP \(bu 2
|
|
512
|
-
|
|
520
|
+
\fI\%Module Index\fP
|
|
513
521
|
.IP \(bu 2
|
|
514
|
-
|
|
522
|
+
\fI\%Search Page\fP
|
|
515
523
|
.UNINDENT
|
|
516
524
|
.SH AUTHOR
|
|
517
525
|
Author
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
import os
|
|
24
24
|
import re
|
|
25
|
+
import sys
|
|
25
26
|
|
|
26
27
|
import numpy
|
|
27
28
|
import json
|
|
@@ -101,6 +102,8 @@ class NXS_FileRecorder(BaseFileRecorder):
|
|
|
101
102
|
BaseFileRecorder.__init__(self)
|
|
102
103
|
#: (:obj:`str`) base filename
|
|
103
104
|
self.__base_filename = filename
|
|
105
|
+
#: (:obj:`str`) raw filename
|
|
106
|
+
self.__raw_filename = ""
|
|
104
107
|
self.__macro = weakref.ref(macro) if macro else None
|
|
105
108
|
#: (:class:`tango.Database`) tango database
|
|
106
109
|
self.__db = tango.Database()
|
|
@@ -163,7 +166,7 @@ class NXS_FileRecorder(BaseFileRecorder):
|
|
|
163
166
|
appendentry = self.__getConfVar("AppendEntry", True)
|
|
164
167
|
scanID = self.__env["ScanID"] \
|
|
165
168
|
if "ScanID" in self.__env.keys() else -1
|
|
166
|
-
|
|
169
|
+
self.__setFileName(
|
|
167
170
|
self.__base_filename, not appendentry, scanID)
|
|
168
171
|
|
|
169
172
|
def __command(self, server, command, *args):
|
|
@@ -338,10 +341,12 @@ class NXS_FileRecorder(BaseFileRecorder):
|
|
|
338
341
|
|
|
339
342
|
:param filename: sardana scanfile name
|
|
340
343
|
:type filename: :obj:`str`
|
|
341
|
-
:param
|
|
342
|
-
:param
|
|
344
|
+
:param number: True if append scanID
|
|
345
|
+
:param number: :obj:`bool`
|
|
343
346
|
:param scanID: scanID to append
|
|
344
347
|
:type scanID: :obj:`int`
|
|
348
|
+
:returns: True if append scanID
|
|
349
|
+
:rtype: :obj:`bool`
|
|
345
350
|
"""
|
|
346
351
|
if scanID is not None and scanID < 0:
|
|
347
352
|
return number
|
|
@@ -370,20 +375,30 @@ class NXS_FileRecorder(BaseFileRecorder):
|
|
|
370
375
|
|
|
371
376
|
subs = (len([None for _ in list(re.finditer('%', filename))]) == 1)
|
|
372
377
|
# construct the filename, e.g. : /dir/subdir/etcdir/prefix_00123.nxs
|
|
373
|
-
if
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
378
|
+
if scanID is None:
|
|
379
|
+
serial = self.recordlist.getEnvironValue('serialno')
|
|
380
|
+
elif scanID >= 0:
|
|
381
|
+
if isarver >= 304 or isarver == 0:
|
|
382
|
+
serial = scanID
|
|
383
|
+
else:
|
|
384
|
+
serial = scanID + 1
|
|
385
|
+
|
|
381
386
|
if subs:
|
|
382
387
|
try:
|
|
383
388
|
#: output file name
|
|
384
389
|
self.filename = filename % serial
|
|
385
390
|
except Exception:
|
|
386
391
|
subs = False
|
|
392
|
+
if not self.__raw_filename:
|
|
393
|
+
self.__raw_filename = self.__rawfilename(serial)
|
|
394
|
+
self.debug('Raw Filename: %s' % str(self.__raw_filename))
|
|
395
|
+
if not subs and self.__raw_filename and \
|
|
396
|
+
"{ScanID" in self.__raw_filename:
|
|
397
|
+
try:
|
|
398
|
+
self.filename = self.__raw_filename.format(ScanID=serial)
|
|
399
|
+
subs = True
|
|
400
|
+
except Exception:
|
|
401
|
+
pass
|
|
387
402
|
|
|
388
403
|
if not subs:
|
|
389
404
|
if number:
|
|
@@ -957,12 +972,11 @@ class NXS_FileRecorder(BaseFileRecorder):
|
|
|
957
972
|
self.__setNexusDevices()
|
|
958
973
|
|
|
959
974
|
appendentry = self.__getConfVar("AppendEntry", True)
|
|
960
|
-
|
|
961
|
-
appendentry = not self.__setFileName(
|
|
975
|
+
appendscanid = not self.__setFileName(
|
|
962
976
|
self.__base_filename, not appendentry)
|
|
963
977
|
envRec = self.recordlist.getEnviron()
|
|
964
978
|
self.__vars["vars"]["serialno"] = ("_%05i" % envRec["serialno"]) \
|
|
965
|
-
if
|
|
979
|
+
if appendscanid else ""
|
|
966
980
|
self.__vars["vars"]["scan_id"] = envRec["serialno"]
|
|
967
981
|
self.__vars["vars"]["scan_title"] = envRec["title"]
|
|
968
982
|
if self.__macro:
|
|
@@ -1129,7 +1143,10 @@ class NXS_FileRecorder(BaseFileRecorder):
|
|
|
1129
1143
|
tz = pytz.timezone(self.__timezone)
|
|
1130
1144
|
|
|
1131
1145
|
fmt = '%Y-%m-%dT%H:%M:%S.%f%z'
|
|
1132
|
-
|
|
1146
|
+
if sys.version_info > (3, 6):
|
|
1147
|
+
starttime = mtime.replace(tzinfo=tz)
|
|
1148
|
+
else:
|
|
1149
|
+
starttime = tz.localize(mtime)
|
|
1133
1150
|
return str(starttime.strftime(fmt))
|
|
1134
1151
|
|
|
1135
1152
|
def _endRecordList(self, recordlist):
|
|
@@ -1184,15 +1201,15 @@ class NXS_FileRecorder(BaseFileRecorder):
|
|
|
1184
1201
|
"""
|
|
1185
1202
|
result = ""
|
|
1186
1203
|
fpath = self.filename
|
|
1187
|
-
|
|
1188
|
-
|
|
1204
|
+
try:
|
|
1205
|
+
if fpath.startswith(bmtfpath):
|
|
1189
1206
|
if os.path.isdir(bmtfpath):
|
|
1190
1207
|
btml = [fl for fl in os.listdir(bmtfpath)
|
|
1191
1208
|
if (fl.startswith(bmtfprefix)
|
|
1192
1209
|
and fl.endswith(bmtfext))]
|
|
1193
1210
|
result = btml[0][len(bmtfprefix):-len(bmtfext)]
|
|
1194
|
-
|
|
1195
|
-
|
|
1211
|
+
except Exception:
|
|
1212
|
+
pass
|
|
1196
1213
|
return result
|
|
1197
1214
|
|
|
1198
1215
|
def beamtimeid(self):
|
|
@@ -1203,11 +1220,62 @@ class NXS_FileRecorder(BaseFileRecorder):
|
|
|
1203
1220
|
beamtimeid = self.beamtime_id(bmtfpath, bmtfprefix, bmtfext)
|
|
1204
1221
|
return beamtimeid or "00000000"
|
|
1205
1222
|
|
|
1223
|
+
def __rawfilename(self, serial):
|
|
1224
|
+
""" find scan name
|
|
1225
|
+
"""
|
|
1226
|
+
try:
|
|
1227
|
+
scan_file = self.__macro().getEnv('ScanFile')
|
|
1228
|
+
except Exception:
|
|
1229
|
+
scan_file = []
|
|
1230
|
+
try:
|
|
1231
|
+
scan_dir = self.__macro().getEnv('ScanDir')
|
|
1232
|
+
except Exception:
|
|
1233
|
+
scan_dir = "/"
|
|
1234
|
+
if isinstance(scan_file, str):
|
|
1235
|
+
scan_file = [scan_file]
|
|
1236
|
+
bfilename = ""
|
|
1237
|
+
|
|
1238
|
+
for sfile in scan_file:
|
|
1239
|
+
sfile = os.path.join(scan_dir, sfile)
|
|
1240
|
+
try:
|
|
1241
|
+
ffile = sfile.format(ScanID=serial)
|
|
1242
|
+
except KeyError:
|
|
1243
|
+
ffile = sfile
|
|
1244
|
+
if ffile == self.__base_filename:
|
|
1245
|
+
bfilename = sfile
|
|
1246
|
+
break
|
|
1247
|
+
bfilename = bfilename or self.__base_filename
|
|
1248
|
+
return bfilename
|
|
1249
|
+
|
|
1250
|
+
def __scanname(self, serial):
|
|
1251
|
+
""" find scan name
|
|
1252
|
+
"""
|
|
1253
|
+
if not self.__raw_filename:
|
|
1254
|
+
self.__raw_filename = self.__rawfilename(serial)
|
|
1255
|
+
bfilename = self.__raw_filename
|
|
1256
|
+
_, bfname = os.path.split(bfilename)
|
|
1257
|
+
if bfname.endswith(".tmp"):
|
|
1258
|
+
bfname = bfname[:-4]
|
|
1259
|
+
sname, fext = os.path.splitext(bfname)
|
|
1260
|
+
scanname = os.path.commonprefix(
|
|
1261
|
+
[sname.format(ScanID=11111111),
|
|
1262
|
+
sname.format(ScanID=99999999)])
|
|
1263
|
+
if '%' in scanname:
|
|
1264
|
+
try:
|
|
1265
|
+
scanname = os.path.commonprefix(
|
|
1266
|
+
[scanname % 11111111,
|
|
1267
|
+
scanname % 99999999])
|
|
1268
|
+
except Exception:
|
|
1269
|
+
pass
|
|
1270
|
+
if scanname.endswith("_"):
|
|
1271
|
+
scanname = scanname[:-1]
|
|
1272
|
+
return scanname
|
|
1273
|
+
|
|
1206
1274
|
def __appendSciCatDataset(self, hostname=None):
|
|
1207
1275
|
""" append dataset to SciCat ingestion list """
|
|
1208
1276
|
|
|
1277
|
+
sid = self.__vars["vars"]["scan_id"]
|
|
1209
1278
|
fdir, fname = os.path.split(self.filename)
|
|
1210
|
-
_, bfname = os.path.split(self.__base_filename)
|
|
1211
1279
|
sname, fext = os.path.splitext(fname)
|
|
1212
1280
|
beamtimeid = self.beamtimeid()
|
|
1213
1281
|
defprefix = "scicat-datasets-"
|
|
@@ -1227,12 +1295,17 @@ class NXS_FileRecorder(BaseFileRecorder):
|
|
|
1227
1295
|
variables = self.__getConfVar("ConfigVariables", None, True)
|
|
1228
1296
|
if isinstance(variables, dict) and "entryname" in variables:
|
|
1229
1297
|
entryname = variables["entryname"]
|
|
1230
|
-
try:
|
|
1231
|
-
scanname, _ = os.path.splitext(bfname % "")
|
|
1232
|
-
except Exception:
|
|
1233
|
-
scanname, _ = os.path.splitext(bfname)
|
|
1234
1298
|
|
|
1235
|
-
|
|
1299
|
+
scanname = self.__scanname(sid)
|
|
1300
|
+
# _, bfname = os.path.split(self.__base_filename)
|
|
1301
|
+
# try:
|
|
1302
|
+
# scanname, _ = os.path.splitext(bfname % "")
|
|
1303
|
+
# except Exception:
|
|
1304
|
+
# scanname, _ = os.path.splitext(bfname)
|
|
1305
|
+
|
|
1306
|
+
if appendentry is True and \
|
|
1307
|
+
'%' not in self.__raw_filename and \
|
|
1308
|
+
"{ScanID" not in self.__raw_filename:
|
|
1236
1309
|
sid = self.__vars["vars"]["scan_id"]
|
|
1237
1310
|
sname = "%s::/%s_%05i;%s_%05i" % (
|
|
1238
1311
|
scanname, entryname, sid, scanname, sid)
|
|
@@ -1270,15 +1343,17 @@ class NXS_FileRecorder(BaseFileRecorder):
|
|
|
1270
1343
|
def __createMeasurementFile(self):
|
|
1271
1344
|
""" create measurement file """
|
|
1272
1345
|
|
|
1346
|
+
sid = self.__vars["vars"]["scan_id"]
|
|
1273
1347
|
fdir, fname = os.path.split(self.filename)
|
|
1274
|
-
_, bfname = os.path.split(self.__base_filename)
|
|
1275
1348
|
sname, fext = os.path.splitext(fname)
|
|
1276
1349
|
# beamtimeid = self.beamtimeid()
|
|
1277
1350
|
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1351
|
+
scanname = self.__scanname(sid)
|
|
1352
|
+
# _, bfname = os.path.split(self.__base_filename)
|
|
1353
|
+
# try:
|
|
1354
|
+
# scanname, _ = os.path.splitext(bfname % "")
|
|
1355
|
+
# except Exception:
|
|
1356
|
+
# scanname, _ = os.path.splitext(bfname)
|
|
1282
1357
|
|
|
1283
1358
|
try:
|
|
1284
1359
|
sm = dict(self.__getEnvVar('SciCatMeasurements', {}))
|
|
@@ -1291,9 +1366,10 @@ class NXS_FileRecorder(BaseFileRecorder):
|
|
|
1291
1366
|
if isinstance(variables, dict) and "entryname" in variables:
|
|
1292
1367
|
entryname = variables["entryname"]
|
|
1293
1368
|
if appendentry is True:
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1369
|
+
if '%' not in self.__raw_filename and \
|
|
1370
|
+
"{ScanID" not in self.__raw_filename:
|
|
1371
|
+
sname = sname + ("_%05i" % sid)
|
|
1372
|
+
entryname = entryname + ("_%05i" % sid)
|
|
1297
1373
|
|
|
1298
1374
|
mntname = scanname
|
|
1299
1375
|
if fdir in sm.keys() and sm[fdir]:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/sardana_nxsrecorder.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/sardana_nxsrecorder.egg-info/not-zip-safe
RENAMED
|
File without changes
|
{sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/sardana_nxsrecorder.egg-info/requires.txt
RENAMED
|
File without changes
|
{sardana-nxsrecorder-3.21.0 → sardana-nxsrecorder-3.22.0}/sardana_nxsrecorder.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|