Skip to content

Commit

Permalink
add ScanNamesNoMetadata and ScanNamesNoGrouping variables (#702)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotan authored Jul 19, 2024
1 parent 879d60a commit 2449f2f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
2024-07-19 Jan Kotanski <jankotan@gmail.com>
* improve findAttribute by adding moduleAttributeMap (#696)
* add ScanNamesNoMetadata and ScanNamesNoGrouping variables (#702)
* tagged as v4.13.0

2024-07-15 Jan Kotanski <jankotan@gmail.com>
Expand Down
29 changes: 19 additions & 10 deletions nxstools/pyeval/scdataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ def append_scicat_dataset(macro, status_info=True, reingest=False):

fdir = macro.getEnv('ScanDir')
snmode = get_env_var(macro, 'ScanNames', None)
nometa = get_env_var(macro, 'ScanNamesNoMetadata', False)
nogrouping = get_env_var(macro, 'ScanNamesNoGrouping', False)
pdir = None
if snmode is not None:
if bool(snmode):
Expand All @@ -150,21 +152,28 @@ def append_scicat_dataset(macro, status_info=True, reingest=False):
if fdir in sm.keys():
cgrp = sm[fdir]
if cgrp != scanname2:
commands.append("__command__ stop")
commands.append("%s:%s" % (cgrp, time.time()))
commands.append("__command__ start %s" % scanname2)
if not nogrouping and not nometa:
commands.append("__command__ stop")
commands.append("%s:%s" % (cgrp, time.time()))
commands.append("__command__ start %s" % scanname2)
else:
if not nogrouping and not nometa:
commands.append("__command__ start %s" % scanname2)
if not nometa:
commands.append(sname)
if not nogrouping and not nometa:
commands.append("__command__ stop")
if not nogrouping:
commands.append("%s:%s" % (scanname2, time.time()))
if not nogrouping and not nometa:
commands.append("__command__ start %s" % scanname2)
commands.append(sname)
commands.append("__command__ stop")
commands.append("%s:%s" % (scanname2, time.time()))
commands.append("__command__ start %s" % scanname2)
sname = "\n".join(commands)

sm[fdir] = scanname2
if not nogrouping and not nometa:
sm[fdir] = scanname2
macro.setEnv('SciCatMeasurements', sm)

append_scicat_record(macro, sname, status_info=True)
if sname:
append_scicat_record(macro, sname, status_info=True)
return sname


Expand Down

0 comments on commit 2449f2f

Please sign in to comment.