nxsblisswriter package¶
Submodules¶
nxsblisswriter.NXSFile module¶
Provides the access to a database with NDTS configuration files
- class nxsblisswriter.NXSFile.NXSFile(scan, fpath, streams, default_nexus_path='/scan{serialno}:NXentry/instrument:NXinstrument/collection', max_write_interval=1)[source]¶
Bases:
objectconstructor
- Parameters:
scan (
blissdata.redis_engine.scan.Scan) – blissdata scanfpath (
pathlib.Path) – nexus file pathstreams (
StreamSetortango.LatestDeviceImpl) – tango-like steamset classdefault_nexus_path (
str) – default nexus pathmax_write_interval (
int) – max write interval
- property channels¶
- property labels¶
- nxsblisswriter.NXSFile.create_nexus_file(scan, streams, default_nexus_path='/scan{serialno}:NXentry/instrument:NXinstrument/collection')[source]¶
open nexus file
- Parameters:
scan (
blissdata.redis_engine.scan.Scan) – blissdata scanstreams (
StreamSetortango.LatestDeviceImpl) – tango-like steamset classdefault_nexus_path (
str) – default nexus path
- Returns:
nexus file object
- Return type:
nxsblisswriter.Release module¶
release version module
nxsblisswriter.NXSBlissWriter module¶
NeXus Bliss Writer
NeXus Bliss Writer stores (meta)data from blissdata provided by NXSDataWriter
- class nxsblisswriter.NXSBlissWriter.NXSBlissWriter(cl, name)[source]¶
Bases:
DeviceNeXus Bliss Writer stores (meta)data from blissdata provided by NXSDataWriter
Properties:
- Device Property
- RedisUrl
Dlissdata redis url
Type:’str’
- Session
session to be recorder
Type:’str’
- NextScanTimeout
timeout for next scan writing
Type:’int’
- DefaultNeXusPath
default NeXus path
Type:’str’
- PointSleepTime
sleep time between write_point command calls
Type:’float’
- DefaultNeXusPath¶
default NeXus path
- NextScanTimeout¶
timeout for next scan writing
- PointSleepTime¶
sleep time between write_point command calls
- RedisUrl¶
Blissdata redis url
- Session¶
session to be recorder
- Start()[source]¶
‘Start’ TANGO command
- Parameters:
arg (DevVoid) – (not documented)
- Returns:
(not documented)
- Return type:
DevVoid
- Stop()[source]¶
‘Stop’ TANGO command
- Parameters:
arg (DevVoid) – (not documented)
- Returns:
(not documented)
- Return type:
DevVoid
- TangoClassClass¶
alias of
NXSBlissWriterClass
- TangoClassName = 'NXSBlissWriter'¶
- dev_status(self) str[source]¶
Get device status.
Default method to get device status. It returns the contents of the device dev_status field. If the device state is ALARM, alarm messages are added to the device status. This method can be redefined in sub-classes in case of the default behaviour does not fullfill the needs.
- Returns:
the device status
- Return type:
- Raises:
DevFailed – If it is necessary to read attribute(s) and a problem occurs during the reading
nxsblisswriter.NXSWriterService module¶
Provides the access to a database with NDTS configuration files
- class nxsblisswriter.NXSWriterService.NXSWriterService(redis_url, session, next_scan_timeout, default_nexus_path='/scan{serialno}:NXentry/instrument:NXinstrument/collection', point_sleep_time=0.01, server=None)[source]¶
Bases:
objectconstructor
- Parameters:
redis_url (
str) – blissdata redis urlsession (
str) – blissdata session namenext_scan_timeout (
int) – timeout between the scans in secondsdefault_nexus_path (
str) – default nexus pathpoint_sleep_time (
float) – sleep time between write point callsserver (
tango.LatestDeviceImpl) – NXSConfigServer instance
Module contents¶
Implementation of NexDaTaS Configuration Server
- nxsblisswriter.run(classes, args=None, msg_stream=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, verbose=False, util=None, event_loop=None, pre_init_callback=None, post_init_callback=None, green_mode=None, raises=False, err_stream=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>)[source]¶
Provides a simple way to run a tango server. It handles exceptions by writting a message to the msg_stream.
- Examples:
Example 1: registering and running a PowerSupply inheriting from
Device:from tango.server import Device, run class PowerSupply(Device): pass run((PowerSupply,))
Example 2: registering and running a MyServer defined by tango classes MyServerClass and MyServer:
from tango import Device_4Impl, DeviceClass from tango.server import run class MyServer(Device_4Impl): pass class MyServerClass(DeviceClass): pass run({'MyServer': (MyServerClass, MyServer)})
Example 3: registering and running a MyServer defined by tango classes MyServerClass and MyServer:
from tango import Device_4Impl, DeviceClass from tango.server import Device, run class PowerSupply(Device): pass class MyServer(Device_4Impl): pass class MyServerClass(DeviceClass): pass run([PowerSupply, [MyServerClass, MyServer]]) # or: run({'MyServer': (MyServerClass, MyServer)})
Note
the order of registration of tango classes defines the order tango uses to initialize the corresponding devices. if using a dictionary as argument for classes be aware that the order of registration becomes arbitrary. If you need a predefined order use a sequence or an OrderedDict.
- Parameters:
classes (Sequence[tango.server.Device] | dict) –
Defines for which Tango Device Classes the server will run. If
dictis provided, it’s key is the tango class name and value is either:two element sequence:DeviceClass,DeviceImplargs (list) – list of command line arguments [default: None, meaning use sys.argv]
msg_stream – stream where to put messages [default: sys.stdout]
util (
Util) – PyTango Util object [default: None meaning create a Util instance]event_loop (callable) – event_loop callable
pre_init_callback (callable or tuple) – an optional callback that is executed between the calls Util.init and Util.server_init The optional pre_init_callback can be a callable (without arguments) or a tuple where the first element is the callable, the second is a list of arguments (optional) and the third is a dictionary of keyword arguments (also optional).
post_init_callback (callable or tuple) – an optional callback that is executed between the calls Util.server_init and Util.server_run The optional post_init_callback can be a callable (without arguments) or a tuple where the first element is the callable, the second is a list of arguments (optional) and the third is a dictionary of keyword arguments (also optional).
raises (bool) – Disable error handling and propagate exceptions from the server
err_stream – stream where to put catched exceptions [default: sys.stderr]
- Returns:
The Util singleton object
- Return type:
New in version 8.1.2.
Changed in version 8.1.4: when classes argument is a sequence, the items can also be a sequence <TangoClass, TangoClassClass>[, tango class name]
Changed in version 9.2.2: raises argument has been added
Changed in version 9.5.0: pre_init_callback argument has been added
Changed in version 10.0.0: err_stream argument has been added