nxsrecconfig package¶
Submodules¶
nxsrecconfig.Backends module¶
scan backends: sardana, bliss and null
The sardana backend uses the Sardana MacroServer and its pools.
The null backend runs without any scan control system, e.g. to
select components for scans of other systems: it has no channels and
no measurement groups, and keeps its scan environment in memory.
The bliss backend uses BLISS sessions published in Redis,
see nxsrecconfig.BlissBackend.
- nxsrecconfig.Backends.BACKENDS = {'bliss': <class 'nxsrecconfig.BlissBackend.BlissBackend'>, 'null': <class 'nxsrecconfig.Backends.NullBackend'>, 'sardana': <class 'nxsrecconfig.Backends.SardanaBackend'>}¶
- class nxsrecconfig.Backends.NullBackend(numberOfThreads=None)[source]¶
Bases:
ScanBackendscan backend without scan control system
constructor
- Parameters:
numberOfThreads (
str) – number of threads
- createMntGrp(*args, **kwargs)¶
measurement groups are not supported
- Raises:
- defaultDoor(db)[source]¶
provides the default target
- Parameters:
db (
tango.Database) – tango database- Returns:
empty string, there are no doors
- Return type:
- deleteMntGrp(*args, **kwargs)¶
measurement groups are not supported
- Raises:
- property environment¶
scan environment variables
- mntGrpConfiguration(*args, **kwargs)¶
measurement groups are not supported
- Raises:
- nonExistingChannels(door, channels)[source]¶
provides the channels which are not known to the backend
Channels cannot be checked without a control system, so all of them are taken as existing.
- setMntGrpConfiguration(*args, **kwargs)¶
measurement groups are not supported
- Raises:
- testMntGrpConfiguration(*args, **kwargs)¶
measurement groups are not supported
- Raises:
- class nxsrecconfig.Backends.SardanaBackend(numberOfThreads)[source]¶
Bases:
MacroServerPoolssardana scan backend, i.e. macroserver and pools
constructor
- Parameters:
numberOfThreads (
str) – number of threads
nxsrecconfig.BlissBackend module¶
bliss scan backend
The selector exchanges data with BLISS sessions through Redis, so it does
not need BLISS itself. A BLISS session publishes its channels, motors and
measurement groups with nxsrecconfig.BlissSession.NXSBlissSession
and applies the channels selected by the selector to its measurement groups.
The target (Door) of the selector is the BLISS session name.
The Redis database is given by the NXSBLISS_REDIS_URL environment
variable or provided by Beacon, i.e. by the BEACON_HOST variable.
Redis keys of a session:
nxsselector:<session>:elements: published elements, i.e. JSON lists ofAcqChannelList,ExpChannelList,MotorListandMeasurementGroupListin the format of Sardana poolsnxsselector:<session>:env: scan environment variables in JSONnxsselector:<session>:mntgrps: BLISS full names of channels selected for measurement groups, in JSONnxsselector:<session>:changed: Redis channel notifying the session about changes of the selector, seenxsrecconfig.BlissSession.NXSBlissWatchernxsselector:<session>:datasources: descriptions of STEP datasources without BLISS counters selected for measurement groups, i.e. their XML definitions, NeXus types and ranks, in JSON, seenxsrecconfig.BlissDataSources
- class nxsrecconfig.BlissBackend.BlissBackend(numberOfThreads=None, redis=None, notify=True, datastore=None)[source]¶
Bases:
ScanBackendscan backend of BLISS sessions
constructor
- Parameters:
numberOfThreads (
str) – number of threadsredis (
redis.Redis) – Redis connection, seeredisConnection()notify (
bool) – notify sessions about changesdatastore (
blissdata.redis_engine.store.DataStore) – blissdata data store checking scan states, created fromredisURL()if None
- channelSource(name)[source]¶
provides the tango source of a channel
BLISS channels are written from scan data, i.e. by CLIENT datasources
- createMntGrp(*args, **kwargs)¶
measurement group devices are not supported
- Raises:
- dataSourceTypes = ['TANGO', 'DB', 'PYEVAL', 'CLIENT']¶
(
list<str>) types of STEP datasources without BLISS counters which are read by BLISS sessions
- defaultDoor(db)[source]¶
provides the default target, i.e. the first published session
- Parameters:
db (
tango.Database) – tango database- Returns:
session name
- Return type:
- deleteMntGrp(*args, **kwargs)¶
measurement group devices are not supported
- Raises:
- isDoorRunning(ms)[source]¶
checks if a scan is running
The session publishes its running scan, i.e.
ScanRunningwith the session name and the scan number. Scans which are closed in blissdata are not running, e.g. after a session crash.
- mntGrpConfiguration(*args, **kwargs)¶
measurement group devices are not supported
- Raises:
- nonExistingChannels(door, channels)[source]¶
provides the channels which are not published by the session
- property redis¶
Redis connection
- Returns:
Redis connection
- Return type:
redis.Redis
- selectChannels(ms, mntgrp, channels)[source]¶
requests channels of a measurement group of the session
Motors and unknown channels are skipped. The session applies the request, see
nxsrecconfig.BlissSession.NXSBlissSession.apply()
- selectDataSources(ms, mntgrp, datasources)[source]¶
- requests STEP datasources without BLISS counters
to be read in scans of a measurement group of the session
The session creates BLISS counters of the datasources, see
nxsrecconfig.BlissSession.NXSBlissSession.apply()
- setMntGrpConfiguration(*args, **kwargs)¶
measurement group devices are not supported
- Raises:
- testMntGrpConfiguration(*args, **kwargs)¶
measurement group devices are not supported
- Raises:
- class nxsrecconfig.BlissBackend.BlissPool(session, elements)[source]¶
Bases:
objectelements of a BLISS session in the format of Sardana pools, used by
nxsrecconfig.Utils.PoolUtilsconstructor
- Parameters:
- nxsrecconfig.BlissBackend.ELEMENTLISTS = ['AcqChannelList', 'ExpChannelList', 'MotorList', 'MeasurementGroupList']¶
- nxsrecconfig.BlissBackend.channelName(fullname)[source]¶
provides a selector channel name of a BLISS channel
NeXus names and datasource names cannot contain
:or.
- nxsrecconfig.BlissBackend.redisConnection(url=None)[source]¶
opens the Redis connection of BLISS
- Parameters:
url (
str) – Redis URL, fromNXSBLISS_REDIS_URLor Beacon if None- Returns:
Redis connection
- Return type:
redis.Redis
nxsrecconfig.BlissDataSources module¶
BLISS counters of NeXus configuration datasources
STEP datasources selected in NXSRecSelector which are not BLISS counters,
i.e. TANGO, DB, PYEVAL or CLIENT datasources of the configuration server,
are read in BLISS scans by counters of NXSDataSourceController.
The datasources are evaluated by nxswriter datasources,
i.e. in the same way as by NXSDataWriter.
numeric and boolean datasources of any rank are BLISS channels with the type of their NeXus fields and free dimensions,
string datasources are collected at each scan point and stored as scan metadata of the controller at the end of the scan,
CLIENT datasources are read from user data, they are skipped if their records are not in the user data,
datasources which cannot be read are filled with NaN for floats, the maximal value for integers, False for booleans or an empty string, or the scan is stopped if
canfailis False.
The controller is created and updated by
nxsrecconfig.BlissSession.NXSBlissSession.
- nxsrecconfig.BlissDataSources.CONTROLLER = 'nxsds'¶
(
str) default name of the datasource counter controller
- class nxsrecconfig.BlissDataSources.DataSourceReader(userdata=None, log=None)[source]¶
Bases:
objectreads NeXus configuration datasources by nxswriter datasources
constructor
- Parameters:
userdata (
dict<str, any> or callable) – user data of CLIENT datasources or a function returning themlog (
logging.Loggeror any) – logger with debug, info and warning methods
- log¶
(
logging.Loggeror any) logger
- class nxsrecconfig.BlissDataSources.NXSDataSourceAcquisitionSlave(*counters, ctrl_params=None, count_time=None, npoints=1)[source]¶
Bases:
objectBLISS acquisition object of datasource counters, it reads all datasources once per scan point
constructor
- Parameters:
- class nxsrecconfig.BlissDataSources.NXSDataSourceController(name='nxsds', reader=None, canfail=True)[source]¶
Bases:
objectBLISS counter controller of NeXus configuration datasources
constructor
- Parameters:
name (
str) – controller namereader (
DataSourceReader) – datasource readercanfail (
bool) – fill values of datasources which cannot be read, stop the scan otherwise
- get_acquisition_object(acq_params, ctrl_params, parent_acq_params)[source]¶
provides the acquisition object
- Parameters:
- Returns:
acquisition object
- Return type:
- get_default_chain_parameters(scan_params, acq_params)[source]¶
provides default acquisition parameters
- read_all(*counters)[source]¶
reads the datasources of the counters
- Parameters:
counters (
list<NXSDataSourceCounter>) – counters- Returns:
values converted to the counter types and ranks
- Return type:
listany- Raises:
RuntimeErrorif a datasource cannot be read andcanfailis False
- reader¶
(
DataSourceReader) datasource reader
- class nxsrecconfig.BlissDataSources.NXSDataSourceCounter(name, controller, dtype='float64', rank=0)[source]¶
Bases:
objectBLISS counter of a NeXus configuration datasource
constructor
- Parameters:
name (
str) – datasource namecontroller (
NXSDataSourceController) – counter controllerdtype (
str) – numpy type name,strfor stringsrank (
int) – field rank
- property isstring¶
string datasource flag
- Returns:
True for string datasources stored as scan metadata
- Return type:
- nxsrecconfig.BlissDataSources.NXTYPES = {'ISO8601': 'str', 'NX_BOOLEAN': 'bool', 'NX_CHAR': 'str', 'NX_DATE_TIME': 'str', 'NX_FLOAT': 'float64', 'NX_FLOAT32': 'float32', 'NX_FLOAT64': 'float64', 'NX_INT': 'int64', 'NX_INT16': 'int16', 'NX_INT32': 'int32', 'NX_INT64': 'int64', 'NX_INT8': 'int8', 'NX_NUMBER': 'float64', 'NX_POSINT': 'uint64', 'NX_UINT': 'uint64', 'NX_UINT16': 'uint16', 'NX_UINT32': 'uint32', 'NX_UINT64': 'uint64', 'NX_UINT8': 'uint8'}¶
- nxsrecconfig.BlissDataSources.convert(value, dtype, rank)[source]¶
converts a datasource value to the type and rank of its field
- Parameters:
- Returns:
converted value
- Return type:
numpy.ndarrayorstr- Raises:
ValueErrorif the value cannot be converted
nxsrecconfig.BlissH5Map module¶
NeXus structure of selector profiles in BLISS HDF5 mappings
BLISS describes its scan files by h5maps of blissdata, generated
by scan_info_to_h5map of blisswriter at the start and at the
end of each scan. The hook of this module adds the STEP fields of the
NeXus configuration, at their NeXus paths, to the scan entry as soft
links to the datasets written by BLISS, i.e. the scan file has the NeXus
structure of the profile as with NXSDataWriter, and the BLISS one.
The hook is added by add_h5map_hook of bliss.scanning.h5map_hooks
if BLISS provides it. Otherwise scan_info_to_h5map of
bliss.scanning.scan is wrapped by the hook.
The STEP fields are provided by
nxsrecconfig.BlissScanMeta.NXSScanMeta registered with
links=True, which also provides INIT and FINAL fields:
from nxsrecconfig.BlissScanMeta import NXSScanMeta
nxsmeta = NXSScanMeta("p09/nxsrecselector/1")
nxsmeta.register(links=True)
Overlays are trees of h5map-like dictionaries with groups and
{"type": "step", "stream": <stream name>} items.
- class nxsrecconfig.BlissH5Map.DictItems[source]¶
Bases:
objectcreates h5map items as dictionaries
- nxsrecconfig.BlissH5Map.H5TYPES = {'dataset', 'external_binary_dataset', 'external_link', 'group', 'soft_link', 'virtual_dataset'}¶
(
set<str>) types of h5map items which are not datasets given by their values
- class nxsrecconfig.BlissH5Map.ModelItems(module=None)[source]¶
Bases:
objectcreates h5map items as
blissdata.h5mapmodelsconstructor
- Parameters:
module (
module) – h5map model module,blissdata.h5mapif None
- class nxsrecconfig.BlissH5Map.NXSH5MapHook(log=None)[source]¶
Bases:
objecthook of the BLISS h5map generation
constructor
- Parameters:
log (
logging.Logger) – logger
- blissHook(scan, mappings, timing)[source]¶
- adds profile links to the h5maps of a scan,
called by
bliss.scanning.h5map_hooks
- Parameters:
- Returns:
updated mappings
- Return type:
- log¶
(
logging.Logger) logger
- original¶
(callable) the original h5map generator
- nxsrecconfig.BlissH5Map.addProfileLinks(mapping, overlay, log=None, items=None)[source]¶
adds STEP fields of a profile to NXentry groups of an h5map
- Parameters:
mapping (
dictorblissdata.h5map.Group) – h5map of a file rootlog (
logging.Logger) – loggeritems (
DictItemsorModelItems) – item factory,DictItemsif None
- Returns:
number of added links
- Return type:
- nxsrecconfig.BlissH5Map.applyOverlay(group, overlay, streams, datasets, path='', log=None, items=None)[source]¶
adds overlay fields as soft links to an h5map group
Existing items of the group are kept.
- Parameters:
group (
dictorblissdata.h5map.Group) – h5map grouppath (
str) – group pathlog (
logging.Logger) – loggeritems (
DictItemsorModelItems) – item factory,DictItemsif None
- Returns:
number of added links
- Return type:
- nxsrecconfig.BlissH5Map.attributeValue(value)[source]¶
provides a plain value of an h5map attribute
- Parameters:
value (any) – h5map attribute value
- Returns:
plain value
- Return type:
any
- nxsrecconfig.BlissH5Map.installHook(module=None, log=None, registry=None)[source]¶
installs the h5map hook in BLISS
The hook is added to the BLISS h5map hooks if BLISS provides them, otherwise
scan_info_to_h5mapof the BLISS scan module is wrapped.- Parameters:
module (
module) – module withscan_info_to_h5mapto be wrapped,bliss.scanning.scanif Nonelog (
logging.Logger) – loggerregistry (
module) – module withadd_h5map_hookandremove_h5map_hook,bliss.scanning.h5map_hooksif available and module is None
- Returns:
the installed hook
- Return type:
- nxsrecconfig.BlissH5Map.itemPaths(group, path='')[source]¶
provides paths of streams and of other datasets of an h5map group
- nxsrecconfig.BlissH5Map.itemType(item)[source]¶
provides the type of an h5map item
Datasets without attributes can be given by their values.
- nxsrecconfig.BlissH5Map.stepOverlay(h5map)[source]¶
provides the overlay of STEP stream fields of NXentry groups
Links to STEP fields are STEP fields of the same streams.
- nxsrecconfig.BlissH5Map.streamNames(channels, controller='nxsds')[source]¶
provides stream names of selector channels and datasources
- nxsrecconfig.BlissH5Map.targetPath(stream, streams, datasets)[source]¶
provides the path of a BLISS dataset of a stream
Datasets of streams are looked for first, then datasets of the stream controller with the stream short name, e.g. string datasource values stored as scan metadata of the datasource counter controller.
nxsrecconfig.BlissScanMeta module¶
NeXus metadata of selector profiles for BLISS scans
The descriptive part of the NeXus configuration selected by NXSRecSelector, i.e. its INIT and FINAL fields, is added to BLISS scans as user scan metadata, so the BLISS writer stores it in the scan entry. STEP fields are not written, the scan data are stored by BLISS itself.
In a BLISS session:
from nxsrecconfig.BlissScanMeta import NXSScanMeta
nxsmeta = NXSScanMeta() # the selector module with the null backend
nxsmeta.register()
The profile of the active BLISS measurement group is used by default.
The INIT fields are evaluated when the scan starts and the FINAL fields
when the scan ends, by NXSDataWriter (nxswriter) with the h5map
writer of nxstools, which builds the NeXus tree in memory.
Links to the written fields are kept, links to STEP fields are dropped.
With nxsmeta.register(links=True) the STEP fields are added at their
NeXus paths as links to the datasets of the BLISS channels,
see nxsrecconfig.BlissH5Map.
- nxsrecconfig.BlissScanMeta.END_SKIP = ['STEP', 'INIT']¶
- class nxsrecconfig.BlissScanMeta.NXSScanMeta(selector=None, profile=None, userdata=None, writerproperties=None, log=None, session=None)[source]¶
Bases:
objectBLISS user scan metadata of NXSRecSelector profiles
constructor
- Parameters:
selector (
stror any) – NXSRecSelector device name or proxy, ornxsrecconfig.Settings.Settings, the selector module with the null backend if Noneprofile (
stror callable) – profile name or a function of a scan returning it, the active BLISS measurement group if Noneuserdata (
dict<str, any> or callable) – user data or a function of a scan returning them, added to theUserDataof the profilewriterproperties (
dict<str, any>) – properties of NXSDataWriter, e.g.{"addingLogs": False}log (
logging.Loggeror any) – logger with debug, info and warning methodssession (
nxsrecconfig.BlissSession.NXSBlissSession) – BLISS session of the selector publishing running scans
- configuration(scan_info, profile=None, userdata=None)[source]¶
creates the NXSDataWriter configuration and its INIT record
- log¶
(
logging.Loggeror any) logger
- register(scanmeta=None, category='', name='nexdatas', links=False)[source]¶
registers the metadata in the BLISS user scan metadata
The empty category merges the metadata into the scan entry.
- Parameters:
scanmeta (
bliss.scanning.scan_meta.ScanMeta) – scan metadata, the user scan metadata if Nonecategory (
str) – metadata categoryname (
str) – metadata name in the categorylinks (
bool) – add STEP fields of the profile as links to the scan data, seenxsrecconfig.BlissH5Map
- property selector¶
NXSRecSelector device or module
- Returns:
selector
- Return type:
- session¶
- nxsrecconfig.BlissScanMeta.START_SKIP = ['STEP', 'FINAL']¶
- nxsrecconfig.BlissScanMeta.STEP_SKIP = ['INIT', 'FINAL']¶
- nxsrecconfig.BlissScanMeta.entry_metadata(h5map)[source]¶
provides the content of the NXentry groups of an h5map
nxsrecconfig.BlissSession module¶
BLISS session side of the bliss scan backend
It publishes channels, motors and measurement groups of a BLISS session for the selector and applies the channels selected by the selector to the BLISS measurement groups. In a BLISS session:
from nxsrecconfig.BlissSession import NXSBlissSession
nxsbliss = NXSBlissSession()
nxsbliss.sync() # after changes in the selector or the session
The selector has to use the bliss backend with the session name
as its Door.
Selected STEP datasources which are not BLISS counters, i.e. TANGO, DB,
PYEVAL or CLIENT datasources, are read by counters of
nxsrecconfig.BlissDataSources.NXSDataSourceController
which are added to the measurement groups. CLIENT datasources are
read from userdata, e.g.:
nxsbliss = NXSBlissSession(userdata=lambda: {"energy": mono.energy})
setup_nexdatas() sets up everything in the session setup, i.e. the
session, the BLISS scan metadata of the selector profiles and a watcher
which applies changes of the selector automatically:
from nxsrecconfig.BlissSession import setup_nexdatas
nexdatas = setup_nexdatas("p09/nxsrecselector/1", links=True)
The scan directory and file of the selector, i.e. ScanDir and
ScanFile, follow SCAN_SAVING of BLISS. They can be changed by
the selector unless the session uses the ESRF data policy.
- class nxsrecconfig.BlissSession.BlissAPI(controller='nxsds', userdata=None, canfail=True)[source]¶
Bases:
objectaccess to the current BLISS session
constructor
- Parameters:
- activeMntGrp()[source]¶
provides the active measurement group name
- Returns:
measurement group name
- Return type:
- selectChannels(name, fullnames)[source]¶
- enables only the given counters of a measurement group,
the group is created if it does not exist
- setActiveMntGrp(name)[source]¶
activates a measurement group
- Parameters:
name (
str) – measurement group name
- setScanSaving(scandir=None, scanfile=None)[source]¶
sets the scan directory and file of SCAN_SAVING
- Parameters:
- Raises:
PermissionErrorfor the ESRF data policy
- class nxsrecconfig.BlissSession.NXSBlissSession(session=None, redis=None, api=None, userdata=None, canfail=True, log=None)[source]¶
Bases:
objectpublishes a BLISS session for the selector and applies the selected channels
constructor
- Parameters:
session (
str) – session name, the current session if Noneredis (
redis.Redis) – Redis connection, seenxsrecconfig.BlissBackend.redisConnection()api (
BlissAPI) – BLISS session accessuserdata (
dict<str, any> or callable) – user data of CLIENT datasources read by datasource counters or a function returning themcanfail (
bool) – fill values of datasources which cannot be read, stop the scan otherwiselog (
logging.Logger) – logger
- apply()[source]¶
- applies the selected channels and datasources to
the measurement groups and activates the measurement group of the selector
- applyPaths()[source]¶
- applies the scan directory and file changed by the selector
to SCAN_SAVING
- Returns:
True if SCAN_SAVING was changed
- Return type:
- backend¶
(
nxsrecconfig.BlissBackend.BlissBackend) environment of the session, without notifications of the session
- log¶
(
logging.Logger) logger
- redis¶
(
redis.Redis) Redis connection
- class nxsrecconfig.BlissSession.NXSBlissWatcher(session, interval=2.0, log=None)[source]¶
Bases:
objectapplies changes of the selector to a BLISS session
The selector notifies the session by the Redis channel
nxsselector:<session>:changed. Changes are applied when no scan is running. Changes of the session elements, i.e. counters, axes and measurement groups, are published.constructor
- Parameters:
session (
NXSBlissSession) – BLISS session of the selectorinterval (
float) – interval of checks in secondslog (
logging.Logger) – logger
- log¶
(
logging.Logger) logger
- session¶
(
NXSBlissSession) session
- class nxsrecconfig.BlissSession.NXSNexDatas(session, meta=None, watcher=None)[source]¶
Bases:
objectNeXus profiles of the selector in a BLISS session, see
setup_nexdatas()constructor
- Parameters:
session (
NXSBlissSession) – BLISS session of the selectormeta (
nxsrecconfig.BlissScanMeta.NXSScanMeta) – scan metadata of the profileswatcher (
NXSBlissWatcher) – watcher of the selector
- meta¶
(
nxsrecconfig.BlissScanMeta.NXSScanMeta) scan metadata
- session¶
(
NXSBlissSession) session
- watcher¶
(
NXSBlissWatcher) watcher
- nxsrecconfig.BlissSession.setup_nexdatas(selector=None, links=False, userdata=None, canfail=True, profile=None, session=None, watch=True, interval=2.0, scanmeta=True, redis=None, api=None, log=None)[source]¶
sets up NeXus profiles of the selector in a BLISS session
It synchronizes the session with the selector, registers the scan metadata of the profiles and starts a watcher of the selector.
- Parameters:
selector (
stror any) – NXSRecSelector device name or proxylinks (
bool) – add STEP fields of the profiles as links to scan datauserdata (
dict<str, any> or callable) – user data of CLIENT datasources or a function without arguments returning themcanfail (
bool) – fill values of datasources which cannot be read, stop the scan otherwiseprofile (
stror callable) – profile name or a function of a scan returning it, the active measurement group if Nonesession (
str) – session name, the current session if Nonewatch (
bool) – start the watcher of the selectorinterval (
float) – interval of the watcher checks in secondsscanmeta (
bool) – register the scan metadata of the profilesredis (
redis.Redis) – Redis connectionapi (
BlissAPI) – BLISS session accesslog (
logging.Logger) – logger
- Returns:
NeXus profiles in the session
- Return type:
nxsrecconfig.CheckerThread module¶
Component CheckerThread - thread which checks tango server attributes
- nxsrecconfig.CheckerThread.ATTRIBUTESTOCHECK = ['Value', 'Position', 'Counts', 'Data', 'Voltage', 'Energy', 'SampleTime']¶
- exception nxsrecconfig.CheckerThread.AlarmStateError[source]¶
Bases:
ExceptionAlarm State Exception class
- class nxsrecconfig.CheckerThread.CheckerItem(name)[source]¶
Bases:
listChecker list Item
constructor
- Parameters:
name (
str) – checker item name
- class nxsrecconfig.CheckerThread.CheckerThread(index, queue)[source]¶
Bases:
ThreadSingle CheckerThread
constructor
- Brief:
It creates ElementThread from the runnable element
- Parameters:
index (
int) – the current thread indexqueue (
Queue.Queue) – queue with tasks
- exception nxsrecconfig.CheckerThread.FaultStateError[source]¶
Bases:
ExceptionFault State Exception class
- exception nxsrecconfig.CheckerThread.OffStateError[source]¶
Bases:
ExceptionOff State Exception class
nxsrecconfig.Converter module¶
Selection version converter
- class nxsrecconfig.Converter.Converter(ver)[source]¶
Bases:
objectselection version converter
contstructor
- Parameters:
ver (
str) – the required selection version
- allkeys(selection)[source]¶
- Parameters:
selection (nxsrecconfig.Selection.Selection) – selection dictionary object
- Returns:
selection keys
- Return type:
- down¶
(
list<ConverterXtoY>) converter down sequence
- up¶
(
list<ConverterXtoY>) converter up sequence
- class nxsrecconfig.Converter.Converter1to2[source]¶
Bases:
ConverterXtoYSelection converter from version 1 to 2
constructor
- class nxsrecconfig.Converter.Converter2to1[source]¶
Bases:
ConverterXtoYSelection converter from version 2 to 1
constructor
- class nxsrecconfig.Converter.Converter2to3[source]¶
Bases:
ConverterXtoYSelection converter from version 2 to 3
converter
- class nxsrecconfig.Converter.Converter3to2[source]¶
Bases:
ConverterXtoYSelection converter from version 3 to 2
constructor
- class nxsrecconfig.Converter.Converter3to4[source]¶
Bases:
ConverterXtoYconstructor
- class nxsrecconfig.Converter.Converter4to3[source]¶
Bases:
ConverterXtoYconstructor
nxsrecconfig.Describer module¶
Component Describer
- class nxsrecconfig.Describer.DSItem(name=None, dstype=None, record=None, dsitem=None, parentobj=None)[source]¶
Bases:
objectBasic DataSource item
constructor
- Parameters:
- class nxsrecconfig.Describer.Describer(nexusconfig_device, tree=False, pyevalfromscript=False)[source]¶
Bases:
objectLists datasources, strategy, dstype and record name of given component
constructor
- Parameters:
nexusconfig_device (
tango.DeviceProxyornxsconfigserver.XMLConfigurator.XMLConfigurator) – configserver configuration servertree (
bool) – flag for output tree dictionarypyevalfromscript (
bool) – if evalulate PYEVAL datasources from script
- components(components=None, strategy='', dstype='', cfvars=None)[source]¶
describes given components. If
tree= True it returns[{ cpname : { dsname : [ | (strategy, dstype, record, nxstype, shape), …] } } ]else
[{“dsname”: dsname, “strategy”: strategy, “dstype”: dstype, | “record”: record, “nxstype”: nxstype, “shape”: shape , | “cpname”: cpname}, …]- Parameters:
components (
list<str>) – given components. If None all available ones are takenstrategy (
str) – list datasets only with given strategy. If ‘’ all available ones are takendstype (
str) – list datasets only with given datasource type. If ‘’ all available ones are takencfvars (
str) – configuration variables in JSON dictionary
- Returns:
list of dictionary with description of components
- Return type:
[
dict<str,dict<str,list<(str,str,str,str,list<int>)> > > ] or [{“dsname”:str, “strategy”:str, “dstype”:str, “record”:str, “nxstype”:str, “shape”:list<int> , “cpname”:str}, …]
- class nxsrecconfig.Describer.ExDSDict(*args, **kw)[source]¶
Bases:
dictExtended DataSource Dictionary
constructor
nxsrecconfig.DynamicComponent module¶
Dynamic Component
- class nxsrecconfig.DynamicComponent.DynamicComponent(nexusconfig_device, defaultpath="/$var.entryname#'scan'$var.serialno:NXentry/instrument:NXinstrument/collection", defaulttype='NX_CHAR', defaultuserpath="/$var.entryname#'scan'$var.serialno:NXentry/user_data:NXparameters", backend=None)[source]¶
Bases:
objectCreates dynamic component of given component
constructor
- Parameters:
nexusconfig_device (
tango.DeviceProxyornxsconfigserver.XMLConfigurator.XMLConfigurator) – configserver configuration serverdefaultpath (
str) – default dynamic component pathbackend (
nxsrecconfig.ScanBackend.ScanBackend) – scan backend providing channel sources, sardana pool channels if None
- setDefaultLinkPath(dynamicLinks, dynamicPath, dynamicInitLinks=None)[source]¶
sets default nexus path and link flag for dynamic components
- setLabelParams(labels, paths, links, types, shapes)[source]¶
sets label parameters for specific dynamic components
nxsrecconfig.MacroServerPools module¶
sardana scan backend, i.e. macroserver and pools
- class nxsrecconfig.MacroServerPools.MacroServerPools(numberOfThreads)[source]¶
Bases:
ScanBackendsardana macro server and pools
constructor
- Parameters:
numberOfThreads (
str) – number of threads
- createMntGrp(pool, name, timer)[source]¶
creates a measurement group in the pool
- Parameters:
pool (
tango.DeviceProxy) – pool proxyname (
str) – measurement group nametimer (
str) – timer name
- defaultDoor(db)[source]¶
provides the default door
- Parameters:
db (
tango.Database) – tango database- Returns:
door device name
- Return type:
- deleteMntGrp(pool, name)[source]¶
deletes a measurement group from the pool
- Parameters:
pool (
tango.DeviceProxy) – pool proxyname (
str) – measurement group name
- getPools(door)[source]¶
door pool device proxies
- Parameters:
door (
str) – door device name- Returns:
pool device proxies
- Return type:
- testMntGrpConfiguration(device, conf)[source]¶
- provides the configuration the measurement group makes of conf
and restores its current configuration
nxsrecconfig.NXSConfig module¶
Selector Server for NeXus Sardana Recorder
- class nxsrecconfig.NXSConfig.NXSRecSelector(cl, name)[source]¶
Bases:
LatestDeviceImplNXSRecSelector server interface
- Brief:
Tango Server for Nexus Sardana Recorder Settings. Device States Description: DevState.ON - Server is ON, DevState.RUNNING - Performing a query
Device constructor
- ClearCache()[source]¶
ClearCache command
- Brief:
Fetch server configuration and syncronize snapshot or motor positions
- ComponentDescription()[source]¶
ComponentDescription command
- Brief:
Return a list of available component names
- Returns:
DevString list of available component names
- Return type:
- CreateDataSources(argin)[source]¶
It creates new DataSources on the ConfigServer
- Parameters:
argin (
str) – JSON dictionary with {dsname:tangosource, …}
- DeleteAllProfiles()[source]¶
DeleteAllProfiles command
- Brief:
Delete all profiles from Configuration Server
- DeleteProfile(argin)[source]¶
DeleteProfile command
- Brief:
Delete the given mntgrp
- Parameters:
argin (
str) – DevString measurement group name
- FullDeviceNames()[source]¶
FullDeviceNames command
- Brief:
Return a JSON with full device names for all aliases
- Returns:
DevString JSON dictionary with full device names
- Return type:
- MntGrpConfiguration()[source]¶
MntGrpConfiguration command
- Brief:
returns mntgrp configuration
- Returns:
Provide mntgrp configuration in json string
- Return type:
- RemoveDynamicComponent(argin)[source]¶
RemoveDynamicComponent command
- Brief:
Delete the given dynamic component
- Parameters:
argin (
str) – DevString dynamic component name
- ResetPreselectedComponents()[source]¶
ResetPreselectedComponents command
- Brief:
reset PreselectedComponents to DefaultPreselectedComponents
- ScanEnvVariables()[source]¶
ScanEnvVariables command
- Brief:
Fetch ScanDir, ScanFile, ScanID and NeXusSelectorDevice in environment variables
- Returns:
DevString json dictionary with environment data
- Return type:
- SyncProfile()[source]¶
SyncProfile command
- Brief:
Fetch server configuration and syncronize snapshot or motor positions
- UpdateConfigVariables()[source]¶
UpdateConfigVariables command
- Brief:
Send ConfigVariables into ConfigServer and update serialno if appendEntry selected
- UpdateMntGrp()[source]¶
UpdateMntGrp command
- Brief:
Update mntgrp configuration
- Returns:
mntgrp configuration string
- Return type:
- UpdateProfile()[source]¶
UpdateProfile command
- Brief:
Update mntgrp configuration
- Returns:
JSON string with mntgrp configuration info
- Return type:
- VariableComponents()[source]¶
VariableComponents command
- Brief:
Returns a list of available component names
- Returns:
DevString list of available component names
- Return type:
- is_AdministratorDataNames_allowed()[source]¶
AdministratorDataNames command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_AvailableComponents_allowed()[source]¶
AvailableComponents command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_AvailableDataSources_allowed()[source]¶
AvailableDataSources command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_AvailableMntGrps_allowed()[source]¶
AvailableMntGrps command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_AvailableProfiles_allowed()[source]¶
AvailableProfiles command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_AvailableTimers_allowed()[source]¶
AvailableTimers command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_CacheWriterConfiguration_allowed()[source]¶
CacheWriterConfiguration command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_CanFailDataSources_write_allowed()[source]¶
CanFailDataSources attribute Write State Machine
- Returns:
True if the operation allowed
- Return type:
- is_ChannelProperties_allowed()[source]¶
ChannelProperties command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_ClearCache_allowed()[source]¶
ClearCache command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_ComponentClientSources_allowed()[source]¶
ComponentClientSources command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_ComponentDataSources_allowed()[source]¶
ComponentDataSources command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_ComponentDescription_allowed()[source]¶
ComponentDescription command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_ComponentSources_allowed()[source]¶
ComponentSources command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_CreateDataSources_allowed()[source]¶
CreateDataSources command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_CreateDynamicComponent_allowed()[source]¶
CreateDynamicComponent command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_CreateWriterConfiguration_allowed()[source]¶
CreateWriterConfiguration command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_DataSourceDescription_allowed()[source]¶
DataSourceDescription command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_DeleteAllProfiles_allowed()[source]¶
DeleteAllProfiles command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_DeleteProfile_allowed()[source]¶
DeleteProfile command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_ExportEnv_allowed()[source]¶
ExportMntGrp command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_ExtraLinkDataSources_write_allowed()[source]¶
LinkDataSources attribute Write State Machine
- Returns:
True if the operation allowed
- Return type:
- is_FetchProfile_allowed()[source]¶
FetchProfile command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_FullDeviceNames_allowed()[source]¶
FullDeviceNames command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_ImportEnv_allowed()[source]¶
ImportMntGrp command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_ImportMntGrp_allowed()[source]¶
ImportMntGrp command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_IsMntGrpUpdated_allowed()[source]¶
IsMntGrpUpdated command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_LinkDataSources_write_allowed()[source]¶
LinkDataSources attribute Write State Machine
- Returns:
True if the operation allowed
- Return type:
- is_LoadProfile_allowed()[source]¶
LoadProfile command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_MandatoryComponents_allowed()[source]¶
MandatoryComponents command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_MntGrpConfiguration_allowed()[source]¶
MntGrpConfiguration command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_MutedChannels_allowed()[source]¶
MutedChannels command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_PoolElementNames_allowed()[source]¶
PoolElementNames command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_PreselectComponents_allowed()[source]¶
PreselectComponents command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_PreselectedComponents_allowed()[source]¶
PreselectedComponents command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_PreselectedDataSources_allowed()[source]¶
PreselectedDataSources command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_RemoveDynamicComponent_allowed()[source]¶
RemoveDynamicComponent command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_ResetPreselectedComponents_allowed()[source]¶
ResetPreselectedComponents command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_SaveProfile_allowed()[source]¶
SaveProfile command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_ScanEnvVariables_allowed()[source]¶
ScanEnvVariables command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_SelectedComponents_allowed()[source]¶
SelectedComponents command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_SetChannelProperties_allowed()[source]¶
SetChannelProperties command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_SetScanEnvVariables_allowed()[source]¶
SetScanEnvVariables command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_StepDataSources_write_allowed()[source]¶
StepDataSources attribute Write State Machine
- Returns:
True if the operation allowed
- Return type:
- is_StoreProfile_allowed()[source]¶
StoreProfile command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_SwitchProfile_allowed()[source]¶
SwitchProfile command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_SyncProfile_allowed()[source]¶
SyncProfile command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_UpdateConfigVariables_allowed()[source]¶
UpdateConfigVariables command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_UpdateMntGrp_allowed()[source]¶
UpdateMntGrp command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_UpdateProfile_allowed()[source]¶
UpdateProfile command State Machine
- Returns:
True if the operation allowed
- Return type:
- is_VariableComponents_allowed()[source]¶
VariableComponents command State Machine
- Returns:
True if the operation allowed
- Return type:
- read_AppendEntry(attr)[source]¶
Read AppendEntry attribute
- Parameters:
attr (
tango.Attribute) – read attribute
- read_Backend(attr)[source]¶
Read Backend attribute
- Parameters:
attr (
tango.Attribute) – read attribute
- read_CacheComponent(attr)[source]¶
Read CacheComponent attribute
- Parameters:
attr (
tango.Attribute) – read attribute
- read_CanFailDataSources(attr)[source]¶
Read CanFailDataSources attribute
- Parameters:
attr (
tango.Attribute) – read attribute
- read_Components(attr)[source]¶
Read Components attribute
- Parameters:
attr (
tango.Attribute) – read attribute
- read_ConfigDevice(attr)[source]¶
Read ConfigDevice attribute
- Parameters:
attr (
tango.Attribute) – read attribute
- read_ConfigVariables(attr)[source]¶
Read ConfigVariables attribute
- Parameters:
attr (
tango.Attribute) – read attribute
- read_DataSources(attr)[source]¶
Read DataSources attribute
- Parameters:
attr (
tango.Attribute) – read attribute
- read_DescriptionErrors(attr)[source]¶
Read DescriptionErrors attribute
- Parameters:
attr (
tango.Attribute) – read attribute
- read_DeviceGroups(attr)[source]¶
Read DeviceGroups attribute
- Parameters:
attr (
tango.Attribute) – read attribute
- read_Door(attr)[source]¶
Read Door attribute
- Parameters:
attr (
tango.Attribute) – read attribute
- read_ExtraLinkDataSources(attr)[source]¶
Read ExtraLinkDataSources attribute
- Parameters:
attr (
tango.Attribute) – read attribute
- read_LinkDataSources(attr)[source]¶
Read LinkDataSources attribute
- Parameters:
attr (
tango.Attribute) – read attribute
- read_MacroServer(attr)[source]¶
Read MacroServer attribute
- Parameters:
attr (
tango.Attribute) – read attribute
- read_MntGrp(attr)[source]¶
Read MntGrp attribute
- Parameters:
attr (
tango.Attribute) – read attribute
- read_ProfileConfiguration(attr)[source]¶
Read ProfileConfiguration attribute
- Parameters:
attr (
tango.Attribute) – read attribute
- read_ProfileFile(attr)[source]¶
Read ProfileFile attribute
- Parameters:
attr (
tango.Attribute) – read attribute
- read_ScanDir(attr)[source]¶
Read ScanDir attribute
- Parameters:
attr (
tango.Attribute) – read attribute
- read_ScanFile(attr)[source]¶
Read ScanFile attribute
- Parameters:
attr (
tango.Attribute) – read attribute
- read_ScanID(attr)[source]¶
Read ScanID attribute
- Parameters:
attr (
tango.Attribute) – read attribute
- read_StepDataSources(attr)[source]¶
Read StepDataSources attribute
- Parameters:
attr (
tango.Attribute) – read attribute
- read_UserData(attr)[source]¶
Read UserData attribute
- Parameters:
attr (
tango.Attribute) – read attribute
- read_Version(attr)[source]¶
Read Version attribute
- Parameters:
attr (
tango.Attribute) – read attribute
- read_WriterDevice(attr)[source]¶
Read WriterDevice attribute
- Parameters:
attr (
tango.Attribute) – read attribute
- write_AppendEntry(attr)[source]¶
Write AppendEntry attribute
- Parameters:
attr (
tango.Attribute) – written attribute
- write_CanFailDataSources(attr)[source]¶
Write CanFailDataSources attribute
- Parameters:
attr (
tango.Attribute) – written attribute
- write_ConfigDevice(attr)[source]¶
Write ConfigDevice attribute
- Parameters:
attr (
tango.Attribute) – written attribute
- write_ConfigVariables(attr)[source]¶
Write ConfigVariables attribute
- Parameters:
attr (
tango.Attribute) – written attribute
- write_DeviceGroups(attr)[source]¶
Write DeviceGroups attribute
- Parameters:
attr (
tango.Attribute) – written attribute
- write_Door(attr)[source]¶
Write Door attribute
- Parameters:
attr (
tango.Attribute) – written attribute
- write_ExtraLinkDataSources(attr)[source]¶
Write ExtraLinkDataSources attribute
- Parameters:
attr (
tango.Attribute) – written attribute
- write_LinkDataSources(attr)[source]¶
Write LinkDataSources attribute
- Parameters:
attr (
tango.Attribute) – written attribute
- write_MntGrp(attr)[source]¶
Write MntGrp attribute
- Parameters:
attr (
tango.Attribute) – written attribute
- write_ProfileConfiguration(attr)[source]¶
Write ProfileConfiguration attribute
- Parameters:
attr (
tango.Attribute) – written attribute
- write_ProfileFile(attr)[source]¶
Write ProfileFile attribute
- Parameters:
attr (
tango.Attribute) – written attribute
- write_ScanDir(attr)[source]¶
Write ScanDir attribute
- Parameters:
attr (
tango.Attribute) – written attribute
- write_ScanFile(attr)[source]¶
Write ScanFile attribute
- Parameters:
attr (
tango.Attribute) – written attribute
- write_ScanID(attr)[source]¶
Write ScanID attribute
- Parameters:
attr (
tango.Attribute) – written attribute
- write_StepDataSources(attr)[source]¶
Write StepDataSources attribute
- Parameters:
attr (
tango.Attribute) – written attribute
- write_UserData(attr)[source]¶
Write UserData attribute
- Parameters:
attr (
tango.Attribute) – written attribute
- write_WriterDevice(attr)[source]¶
Write WriterDevice attribute
- Parameters:
attr (
tango.Attribute) – written attribute
- class nxsrecconfig.NXSConfig.NXSRecSelectorClass(name)[source]¶
Bases:
DeviceClassNXSRecSelectorclass Constructor
- attr_list = {'AppendEntry': [[tango._tango.CmdArgType.DevBoolean, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'description': 'flag for entry appending', 'label': 'Append Entry'}], 'Backend': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ], {'description': 'scan backend, i.e. sardana, bliss or null', 'label': 'Backend'}], 'CacheComponent': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ], {'description': 'current cache compoent name', 'label': 'CacheComponent'}], 'CanFailDataSources': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'Display level': tango._tango.DispLevel.EXPERT, 'description': 'list of datasources to be switched into canfail mode', 'label': 'list of datasources to be switch into canfail mode'}], 'Components': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SPECTRUM, tango._tango.AttrWriteType.READ, 10000], {'description': 'list of Selected Components', 'label': 'Selected Components'}], 'ConfigDevice': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'Memorized': 'true', 'description': 'Configuration device name', 'label': 'Configuration Device'}], 'ConfigVariables': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'Display level': tango._tango.DispLevel.EXPERT, 'description': 'JSON dictionary with configuration variablesfor templated components', 'label': 'Configuration Variables'}], 'DataSources': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SPECTRUM, tango._tango.AttrWriteType.READ, 10000], {'description': 'list of Selected Datasources', 'label': 'Selected Datasources'}], 'DescriptionErrors': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SPECTRUM, tango._tango.AttrWriteType.READ, 10000], {'description': 'list of Descriptive Component Errors', 'label': 'Descriptive Component Errors'}], 'DeviceGroups': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'Display level': tango._tango.DispLevel.EXPERT, 'Memorized': 'true', 'description': 'JSON dictionary with device groups', 'label': 'Device groups'}], 'Door': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'Memorized': 'true', 'description': 'Door device name', 'label': 'Door'}], 'ExtraLinkDataSources': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'Display level': tango._tango.DispLevel.EXPERT, 'description': 'list of datasources to which an extra link will be added', 'label': 'list of datasources to which a extra link will be added'}], 'LinkDataSources': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'Display level': tango._tango.DispLevel.EXPERT, 'description': 'list of datasources to which a link will be added', 'label': 'list of datasources to which a link will be added'}], 'MacroServer': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ], {'description': 'Macro Server device name', 'label': 'MacroServer'}], 'MntGrp': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'description': ' Measurement Group name', 'label': ' Measurement Group'}], 'ProfileConfiguration': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'Display level': tango._tango.DispLevel.EXPERT, 'description': 'JSON dict of server configuration', 'label': 'Profile Configuration'}], 'ProfileFile': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'Memorized': 'true', 'description': 'config file with its full path', 'label': 'Profile File with its Path'}], 'ScanDir': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'description': 'Scan Directory', 'label': 'Scan Directory'}], 'ScanFile': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'description': 'Scan File(s)', 'label': 'Scan File(s)'}], 'ScanID': [[tango._tango.CmdArgType.DevLong, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'description': 'Scan ID', 'label': 'Scan ID'}], 'StepDataSources': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'Display level': tango._tango.DispLevel.EXPERT, 'description': 'list of datasources to be switched into step mode', 'label': 'list of datasources to be switch into step mode'}], 'UserData': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'Display level': tango._tango.DispLevel.EXPERT, 'description': 'JSON dictionary with User Data', 'label': 'Client Data'}], 'Version': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ], {'description': 'server version', 'label': 'Version'}], 'WriterDevice': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'description': 'Writer device device name', 'label': 'Writer Device'}]}¶
- class_property_list = {}¶
(
dict<str, [str,tango.CmdArgType, [list<int> ] ] > ) Class Properties
- cmd_list = {'AddStepDataSources': [[tango._tango.CmdArgType.DevVarStringArray, 'list of required datasources'], [tango._tango.CmdArgType.DevVarStringArray, 'list of datasources not found in components']], 'AdministratorDataNames': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'administrator data names']], 'AvailableComponents': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'list of available component names']], 'AvailableDataSources': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'list of available DataSource names']], 'AvailableMntGrps': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'list of available mntgrp names']], 'AvailableProfiles': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'list of available selection names']], 'AvailableTimers': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'list of available timers']], 'CacheWriterConfiguration': [[tango._tango.CmdArgType.DevVarStringArray, 'list of required components'], [tango._tango.CmdArgType.DevString, 'XML Cache']], 'ChannelProperties': [[tango._tango.CmdArgType.DevString, 'property type'], [tango._tango.CmdArgType.DevString, 'JSON dictionary with channel properties {channel:property}']], 'ClearCache': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVoid, '']], 'ComponentClientSources': [[tango._tango.CmdArgType.DevVarStringArray, 'list of component client datasources'], [tango._tango.CmdArgType.DevString, 'JSON with description of component CLIENT Datasources']], 'ComponentDataSources': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'profile component datasources']], 'ComponentDescription': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevString, 'JSON component description']], 'ComponentSources': [[tango._tango.CmdArgType.DevVarStringArray, 'list of components'], [tango._tango.CmdArgType.DevString, 'JSON with description of component Datasources']], 'CreateDataSources': [[tango._tango.CmdArgType.DevString, 'JSON dictionary with {``dsname``: ``tangosource``, ...}'], [tango._tango.CmdArgType.DevVoid, '']], 'CreateDynamicComponent': [[tango._tango.CmdArgType.DevVarStringArray, 'list of JSON strings with datasource parameters'], [tango._tango.CmdArgType.DevString, 'name of dynamic Component']], 'CreateWriterConfiguration': [[tango._tango.CmdArgType.DevVarStringArray, 'list of required components'], [tango._tango.CmdArgType.DevString, 'XML Settings']], 'DataSourceDescription': [[tango._tango.CmdArgType.DevVarStringArray, 'list of required datasources'], [tango._tango.CmdArgType.DevVarStringArray, 'list of JSON with description of CLIENT Datasources']], 'DeleteAllProfiles': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVoid, '']], 'DeleteProfile': [[tango._tango.CmdArgType.DevString, 'mntgrp name'], [tango._tango.CmdArgType.DevVoid, '']], 'ExportEnvProfile': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVoid, '']], 'FetchProfile': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVoid, '']], 'FullDeviceNames': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevString, 'JSON Dictionary with full device names for all aliases ']], 'ImportEnvProfile': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVoid, '']], 'ImportMntGrp': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVoid, '']], 'IsMntGrpUpdated': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevBoolean, 'true if mntgrp changed']], 'LoadProfile': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVoid, '']], 'MandatoryComponents': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'component names']], 'MntGrpConfiguration': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevString, 'mntgrp configuration string']], 'MutedChannels': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'list of muted channels']], 'PoolElementNames': [[tango._tango.CmdArgType.DevString, 'pool list attribute name'], [tango._tango.CmdArgType.DevVarStringArray, 'list of available pool elements']], 'PreselectComponents': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVoid, '']], 'PreselectedComponents': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'component names']], 'PreselectedDataSources': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'datasources names']], 'RemoveDynamicComponent': [[tango._tango.CmdArgType.DevString, 'name of dynamic Component'], [tango._tango.CmdArgType.DevVoid, '']], 'ResetPreselectedComponents': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVoid, '']], 'SaveProfile': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVoid, '']], 'ScanEnvVariables': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevString, 'environment data']], 'SelectedComponents': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'component names']], 'SelectedDataSources': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'profile datasources']], 'SetChannelProperties': [[tango._tango.CmdArgType.DevVarStringArray, 'a two element list with a property type and JSON value dictionary {channel:property}'], [tango._tango.CmdArgType.DevVoid, '']], 'SetScanEnvVariables': [[tango._tango.CmdArgType.DevString, 'environment data'], [tango._tango.CmdArgType.DevLong, 'scanID']], 'StoreProfile': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVoid, '']], 'SwitchProfile': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVoid, '']], 'SyncProfile': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVoid, '']], 'UpdateConfigVariables': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVoid, '']], 'UpdateMntGrp': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevString, 'configuration']], 'UpdateProfile': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevString, 'mntgrp configuration string']], 'VariableComponents': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevString, 'JSON Dictionary with all Components for configuration variable']]}¶
(
dict<str, [[tango.CmdArgType,str]] >) Command definitions
- device_property_list = {'AdminDataNames': [tango._tango.CmdArgType.DevVarStringArray, 'list of administrator data names', []], 'Backend': [tango._tango.CmdArgType.DevString, 'scan backend, i.e. sardana, bliss or null (without scan control system)', ['sardana']], 'CacheConfiguration': [tango._tango.CmdArgType.DevBoolean, 'cache writer configuration in configuration server as \n__configuration_<profile_name>__ components', [False]], 'CheckDescription': [tango._tango.CmdArgType.DevBoolean, 'apply checks for preselected components', [True]], 'ClientRecordKeys': [tango._tango.CmdArgType.DevVarStringArray, 'list of record keys for CLIENT datasources', []], 'DefaultCanFailDataSources': [tango._tango.CmdArgType.DevVarStringArray, 'list of default datasources in the CanFail mode', []], 'DefaultMntGrp': [tango._tango.CmdArgType.DevString, 'default measurement group name', ['nxsmntgrp']], 'DefaultNeXusPath': [tango._tango.CmdArgType.DevString, 'default NeXus path', ["/$var.entryname#'scan'$var.serialno:NXentry/instrument:NXinstrument/collection"]], 'DefaultNeXusType': [tango._tango.CmdArgType.DevString, 'default dynamic component NeXus data type', ['NX_CHAR']], 'DefaultPreselectedComponents': [tango._tango.CmdArgType.DevVarStringArray, 'list of default preselected components', []], 'DefaultTimeZone': [tango._tango.CmdArgType.DevString, 'default Time Zone', ['Europe/Berlin']], 'DefaultUserDataPath': [tango._tango.CmdArgType.DevString, 'default NeXus User Data path', ["/$var.entryname#'scan'$var.serialno:NXentry/user_data:NXparameters"]], 'GlobalUserData': [tango._tango.CmdArgType.DevBoolean, 'use global user data dictionary', [False]], 'MasterTimer': [tango._tango.CmdArgType.DevBoolean, 'set the master timer/monitor channel for older MG', [False]], 'MasterTimerFirst': [tango._tango.CmdArgType.DevBoolean, 'the master timer channel of MG with the index: 0', [True]], 'MergeProfilesToMntGrps': [tango._tango.CmdArgType.DevBoolean, 'merge profiles to available measurement groups', [False]], 'MutedChannelFilters': [tango._tango.CmdArgType.DevVarStringArray, 'list of muted channel filters', []], 'MutedMotorFilters': [tango._tango.CmdArgType.DevVarStringArray, 'list of muted motor filters', []], 'MutedPreScanAttrFilters': [tango._tango.CmdArgType.DevVarStringArray, 'list of muted attribute channel filters for PreScanSnapshot', []], 'NumberOfThreads': [tango._tango.CmdArgType.DevLong, 'maximal number of threads', [20]], 'PoolBlacklist': [tango._tango.CmdArgType.DevVarStringArray, 'blacklist of pools', []], 'ResetInvalidDoor': [tango._tango.CmdArgType.DevBoolean, 'reset Door when it is invalid', [True]], 'SyncMntGrp': [tango._tango.CmdArgType.DevBoolean, 'selection merges the current Measurement Group', [False]], 'SyncSnapshot': [tango._tango.CmdArgType.DevBoolean, 'preselection merges the current ScanSnapshot', [False]], 'TangoSourceErrorStates': [tango._tango.CmdArgType.DevVarStringArray, 'list of tango error states for tango datasources', ['OFF', 'INIT', 'INSERT', 'CLOSE', 'UNKNOWN', 'FAULT']], 'TangoSourceWarningStates': [tango._tango.CmdArgType.DevVarStringArray, 'list of tango warning states for tango datasources', ['ALARM', 'DISABLE']], 'TimerFilters': [tango._tango.CmdArgType.DevVarStringArray, 'list of timer device name filters', []], 'WriteAllMotorPositions': [tango._tango.CmdArgType.DevBoolean, 'add dynamic components for all pool motor positions', [False]], 'WritePoolMotorPositions': [tango._tango.CmdArgType.DevBoolean, 'add dynamic components for pool motor positions without any omponent', [False]]}¶
(
dict<str, [str,tango.CmdArgType, [list<int> ] ] > ) Device Properties
nxsrecconfig.ProfileManager module¶
ProfileManager
- nxsrecconfig.ProfileManager.DEFAULT_RECORD_KEYS = ['serialno', 'end_time', 'start_time', 'point_nb', 'timestamps', 'scan_title', 'filename', 'end_reason']¶
- class nxsrecconfig.ProfileManager.ProfileManager(selector, syncsnapshot=False, writepoolmotorpositions=False, writeallmotorpositions=False, syncmntgrp=False, checkdescription=True)[source]¶
Bases:
objectManages Measurement Group and Profile from Selector
constructor
- Parameters:
selector (
nxsrecconfig.Selector.Selector) – selector objectsyncsnapshot (
bool) – preselection merges current ScanSnapshotwritepoolmotorpositions (
bool) – add dynamic components for pool motor positions without any componentwriteallmotorpositions (
bool) – add dynamic components for all pool motor positionssyncmntgrp (
bool) – selection merges current Measurement Groupcheckdescription (
bool) – apply checks for preselected components
- cpdescription(full=False)[source]¶
provides description of components
- Parameters:
full (
bool) – if True describes all available ones are taken otherwise selectect, preselected and mandatory- Returns:
description of required components
- Return type:
[
dict<str,dict<str,list<(str,str,str,str,list<int>)> > > ] or [{“dsname”:str, “strategy”:str, “dstype”:str, “record”:str, “nxstype”:str, “shape”:list<int> , “cpname”:str}, …]
- fetchProfile(sync=False)[source]¶
fetches the profile configuration
- Parameters:
sync (
bool) – sync snapshot or motor positions
- isMntGrpUpdated()[source]¶
check if active measurement group was changed
- Returns:
True if it is different to the current setting
- Return type:
- mntGrpConfiguration()[source]¶
provides configuration of mntgrp
- Returns:
string with mntgrp configuration
- Return type:
- switchProfile(toActive=True)[source]¶
switchProfile to active measurement
- Parameters:
toActive (
bool) – if False update the current profile
nxsrecconfig.Release module¶
NeXus Sardana Recorder Settings - Release
nxsrecconfig.ScanBackend module¶
scan backend interface, i.e. the control system of the scans
The selector settings access the control system running the scans, e.g. Sardana, only via a scan backend: its scan environment, its channels (given by pools in Sardana), its measurement groups and its targets (doors in Sardana).
- class nxsrecconfig.ScanBackend.ScanBackend(numberOfThreads=None)[source]¶
Bases:
objectscan backend interface
constructor
- Parameters:
numberOfThreads (
str) – number of threads
- checkChannels(door, configdevice, channels, componentgroup, datasourcegroup, channelerrors)[source]¶
checks component channels
- Parameters:
door (
str) – door device nameconfigdevice (
tango.DeviceProxyornxsconfigserver.XMLConfigurator.XMLConfigurator) – configuration servercomponentgroup (
dict<str,bool>) – preselected component groupchannelerrors (
list<str>) – list of deactivated component errors
- Returns:
json dictionary with selected active components
- Return type:
- createMntGrp(pool, name, timer)[source]¶
creates a measurement group
- Parameters:
pool (
tango.DeviceProxy) – pool proxyname (
str) – measurement group nametimer (
str) – timer name
- dataSourceTypes = []¶
(
list<str>) types of STEP datasources without channels which are read by the scan system viaselectDataSources()
- defaultDoor(db)[source]¶
provides the default target of the scans
- Parameters:
db (
tango.Database) – tango database- Returns:
target name, e.g. door device name
- Return type:
- deleteMntGrp(pool, name)[source]¶
deletes a measurement group
- Parameters:
pool (
tango.DeviceProxy) – pool proxyname (
str) – measurement group name
- getPools(door)[source]¶
provides channel sources, i.e. sardana pool proxies
- Parameters:
door (
str) – target name, e.g. door device name- Returns:
pool proxies, an empty list without pools
- Return type:
- nonExistingChannels(door, channels)[source]¶
provides the channels which are not known to the backend
- selectChannels(ms, mntgrp, channels)[source]¶
selects channels of a measurement group of the scan system
It is used by backends without measurement group devices and with
selectsChannels
- selectDataSources(ms, mntgrp, datasources)[source]¶
- selects STEP datasources without channels of the scan system
to be read in scans of a measurement group
It is used by backends with
dataSourceTypes
- selectsChannels = False¶
(
bool) the backend selects channels of its measurement groups byselectChannels()for backends without measurement group devices
- testMntGrpConfiguration(device, conf)[source]¶
- provides the configuration the measurement group makes of conf
and restores its current configuration
nxsrecconfig.Selection module¶
Selection state
- class nxsrecconfig.Selection.Selection(*args, **kw)[source]¶
Bases:
dictSelection Dictionary which contains the following records: { “Timer”: ‘[]’, “OrderedChannels”: ‘[]’, “ComponentSelection”: ‘{}’, “DataSourceSelection”: ‘{}’, “DataSourcePreselection”: ‘{}’, “ComponentPreselection”: ‘{}’, “PreselectingDataSources”: ‘[]’, “OptionalComponents”: ‘[]’, “AppendEntry”: False, “ComponentsFromMntGrp”: False, “ConfigVariables”: ‘{}’, “UserData”: ‘{}’, “ChannelProperties”: ‘{}’, “UnplottedComponents”: ‘[]’, “DynamicComponents”: True, “DefaultDynamicLinks”: True, “DefaultDynamicPath”: ‘/$var.entryname#’scan’$var.serialno:NXentry’ ‘/instrument:NXinstrument/collection’, “TimeZone”: self.__defaultzone, “ConfigDevice”: ‘’, “WriterDevice”: ‘’, “Door”: ‘’, “MntGrp”: ‘’, “Version”: self.__version, “MntGrpConfiguration”: ‘’ }
constructor
- resetMntGrp()[source]¶
reset method for mntGrp attribute
- Brief:
If MntGrp not defined set it to default value
- resetPreselectedComponents(components)[source]¶
resets Preselected Components with given components and set them to not active :param components: list of components to be set :type components:
list<str>
- resetTimeZone()[source]¶
reset method for timeZone attribute
- Brief:
If TimeZone not defined set it to default value
- updateChannelProperties(devicecontrollers, triggergate)[source]¶
update method for orderedChannels attribute
- updateComponentSelection()[source]¶
update method for componentGroup attribute
- Brief:
It removes datasource components from component group
- updateDataSourceSelection(channels, datasources)[source]¶
update method for dataSourceGroup attribute
nxsrecconfig.Selector module¶
Selection state
- class nxsrecconfig.Selector.Selector(macroserverpools, version, defaultpath="/$var.entryname#'scan'$var.serialno:NXentry/instrument:NXinstrument/collection", defaulttimezone='Europe/Berlin', defaultmntgrp='nxsmntgrp')[source]¶
Bases:
objectaccess class to Selection dictionary and Config Device
constructor
- Parameters:
macroserverpools (
nxsrecconfig.MacroServerPools.MacroServerPools) – MacroServerPools objectversion (
str) – selector versiondefaultpath (
str) – default dynamic component pathdefaultpath – default dynamic component path
defaulttimezone (
str) – default time zonedefaultmntgrp (
str) – default measurement group name
- property backend¶
scan backend
- Returns:
scan backend
- Return type:
- configCommand(command, *var)[source]¶
executes command on configuration server
- Parameters:
command (
str) – command namevar ([ any ]) – parameter list
- Returns:
command result
- Return type:
any
- getScanEnvVariables()[source]¶
gets Scan Environment Data
- Returns:
JSON String with important variables
- Return type:
- preselect()[source]¶
updates active state of preselected components
- Brief:
It provides new group of preselected components
- resetPreselectedComponents(components)[source]¶
resets preselected components to set of given components
- setConfigInstance()[source]¶
sets config instances
- Returns:
set config instance
- Return type:
tango.DeviceProxyornxsconfigserver.XMLConfigurator.XMLConfigurator
nxsrecconfig.Settings module¶
NeXus Sardana Recorder Settings implementation
- class nxsrecconfig.Settings.Settings(server=None, numberofthreads=None, defaultnexuspath=None, defaulttimezone=None, defaultmntgrp=None, syncsnapshot=False, writepoolmotorpositions=False, writeallmotorpositions=False, defaultnexustype=None, defaultudatapath=None, globaluserdata=False, cacheconfiguration=False, syncmntgrp=False, checkdescription=True, backend=None)[source]¶
Bases:
objectNeXus Sardana Recorder settings
contructor
- Parameters:
server (
nxsrecconfig.NXSConfig.NXSRecSelector) – NXSRecSelector servernumberofthreads (
str) – number of threads used to check device statedefaultnexuspath (
str) – default dynamic component pathsyncsnapshot (
bool) – preselection merges current ScanSnapshotwritepoolmotorpositions (
bool) – add dynamic components for all pool motor positionsdefaultnexustype (
str) – default dynamic component nexus typedefaultudatapath (
str) – default user data dynamic component pathglobaluserdata (
bool) – global user data flagcacheconfiguration (
bool) – cache writer configuration in configServersyncmntgrp (
bool) – selection merges current Measurement Groupcheckdescription (
bool) – apply checks for preselected componentsbackend (
str) – scan backend name, i.e.sardana,blissornull,sardanaif None
- componentDescription()[source]¶
provides description of all components
- Returns:
JSON string with description of all components
- Return type:
- createDataSources(datasources)[source]¶
describe datasources
- Parameters:
datasources (
str) – JSON dictionary with {dsname:tangosource, …}
- createWriterConfiguration(cps)[source]¶
create configuration and clean stepdatasources and linkdatasources
- fullDeviceNames()[source]¶
provides full names of pool devices
- Returns:
JSON string with full names of pool devices
- Return type:
- isMntGrpUpdated()[source]¶
check if active measurement group was changed
- Returns:
True if it is different to the current setting
- Return type:
- mntGrpConfiguration()[source]¶
provides configuration of mntgrp
- Returns:
string with mntgrp configuration
- Return type:
- removeDynamicComponent(name)[source]¶
removes dynamic component
- Parameters:
name (
str) – dynamic component name
- property scanDir¶
the json data string
- scanEnvVariables()[source]¶
gets Scan Environment Data
- Returns:
JSON String with important variables
- Return type:
- selectedDataSources()[source]¶
provides selected datasources
- Returns:
list of available selected datasources
- setScanEnvVariables(jdata)[source]¶
sets Scan Environment Data
- Parameters:
jdata (
str) – JSON String with important variables
- switchProfile(toActive=True)[source]¶
switch to active measurement
- Parameters:
toActive (
bool) – if False update the current profile
- updateConfigVariables()[source]¶
sends ConfigVariables into ConfigServer and updates serialno if appendEntry selected
- updateMntGrp()[source]¶
set active measurement group from components
- Returns:
string with mntgrp configuration
- Return type:
- updateProfile()[source]¶
update profile and measurement group
- Returns:
string with mntgrp configuration
- Return type:
- value(name)[source]¶
provides values of the required variable
- Parameters:
name (
str) – name of the required variable- Returns:
values of the required variable
- Return type:
any
- variableComponents()[source]¶
provides components for all variables
- Returns:
json dictionary with components for all variables
- Return type:
nxsrecconfig.StreamSet module¶
labels to Tango Streams
- class nxsrecconfig.StreamSet.StreamSet(streams)[source]¶
Bases:
objectstreamset constractor
- Parameters:
streams (
StreamSetortango.LatestDeviceImpl) – tango-like steamset class
- log_debug¶
(
tango.log4tango.TangoStream) Tango debug log stream
- log_error¶
(
tango.log4tango.TangoStream) Tango error log stream
- log_fatal¶
(
tango.log4tango.TangoStream) Tango fatal log stream
- log_info¶
(
tango.log4tango.TangoStream) Tango info log stream
- log_warn¶
(
tango.log4tango.TangoStream) Tango warn log stream
nxsrecconfig.Utils module¶
Tango Utilities
- class nxsrecconfig.Utils.MSUtils[source]¶
Bases:
objectMacroServer Utilities
- classmethod getMacroServer(db, door, find=True)[source]¶
provides macro server of given door
- Parameters:
db (
tango.Database) – tango databasedoor (
str) – given doorfind (
bool) – find new macroserver if door does not exist
- Returns:
first MacroServer of the given door
- Return type:
- exception nxsrecconfig.Utils.OldTangoError[source]¶
Bases:
ExceptionOld Tango version Exception class
- nxsrecconfig.Utils.PYTG_BUG_213 = False¶
(
bool) tango bug #213 flag related to EncodedAttributes in python3
- class nxsrecconfig.Utils.PoolUtils[source]¶
Bases:
objectPool Utilities
- classmethod getDeviceControllers(pools, devices=None)[source]¶
provides device controller full names
- classmethod getElementNames(pools, listattr, typefilter=None)[source]¶
provides experimental Channels
- classmethod getFullDeviceNames(pools, names=None, listattr='AcqChannelList', lastsubterm=-1)[source]¶
find device names from aliases
- Parameters:
- Returns:
full device name
- Return type:
- classmethod getMntGrpName(pools, alias)[source]¶
find measurement group name from alias
- Parameters:
pools (
list<tango.DeviceProxy>) – list of pool devicesalias (
str) – mntgrp alias
- Returns:
full name of the measurement group alias
- Return type:
- class nxsrecconfig.Utils.TangoUtils[source]¶
Bases:
objectTango Utilities
- classmethod command(server, command, *var)[source]¶
executes command on server on python package
- Parameters:
server (
tango.DeviceProxyornxsconfigserver.XMLConfigurator.XMLConfigurator) – tango server name or package namecommand (
str) – command namevar ([ any ]) – command variable list
- Returns:
command result
- Return type:
any
- classmethod getDeviceName(db, cname)[source]¶
finds device of give class
- Parameters:
db (
tango.DeviceProxy) – tango databasecname (
str) – device class name
- Returns:
device name if exists
- Return type:
- classmethod getFullAttrName(source, fqdn=False)[source]¶
provides tango device full name with host and port
- classmethod getProxies(names)[source]¶
provides proxies of given device names
- Parameters:
- Returns:
list of device DeviceProxies
- Return type:
- classmethod openProxy(device, counter=1000)[source]¶
opens device proxy of the given device
- Parameters:
device (
str) – device name- Returns:
DeviceProxy of device
- Return type:
- tTnp = {tango._tango.CmdArgType.DevBoolean: 'bool', tango._tango.CmdArgType.DevShort: 'int16', tango._tango.CmdArgType.DevLong: 'int32', tango._tango.CmdArgType.DevFloat: 'float32', tango._tango.CmdArgType.DevDouble: 'float64', tango._tango.CmdArgType.DevUShort: 'uint16', tango._tango.CmdArgType.DevULong: 'uint32', tango._tango.CmdArgType.DevString: 'string', tango._tango.CmdArgType.DevUChar: 'uint8', tango._tango.CmdArgType.DevLong64: 'int64', tango._tango.CmdArgType.DevULong64: 'uint64', tango._tango.CmdArgType.DevEncoded: 'encoded'}¶
(
dict<tango.CmdArgType,str>) map of Tango:Numpy types
- classmethod wait(proxy, counter=100, state='RUNNING')[source]¶
waits for device proxy not running
- Parameters:
proxy (
tango.DeviceProxy) – device proxy- Returns:
if proxy device ready
- Return type:
- class nxsrecconfig.Utils.Utils[source]¶
Bases:
objectMiscellaneous Utilities
- MNTGRP_RUNTIME_CHANNEL_KEYS = ['value_stream_ref']¶
(
list<str>) channel keys of measurement group configurations set by Sardana with blissdata publishing, e.g. stream references of running scans
- MNTGRP_RUNTIME_CTRL_KEYS = ['streamable']¶
(
list<str>) controller keys of measurement group configurations set by Sardana with blissdata publishing
- classmethod dataSourceNode(xml)[source]¶
provides the datasource node of a datasource XML definition
- Parameters:
xml (
str) – datasource XML definition- Returns:
datasource node or None
- Return type:
lxml.etree.Element
- classmethod getRecord(node)[source]¶
provides datasource record from xml dom node
- Parameters:
node (
lxml.etree.Element) – xml DOM node- Returns:
datasource record
- Return type:
- classmethod getText(node)[source]¶
collects text from text child nodes
- Parameters:
node (
xml.etree.ElementTree.Element) – parent node
- classmethod pickleloads(bytestr)[source]¶
loads pickle byte string :param bytestr: byte string to convert :type bytesstr:
bytes:returns: loaded bytestring :rtype:any
- classmethod stripMntGrpRuntimeKeys(conf)[source]¶
- removes keys of measurement group configurations which are
set by Sardana at runtime, i.e. stream references of scans and streamable controller flags of blissdata publishing
nxsrecconfig.WriterConfiguration module¶
NXSDataWriter configuration of a selector profile and scan
It creates the XML configuration of NXSDataWriter for a scan from the profile of NXSRecSelector, i.e. the selected components, datasources, user data and configuration variables, and from the scan channels. It is used by the Sardana NeXus recorder and can be used by other scan systems, e.g. BLISS.
- class nxsrecconfig.WriterConfiguration.NumpyEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]¶
Bases:
JSONEncoderJSON encoder of numpy values
Constructor for JSONEncoder, with sensible defaults.
If skipkeys is false, then it is a TypeError to attempt encoding of keys that are not str, int, float, bool or None. If skipkeys is True, such items are simply skipped.
If ensure_ascii is true, the output is guaranteed to be str objects with all incoming non-ASCII characters escaped. If ensure_ascii is false, the output can contain non-ASCII characters.
If check_circular is true, then lists, dicts, and custom encoded objects will be checked for circular references during encoding to prevent an infinite recursion (which would cause an RecursionError). Otherwise, no such check takes place.
If allow_nan is true, then NaN, Infinity, and -Infinity will be encoded as such. This behavior is not JSON specification compliant, but is consistent with most JavaScript based encoders and decoders. Otherwise, it will be a ValueError to encode such floats.
If sort_keys is true, then the output of dictionaries will be sorted by key; this is useful for regression tests to ensure that JSON serializations can be compared on a day-to-day basis.
If indent is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. None is the most compact representation.
If specified, separators should be an (item_separator, key_separator) tuple. The default is (’, ‘, ‘: ‘) if indent is
Noneand (‘,’, ‘: ‘) otherwise. To get the most compact JSON representation, you should specify (‘,’, ‘:’) to eliminate whitespace.If specified, default is a function that gets called for objects that can’t otherwise be serialized. It should return a JSON encodable version of the object or raise a
TypeError.
- class nxsrecconfig.WriterConfiguration.WriterConfiguration(selector, conf=None, variables=None, log=None, getalias=None, moveables=None, oddmntgrp=False, cacheprefix='__configuration_', dynamiccp='__dynamic_component__')[source]¶
Bases:
objectNXSDataWriter configuration of a selector profile and scan
constructor
- Parameters:
selector (
tango.DeviceProxyor any) – NXSRecSelector device proxy ornxsrecconfig.Settings.Settingsconf (
dict<str, any>) – profile configuration of the selectorvariables (
dict<str, any>) – configuration variables, extended by the created configuration, e.g.nexus_componentslog (
logging.Loggeror any) – logger with debug, info and warning methodsgetalias (callable) – provides an alias of a channel or None, tango aliases by default
moveables (callable) – provides moveable names of the scan system, used for cache components
oddmntgrp (
bool) – measurement group not defined by the selector, i.e. profile variables are not usedcacheprefix (
str) – prefix of cache componentsdynamiccp (
str) – initial dynamic component name
- confVar(var, default, decode=False, pass_default=False)[source]¶
provides a variable of the profile configuration
- create(envRec, userdata)[source]¶
creates the NXSDataWriter configuration
The created dynamic component has to be removed with
removeDynamicComponent()when the scan ends.
- createDynamicComponent(envRec, dss, keys, udata, nexuscomponents)[source]¶
creates a dynamic component
- getalias¶
(callable) alias provider
- log¶
(
logging.Loggeror any) logger
- moveables¶
(callable) moveable name provider
- searchDataSources(nexuscomponents, cfm, dyncp, userkeys)[source]¶
searches the datasources of the scan in the components
- selector¶
(
tango.DeviceProxyor any) selector
Module contents¶
NeXus Sardana Recorder Settings - Tango Server