nxstools package

Submodules

nxstools.nxscollect module

Command-line tool to merge images of external file-formats into the master NeXus file

class nxstools.nxscollect.Collector(nexusfilename, compression=2, skipmissing=False, storeold=False, testmode=False, writer=None)[source]

Bases: object

Collector merge images of external file-formats into the master NeXus file

The constructor creates the collector object

Parameters
  • nexusfilename (str) -- the nexus file name

  • compression (int) -- compression rate

  • skipmissing (bool) -- if skip missing images

  • storeold (bool) -- if backup the input file

  • testmode (bool) -- if run in a test mode

  • writer (str) -- the writer module

collect(path=None, inputfiles=None, datatype=None, shape=None)[source]

creates a temporary file, collects the all image files defined by hdf5 postrun fields of NXcollection groups and renames the temporary file to the origin one if the action was successful or appends specific data if path and inputfiles are given

Parameters
  • path (str) -- nexus path of the data field

  • inputfiles (list <str>) -- a list of file strings

  • datatype (str) -- field data type

  • shape (list <int >) -- field shape

class nxstools.nxscollect.Execute(parser)[source]

Bases: nxstools.nxsargparser.Runner

Execute runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'append images to the master file'

(str) command description

epilog = " examples:\n nxscollect append -c1 /tmp/gpfs/raw/scan_234.nxs \n\n nxscollect append -c32008:0,2 /ramdisk/scan_123.nxs \n\n nxscollect append --test /tmp/gpfs/raw/scan_234.nxs \n\n nxscollect append scan_234.nxs --path /scan/instrument/pilatus/data --input-files 'scan_%05d.tif:0:100' \n"

(str) command epilog

postauto()[source]

creates parser

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

class nxstools.nxscollect.LayoutField(target, hyperslab=None)[source]

Bases: object

constructor

Parameters
  • hyperslab (filewriter.FTHyperslab) -- target field object

  • hyperslab -- field hyperslab or slices

hyperslab

filewriter.FTHyperslab layout hyperslab or slices

shape

tuple vds shape in layout

slices

list <slice>

target

TargetFieldView target field object

Bases: nxstools.nxsargparser.Runner

Execute runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'create an external or internal link in the master file'

(str) command description

epilog = ' examples:\n nxscollect link scan_234.nxs://entry/instrument/lambda --name data --target scan_234/lambda.nxs://entry/data/data \n\nscan_234.nxs://entry/instrument/eiger:NXdetector --target scan_234/eiger.nxs://entry/data/data \n\n\n'

(str) command epilog

postauto()[source]

creates parser

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

class nxstools.nxscollect.Linker(nexusfilepath, target, name=None, storeold=False, testmode=False, writer=None)[source]

Bases: object

Create external and internal links of NeXus files

The constructor creates the collector object

Parameters
  • nexusfilepath (str) -- the nexus file name and nexus path

  • target (str) -- the nexus file name and nexus path

  • storeold (bool) -- if backup the input file

  • testmode (bool) -- if run in a test mode

  • writer (str) -- the writer module

creates NeXus link

class nxstools.nxscollect.TargetFieldView(filename, path, shape=None, hyperslab=None, maxshape=None)[source]

Bases: object

target field map

constructor

Parameters
  • filename (str) -- file name

  • path (str) -- nexus field path with its name

  • shape (list <int>) -- field shape

  • hyperslab (filewriter.FTHyperslab) -- field hyperslab or slices

  • maxshape (list <int>) -- maximal field shape

filename

str file name

hyperslab

filewriter.FTHyperslab field hyperslab or slices

maxshape

list <int> field maximal shape

path

str nexus field path with its name

shape

list <int> field shape

slices

list <slice>

class nxstools.nxscollect.TargetFieldsLayout(exfieldpaths='', exfieldshapes='', shapes=None, separator=',')[source]

Bases: list

constructor

Parameters
  • exfieldpaths (str) -- target field paths

  • exfieldshapes (str) -- target field shapes

  • shapes (list`<:obj:`tuple`<:obj:`int> >) -- target field shapes

  • exfieldpaths -- separator of field path strings

add_layout_hyperslabs(offsets, blocks, counts, strides)[source]

add layout hyperslabs

Parameters
  • offsets (str) -- layout offsets

  • blocks (str) -- layout blocks

  • counts (str) -- layout counts

  • strides (str) -- layout strides

add_layout_slices(slices)[source]

add layout slices

Parameters

slices (str) -- layout slices

add_target_hyperslabs(offsets, blocks, counts, strides)[source]

add target hyperslabs

Parameters
  • offsets (str) -- target offsets

  • blocks (str) -- target blocks

  • counts (str) -- target counts

  • strides (str) -- target strides

add_target_slices(slices)[source]

add taget slices

Parameters

slices (str) -- target slices

class nxstools.nxscollect.VDS(parser)[source]

Bases: nxstools.nxsargparser.Runner

Execute runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'create a virual dataset in the master file'

(str) command description

epilog = " examples:\n\n nxscollect vds scan_234.nxs://entry/instrument/eiger/data --shape '1000,2048,1024' --dtype uint32 --target-fields 'eiger_%05d.nxs://entry/data/data:1:10' --shapes '100,,:100,,:100,,:100,,:100,,:100,,:100,,:100,,:100,,:100,,' --offsets '0,,:100,,:200,,:300,,:400,,:500,,:600,,:700,,:800,,:900,,' \n\n\n - creates VDS (shape [1000,2048,1024]) of ten nexus files (shape [100,2048,1024]) merged in their first dimension\n\n\n\n nxscollect vds scan_234.nxs://entry/instrument/lambda/data --shape '100,300,762' --dtype uint32 --target-fields 'lambda_%05d.nxs://entry/data/data:0:2' --shapes ',,250:,,250:,,250' --offsets ',,:,,256:,,512' --counts 'U,,:U,,:U,,' -f 1 \n\n\n - creates VDS (shape [100,300,762]) of three nexus files (shape [100,300,250]) merged in their third dimension,\n separated with a 6 pixel gap of 1 values and unlimited first dimension\n\n\n\n nxscollect vds scan_234.nxs://entry/instrument/percival/data --shape '4000,1600,2000' --dtype int16 --target-fields 'percival_%05d.nxs://entry/data/data:1:4' --shapes '1000,,:1000,,:1000,,:1000,,' --offsets '0,,:1,,:2,,:3,,' --counts 'U,,:U,,:U,,:U,,' --strides '4,,:4,,:4,,:4,,' \n\n\n - creates VDS (shape [1000,1600,2000]) of three nexus files (shape [1000,1600,2000])\n merged in their the first dimension with interlaying frames\n and unlimited first dimension\n\n\n\n"

(str) command epilog

postauto()[source]

creates parser

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

class nxstools.nxscollect.VirtualDataset(nexusfilepath, options, writer=None)[source]

Bases: object

Create virtual dataset in the master NeXus files

The constructor creates the collector object

Parameters
  • nexusfilepath (str) -- the nexus file name and nexus path

  • options (argparse.Namespace) -- parser options

  • writer (str) -- the writer module

create()[source]

creates VDS

nxstools.nxscollect.crdtoint(crd)[source]

convert coorinate to int or None or Unlimited

Parameters

crd (cordinate as string) -- cordinate as string

Returns

converted coordinate

Return type

int

nxstools.nxscollect.filegenerator(filestr, pattern=None)[source]

provides file name generator from file string

Parameters

filestr -- file string

Type

filestr: str

Returns

file name generator or a list of file names

Return type

methodinstance

nxstools.nxscollect.getcompression(compression)[source]
converts compression string to a deflate level parameter

or list with [filterid, opt1, opt2, ...]

Parameters

compression (str) -- compression string

Returns

deflate level parameter or list with [filterid, opt1, opt2, ...]

Return type

int or list < int > or None

nxstools.nxscollect.main()[source]

the main program function

nxstools.nxscollect.splitcoords(crdstr)[source]

splits coordinate string

Parameters

crdstr (cordinate string) -- cordinate string

Returns

a list ofr coordinates in tuples

Return type

list <tuple < int >>

nxstools.nxscollect.splitslices(crdstr)[source]

splits coordinate string

Parameters

crdstr (cordinate string) -- cordinate string

Returns

a list ofr coordinates in tuples

Return type

list <tuple < int >>

nxstools.nxsconfig module

Command-line tool for ascess to the nexdatas configuration server

class nxstools.nxsconfig.Components(parser)[source]

Bases: nxstools.nxsargparser.Runner

Components runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'get a list of dependent components'

(str) command description

epilog = ' examples:\n nxsconfig components dcm\n\n'

(str) command epilog

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

class nxstools.nxsconfig.ConfigServer(device, nonewline=False)[source]

Bases: object

configuration server adapter

constructor

Parameters
  • device (str) -- device name of the configuration server

  • nonewline (bool) -- if the output should not be separated by the new line character

char

(str) spliting character

componentsCmd(components)[source]

lists components of the components

Parameters

components (list <str>) -- given components

Returns

list of component names

Return type

list <str>

dataCmd(args)[source]

provides varaible values

Parameters

args (list <str>) -- list of item names

Returns

JSON with variables

Return type

str

deleteCmd(ds, args, ask=True, profiles=False)[source]

delete the DB items

Parameters
  • ds (bool) -- flag set True for datasources

  • args (list <str>) -- list of item names

  • ask (bool) -- ask flag

  • profiles (bool) -- flag set True for profiles

Returns

list of XML items

Return type

list <str>

describeCmd(ds, args, md, pr, headers=None, filters=None)[source]

provides description of configuration elements

Parameters
  • ds (bool) -- flag set True for datasources

  • args (list <str>) -- list of item names

  • md (bool) -- flag set True for mandatory components

  • pr (str) -- flag set True for private components

  • pr -- column headers

  • filters (str) -- filters for first column names separated by comma

Returns

list with description

Return type

list <str>

geometryCmd(args, md, pr)[source]

provides geometry info for given elements

Parameters
  • args (list <str>) -- list of item names

  • md (bool) -- flag set True for mandatory components

  • pr (bool) -- flag set True for private components

Returns

list with description

Return type

list <str>

getCmd(args)[source]

provides final configuration

Parameters

args (list <str>) -- list of item names

Returns

XML configuration string

Return type

str

infoCmd(ds, args, md, pr, profiles)[source]

Provides info for given elements

Parameters
  • ds (bool) -- flag set True for datasources

  • args (list <str>) -- list of item names

  • md (bool) -- flag set True for mandatory components

  • pr (bool) -- flag set True for private components

  • profiles (bool) -- flag set True for profiles

Returns

list with description

Return type

list <str>

listCmd(ds, mandatory=False, private=False, profiles=False)[source]

lists the DB item names

Parameters
  • ds (bool) -- flag set True for datasources

  • mandatory (bool) -- flag set True for mandatory components

  • private (bool) -- flag set True for components starting with '__'

  • profiles (bool) -- flag set True for profiles

Returns

list op item names

Return type

list <str>

mergeCmd(args)[source]

provides merged components

Parameters

args (list <str>) -- list of item names

Returns

XML configuration string with merged components

Return type

str

recordCmd(ds, name)[source]

lists datasources of the component

Parameters
  • ds (bool) -- flag set True for datasources

  • name (str) -- given component or datasource

Returns

list of record names

Return type

list <str>

showCmd(ds, args, mandatory=False, profiles=False, directory=None)[source]

shows the DB items

Parameters
  • ds (bool) -- flag set True for datasources

  • args (list <str>) -- list of item names

  • mandatory (bool) -- flag set True for mandatory components

  • profiles (bool) -- flag set True for profiles

  • directory (str) -- output file directory

Returns

list of XML items

Return type

list <str>

sourcesCmd(components, mandatory=False)[source]

lists datasources of the components

Parameters

components (list <str>) -- given components

Returns

list of datasource names

Return type

list <str>

uploadCmd(ds, args, force=False, profiles=False, directory='.', mandatory=False, external=None)[source]

upload the DB items from files

Parameters
  • ds (bool) -- flag set True for datasources

  • args (list <str>) -- list of item names

  • force (bool) -- force flag

  • profiles (bool) -- flag set True for profiles

  • directory (str) -- input file directory

  • mandatory (bool) -- mandatory flag

  • external (str) -- external import type

Returns

list of XML items

Return type

list <str>

variablesCmd(components, mandatory=False)[source]

lists variable of the components

Parameters

components (list <str>) -- given components

Returns

list of datasource names

Return type

list <str>

class nxstools.nxsconfig.Data(parser)[source]

Bases: nxstools.nxsargparser.Runner

Data runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'get/set values of component variables'

(str) command description

epilog = ' examples:\n nxsconfig data \n nxsconfig data \'{"sample_name":"H2O"}\'\n\n'

(str) command epilog

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

class nxstools.nxsconfig.Delete(parser)[source]

Bases: nxstools.nxsargparser.Runner

Show runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'delete components, datasources or profiles with given names from ConfigServer'

(str) command description

epilog = ' examples:\n nxsconfig delete pilatus1a\n\n'

(str) command epilog

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

class nxstools.nxsconfig.Describe(parser)[source]

Bases: nxstools.nxsargparser.Runner

Describe runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'show all parameters of given components or datasources'

(str) command description

epilog = ' examples:\n nxsconfig describe pilatus\n\n'

(str) command epilog

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

class nxstools.nxsconfig.Geometry(parser)[source]

Bases: nxstools.nxsargparser.Runner

List runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'show transformation parameters of given components or datasources'

(str) command description

epilog = ' examples:\n nxsconfig geometry dcm\n\n'
run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

class nxstools.nxsconfig.Get(parser)[source]

Bases: nxstools.nxsargparser.Runner

Get runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'get full configuration of components'

(str) command description

epilog = ' examples:\n nxsconfig get dcm source slit1 slit2\n\n'

(str) command epilog

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

class nxstools.nxsconfig.Info(parser)[source]

Bases: nxstools.nxsargparser.Runner

List runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'show general parameters of given components, datasources or profile'

(str) command description

epilog = ' examples:\n nxsconfig info slit1\n\n'

(str) command epilog

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

class nxstools.nxsconfig.List(parser)[source]

Bases: nxstools.nxsargparser.Runner

List runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'list names of available components, datasources or profiles'

(str) command description

epilog = ' examples:\n nxsconfig list\n\n'

(str) command epilog

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

class nxstools.nxsconfig.Merge(parser)[source]

Bases: nxstools.nxsargparser.Runner

Merge runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'get merged configuration of components or datasources'

(str) command description

epilog = ' examples:\n nxsconfig merge slit1 dcm \n\n'

(str) command epilog

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

class nxstools.nxsconfig.Record(parser)[source]

Bases: nxstools.nxsargparser.Runner

Record runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'get a list of datasource record names for components or datasources'

(str) command description

epilog = ' examples:\n nxsconfig record -d exp_mot01 \n nxsconfig record dcm \n\n'

(str) command epilog

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

class nxstools.nxsconfig.Servers(parser)[source]

Bases: nxstools.nxsargparser.Runner

Servers runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'get a list of configuration servers from the current tango host'

(str) command description

epilog = ' examples:\n nxsconfig servers\n\n'

(str) command epilog

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

class nxstools.nxsconfig.Show(parser)[source]

Bases: nxstools.nxsargparser.Runner

Show runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'show (or write to files) components, datasources or profiles with given names'

(str) command description

epilog = ' examples:\n nxsconfig show dcm\n\n'

(str) command epilog

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

class nxstools.nxsconfig.Sources(parser)[source]

Bases: nxstools.nxsargparser.Runner

Sources runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'get a list of component datasources'

(str) command description

epilog = ' examples:\n nxsconfig sources slit1\n\n'

(str) command epilog

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

class nxstools.nxsconfig.Upload(parser)[source]

Bases: nxstools.nxsargparser.Runner

Store runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'upload components, datasources or profiles with given names from locale filesystem into ConfigServer'

(str) command description

epilog = ' examples:\n nxsconfig upload exp_c01 exp_c02\n\n'

(str) command epilog

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

class nxstools.nxsconfig.Variables(parser)[source]

Bases: nxstools.nxsargparser.Runner

Variables runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'get a list of component variables'

(str) command description

epilog = ' examples:\n nxsconfig variables dcm\n\n'

(str) command epilog

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

nxstools.nxsconfig.main()[source]

the main program function

nxstools.nxscreate module

Command-line tool for creating NXSConfigServer configuration of Nexus Files

class nxstools.nxscreate.ClientDS(parser)[source]

Bases: nxstools.nxsargparser.Runner

clientds runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

parser creator

description = 'create client datasources'

(str) command description

epilog = "\n * with -b: datasources are created in Configuration Server database\n * without -b: datasources are created on the local filesystem in -d <directory> \n * default: <directory> is '.' \n <server> is taken from Tango DB\n\n examples:\n\n nxscreate clientds starttime -b \n\n - create the 'starttime' datasource of the 'CLIENT' type with the 'starttime' record name\n and upload them to the NXSConfigServer database \n\n nxscreate clientds title -d /home/user/xmldir \n\n - create the 'title' datasource of the 'CLIENT' type with the 'title' record name\n in the '/home/user/xmldir' directory\n\n nxscreate clientds -v exp_c -f1 -l4 -b \n\n - create the 'exp_c01', 'exp_c02', 'exp_c03', 'exp_c04' datasources of the 'CLIENT' type\n with the corresponding 'exp_c0? record names\n and upload them to the NXSConfigServer database \n where '?' is 1, 2, 3, 4 respectively \n\n nxscreate clientds -v hasppXX:10000/expchan/vfcadc_exp/ -f5 -l8 -m -b -s exp_vfc\n\n - create the 'exp_vfc05', 'exp_vfc06', 'exp_vfc07', 'exp_vfc08' datasources of the 'CLIENT' type\n with the corresponding 'hasppXX:10000/expchan/vfcadc_exp/?' record names\n and upload them to the NXSConfigServer database \n where '?' is 5, 6, 7, 8 respectively \n\n"

(str) command epilog

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

class nxstools.nxscreate.Comp(parser)[source]

Bases: nxstools.nxsargparser.Runner

comp runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'create simple components'

(str) command description

epilog = ' * with -b: components are created (without datasources) in Configuration Server database\n * without -b: components are created (without datasources) on the local filesystem in -d <directory> \n * default: <directory> is \'.\' \n <server> is taken from Tango DB\n <strategy> is step\n <type> is NX_FLOAT\n <chunk> is SCALAR\n <nexuspath> is "/\\$var.entryname#\'scan\'\\$var.serialno:NXentry/instrument/collection/"\n\n examples:\n\n nxscreate comp counter \n\n - create the \'counter\' component in the local directory \n which sets fetching data in the \'STEP\' mode from a \'counter\' datasource to \n \'/\\$var.entryname#\'scan\'\\$var.serialno:NXentry/instrument:NXinstrument/collection:NXcollection/counter\' \n\n nxscreate comp -f5 -l7 -v exp_c -b \n\n - create the \'exp_c05\', \'exp_c06\' \'exp_c07\' components in the NXSConfigServer database \n which set fetching data in the \'STEP\' mode from corresponding \'exp_c0?\' datasources to corresponding\n \'/\\$var.entryname#\'scan\'\\$var.serialno:NXentry/instrument:NXinstrument/collection:NXcollection/exp_c0?\'\n where \'?\' is 5, 6, 7 respectively \n\n nxscreate comp lambda -d /home/user/xmldir/ \n\n - create the \'lambda\' component in the \'/home/user/xmldir/\' directory \n which sets fetching data in the \'STEP\' mode from a \'lambda\' datasource to \n \'/\\$var.entryname#\'scan\'\\$var.serialno:NXentry/instrument:NXinstrument/collection:NXcollection/lambda\' \n\n nxscreate comp -n "/\\$var.entryname#\'scan\'\\$var.serialno:NXentry/instrument/sis3302:NXdetector/collection:NXcollection/" -v sis3302_1_roi -f1 -l3 -g FINAL -t NX_FLOAT64 -k -b -m \n\n - create the \'sis3302_1_roi1\', sis3302_1_roi2\', sis3302_1_roi3\' components in the NXSConfigServer database \n which set fetching data in the \'FINAL\' mode from corresponding \'sis3302_1_roi?\' datasources to corresponding\n \'/\\$var.entryname#\'scan\'\\$var.serialno:NXentry/instrument:NXinstrument/sis3302:NXdetector/collection:NXcollection/sis3302_1_roi?\'\n float64 fields and creates corresponding\n \'/\\$var.entryname#\'scan\'\\$var.serialno:NXentry/data:NXdata/sis3302_1_roi?\' links\n where \'?\' is 1, 2, 3 respectively \n\n nxscreate comp -n "/\\$var.entryname#\'scan\'\\$var.serialno:NXentry/instrument/eh1_mca01:NXdetector/data" eh1_mca01 -g STEP -t NX_FLOAT64 -i -b -c SPECTRUM\n\n - create the \'eh1_mca01\' component in the NXSConfigServer database \n which set fetching STECTRUM data in the \'STEP\' mode from a \'eh1_mca01\' datasource to \n \'/\\$var.entryname#\'scan\'\\$var.serialno:NXentry/instrument:NXinstrument/eh1_mca01:NXdetector/data\n float64 fields and creates \n \'/\\$var.entryname#\'scan\'\\$var.serialno:NXentry/data:NXdata/eh1_mca01\' links\n\n\n'

(str) command epilog

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

class nxstools.nxscreate.Compare(parser)[source]

Bases: nxstools.nxsargparser.Runner

compare runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'compare two online.xml files'

(str) command description

epilog = " * default: second file <online_file> is '/online_dir/online.xml' \n if only file is given\n\n examples:\n\n nxscreate compare online.xml \n\n - compare 'online.xml' to '/online_dir/online.xml\n' \n nxscreate compare /online_dir/online_040.xml online.xml \n\n - compare '/online_dir/online_040.xml' to 'online.xml'\n"

(str) command epilog

postauto()[source]

creates parser

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

class nxstools.nxscreate.DeviceDS(parser)[source]

Bases: nxstools.nxsargparser.Runner

deviceds runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'create datasources for all device attributes'

(str) command description

epilog = " * without <dv_attr1>: datasources for all attributes are created\n * with -b: datasources are created in Configuration Server database\n * without -b: datasources are created on the local filesystem in -d <directory> \n * default: <directory> is '.' \n <server> is taken from Tango DB\n <datasource> is 'exp_mot' \n <host>, <port> are taken from <server>\n\n examples:\n\n nxscreate deviceds -v p09/pilatus/haso228k \n\n - create datasources of the 'TANGO' type\n for all attribute of 'p09/pilatus/haso228k' tango device\n in the local file directory database \n\n nxscreate deviceds -v p09/lambda2m/haso228k -uhaslambda -b \n\n - create datasources of the 'TANGO' type\n for all attribute of 'p09/lambda2m/haso228k' tango device\n with their hostname 'haslambda' \n and upload them to the NXSConfigServer database \n\n nxscreate deviceds -v p09/pilatus300k/haso228k -b -s pilatus300k_ RoI Energy ExposureTime\n\n - create datasources of the 'TANGO' type\n for RoI Energy ExposureTime attribute of 'p09/lambda2m/haso228k' tango device\n with the 'pilatus300k_' datasource prefix \n and upload them to the NXSConfigServer database \n\n"

(str) command epilog

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

class nxstools.nxscreate.OnlineCP(parser)[source]

Bases: nxstools.nxsargparser.Runner

onlinecp runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'create component from online.xml file'

(str) command description

epilog = " * without '-c <component>': show a list of possible components\n * with -b: datasources are created in Configuration Server database\n * without -b: datasources are created on the local filesystem in -d <directory> \n * default: <directory> is '.' \n * default: <inputFile> is '/online_dir/online.xml' \n <server> is taken from Tango DB\n\n examples:\n\n nxscreate onlinecp \n\n - list possible components which can be created from online.xml \n\n nxscreate onlinecp -c pilatus -b \n\n - create the 'pilatus' component and its datasources\n in the NXSConfigServer database\n\n nxscreate onlinecp -c lambda -d /home/user/xmldir/ \n\n - create the 'lambda' component and its datasources\n in the '/home/user/xmldir/' directory\n\n nxscreate onlinecp -c lmbd -t lambda -b \n\n - create the 'lmbd' component of 'lambda' type and its datasources\n in the NXSConfigServer database\n\n\n nxscreate onlinecp -c lmbd -t lambda -v p00/lmbd/1 -u haso000 -w 10000 -b \n\n - create the 'lmbd' component of 'lambda' type and its datasources without online.xml\n in the NXSConfigServer database\n\n"

(str) command epilog

postauto()[source]

creates parser

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

class nxstools.nxscreate.OnlineDS(parser)[source]

Bases: nxstools.nxsargparser.Runner

onlineds runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'create datasources from online.xml file'

(str) command description

epilog = " * with -b: datasources are created in Configuration Server database\n * with -d <directory>: datasources are created on the local filesystem\n * without -b or -d <directory>: run in the test mode\n * default: <inputFile> is '/online_dir/online.xml' \n <server> is taken from Tango DB\n\n `onlineds` overwrites existing datasources\n\n examples:\n\n nxscreate onlineds -b \n\n - create datasources from online.xml file \n and upload them to the NXSConfigServer database \n\n nxscreate onlineds -b -t \n\n - like above but set motor tango datasources to \n be no __CLIENT__ like\n\n nxscreate onlineds -d /home/user/xmldir \n\n - create datasources from online.xml file \n and save them in the '/home/user/xmldir' directory \n\n nxscreate onlineds \n\n - run the command in test mode without creating datasources \n"

(str) command epilog

postauto()[source]

creates parser

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

nxstools.nxscreate.PYTANGO = True

(bool) True if PyTango available

class nxstools.nxscreate.PoolDS(parser)[source]

Bases: nxstools.nxsargparser.Runner

poolds runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'create datasources from sardana pool device'

(str) command description

epilog = " * with -b: datasources are created in Configuration Server database\n * with -d <directory>: datasources are created on the local filesystem\n * without -b or -d <directory>: run in the test mode\n * default: <channel> is 'ALL' \n <server> is taken from Tango DB\n\n <pool> is taken from Tango DB\n\n `poolds` overwrites existing datasources\n\n examples:\n\n nxscreate poolds -b \n\n - create all datasources defined in the local Pool \n and upload them to the NXSConfigServer database \n\n nxscreate poolds -b -t \n\n - like above but set motor tango datasources to \n be no __CLIENT__ like\n\n nxscreate poolds -d . -p p09/pool/haso228 \n\n - create all datasources defined in the 'p09/pool/haso228' Pool \n and save them in the local directory \n\n nxscreate poolds -b Motor CTExpChannel \n\n - create datasources of 'Motor' and CTExpChannel classes \n defined in the local Pool \n and upload them to the NXSConfigServer database \n\n nxscreate poolds -b mot01 mot03 \n\n - create 'mot01' and 'mot03' datasources\n defined in the local Pool \n and upload them to the NXSConfigServer database \n\n nxscreate poolds \n\n - run the command in test mode without creating datasources \n"

(str) command epilog

postauto()[source]

creates parser

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

class nxstools.nxscreate.SECoPCP(parser)[source]

Bases: nxstools.nxsargparser.Runner

secop component runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'create secop components'

(str) command description

epilog = " * with -b: components are created (without datasources) in Configuration Server database\n * without -b: components are created (without datasources) on the local filesystem in -d <directory> \n * default: <directory> is '.' \n <port> is 5001\n\n examples:\n\n nxscreate secopcp \n nxscreate secopcp -l \n\n - list all modules of the given node \n\n nxscreate secopcp -c temp_node -d . -j secopn_node.json \n\n - create the all secop components in the local directory for the node configured with the json file \n\n nxscreate secopcp T -t 5001 -b \n\n - create the component for the T secop module in the NXSConfigServer database for the node on the port 5000 \n\n nxscreate secopcp -d /home/user/xmldir/ \n\n - create the all secop components in the given directory\n\n"

(str) command epilog

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

class nxstools.nxscreate.StdComp(parser)[source]

Bases: nxstools.nxsargparser.Runner

stdcomp runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'create component from the standard templates'

(str) command description

epilog = " * without '-t <type>': show a list of possible component types\n * with '-t <type> and without -c <component>: show a list of component variables for the given component type\n * with -b: datasources are created in Configuration Server database\n * without -b: datasources are created on the local filesystem in -d <directory> \n * default: <directory> is '.' \n * [name1 value1 [name2 value2] ...] sequence defines component variable values \n\n examples:\n\n nxscreate stdcomp \n\n - list possible component types\n from the 'nxstools.xmltemplates' package\n\n nxscreate stdcomp -p nxsextrasp00 \n\n - list possible component types from the 'nxsextrasp00' package\n\n nxscreate stdcomp -t source \n\n - list a description of 'source' component variables\n\n nxscreate stdcomp -t default -c default -m -b\n\n - create 'default' component of the 'default' type\n in the NXSConfigServer database and set it as mandatory\n\n nxscreate stdcomp -t slit -c front_slit1 xgap slt1x ygap slt1y\n\n - create 'front_slit1' component of the 'slit' type\n where variables xgap='slt1x' and ygap='slt1and' in the local directory \n\n nxscreate stdcomp -p nxsextrasp08 -t analyzer -c analyzer1 v anav roll anaroll -b\n\n - create 'analyzer1' component of the 'analyzer type'\n where variables v='anav' and roll='amaroll' in the NXSConfigServer database\n"

(str) command epilog

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

class nxstools.nxscreate.TangoDS(parser)[source]

Bases: nxstools.nxsargparser.Runner

tangods runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'create tango datasources'

(str) command description

epilog = " * with -b: datasources are created in Configuration Server database\n * without -b: datasources are created on the local filesystem in -d <directory> \n * default: <directory> is '.' \n <server> is taken from Tango DB\n <datasource> is 'exp_mot' \n <host>, <port> are taken from <server>\n\n examples:\n\n nxscreate tangods -f1 -l2 -v p09/motor/exp. -s exp_mot \n\n - create the 'exp_mot01' and 'exp_mot02' datasources of the 'TANGO' type\n with the corresponding 'p09/motor/exp.0?' device names\n and 'Position' tango attribute names in the local directory\n where '?' is 1, 2 respectively \n\n nxscreate tangods -f1 -l32 -v p02/motor/eh1a. -s exp_mot -b \n\n - create the 'exp_mot01', ... ,'exp_mot32' datasources of the 'TANGO' type\n with the corresponding 'p09/motor/eh1a.??' device names\n while their attribute name is 'Position' and upload them to the NXSConfigServer database\n where '??' is 01, 02, ... ,32 respectively \n\n nxscreate tangods -v petra/globals/keyword -s source_current -u haso228 -t 10000 \\ \n -a BeamCurrent -b -r p09/nxsconfigserver/haso228 -o -g __CLIENT__\n\n - create the a 'source_current' datasource of the 'TANGO' type belonging to the '__CLIENT__' group \n with the 'petra/globals/keyword' device name\n while their attribute name is 'BeamCurrent', \n their hostname is 'haso228', their tango port is '10000'\n and upload them to the NXSConfigServer 'p09/nxsconfigserver/haso228' database\n\n nxscreate tangods -f1 -l8 -v pXX/slt/exp. -s slt_exp_ -u hasppXX.desy.de -b \n\n - create the 'slt_exp_01', ... ,'slt_exp_08' datasources of the 'TANGO' type\n with the corresponding 'pXX/slt/exp.0?' device names\n while their attribute name is 'Position', \n their hostname is 'hasppXX.desy.de' and upload them to the NXSConfigServer database\n where '??' is 1, 2, ... ,8 respectively \n\n"

(str) command epilog

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

nxstools.nxscreate.main()[source]

the main program function

nxstools.nxsdata module

Command-line tool to ascess to Tango Data Server

class nxstools.nxsdata.CloseEntry(parser)[source]

Bases: nxstools.nxsargparser.Runner

CloseEntry runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'close the current entry'

(str) command description

epilog = ' examples:\n nxsdata closeentry \n\n'
run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

class nxstools.nxsdata.CloseFile(parser)[source]

Bases: nxstools.nxsargparser.Runner

CloseFile runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'close the current file'

(str) command description

epilog = ' examples:\n nxsdata closefile \n\n'
run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

class nxstools.nxsdata.NexusServer(device)[source]

Bases: object

configuration server adapter

constructor

Parameters

device (str) -- device name of configuration server

closeEntry()[source]

closes the entry

closeFile()[source]

closes the file

openEntry(xmlconfig)[source]

opens an entry

Parameters

xmlconfig (str) -- xml configuration string

openFile(filename)[source]

opens the h5 file

Parameters

filename (str) -- h5 file name

record(jsondata)[source]

records one step

Parameters

jsondata (str) -- step JSON data

setData(jsondata)[source]

sets the global JSON data

Parameters

jsondata (str) -- global JSON data

tdwServer

(PyTango.DeviceProxy) NeXus writer device proxy

class nxstools.nxsdata.OpenEntry(parser)[source]

Bases: nxstools.nxsargparser.Runner

OpenEntry runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'create new entry'

(str) command description

epilog = ' examples:\n nxsdata openentry ... \n\n'
run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

class nxstools.nxsdata.OpenFile(parser)[source]

Bases: nxstools.nxsargparser.Runner

OpenFile runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'open a new H5 file'

(str) command description

epilog = ' examples:\n nxsdata openfile /tmp/watertest.nxs \n nxsdata openfile -s p02/tangodataserver/exp.01 /user/data/myfile.h5\n\n'
postauto()[source]

parser creator after autocomplete run

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

class nxstools.nxsdata.Record(parser)[source]

Bases: nxstools.nxsargparser.Runner

Record runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'record one step with step JSON data'

(str) command description

epilog = ' examples:\n nxsdata record ... \n\n'
run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

class nxstools.nxsdata.Servers(parser)[source]

Bases: nxstools.nxsargparser.Runner

Servers runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'get lists of tango data servers from the current tango host'

(str) command description

epilog = ' examples:\n nxsdata servers \n\n'
run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

class nxstools.nxsdata.SetData(parser)[source]

Bases: nxstools.nxsargparser.Runner

SetData runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'assign global JSON data'

(str) command description

epilog = ' examples:\n nxsdata setdata ... \n\n'
run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

nxstools.nxsdata.main()[source]

the main program function

nxstools.nxsetup module

Set Up NeXus Tango Servers

class nxstools.nxsetup.AddRecorderPath(parser)[source]

Bases: nxstools.nxsargparser.Runner

add-recorder-path runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'add-recorder-path into MacroServer(s) property'

(str) command description

epilog = ' examples:\n nxsetup add-recorder-path /usr/share/pyshared/sardananxsrecorder\n nxsetup add-recorder-path -t /usr/share/pyshared/sardananxsrecorder\n nxsetup add-recorder-path /usr/share/pyshared/sardananxsrecorder -i haso\n\n'

(str) command epilog

postauto()[source]

creates parser

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

class nxstools.nxsetup.ChangeProp(parser)[source]

Bases: nxstools.nxsargparser.Runner

change-prop runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'change property value'

(str) command description

epilog = ' examples:\n nxsetup change-prop -n ClientRecordKeys -t -w "[\\"phoibos_scan_command\\",\\"phoibos_scan_comment\\"]" NXSRecSelector/r228\n nxsetup change-prop -n DefaultPreselectedComponents -w "[\\"pinhole1\\",\\"slit2\\"]" NXSRecSelector/r228\n nxsetup change-prop -n StartDsPath -w "[\\"/usr/bin\\",\\"/usr/lib/tango\\"]" Starter\n\n'

(str) command epilog

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

class nxstools.nxsetup.MoveProp(parser)[source]

Bases: nxstools.nxsargparser.Runner

move-prop runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'change property name'

(str) command description

epilog = ' examples:\n nxsetup move-prop -n DefaultPreselectedComponents -o DefaultAutomaticComponents NXSRecSelector\n nxsetup move-prop -t -n DefaultPreselectedComponents -o DefaultAutomaticComponents NXSRecSelector\n\n'

(str) command epilog

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

class nxstools.nxsetup.Restart(parser)[source]

Bases: nxstools.nxsargparser.Runner

restart runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'restart tango server'

(str) command description

epilog = ' examples:\n nxsetup restart Pool/haso228 -l 2\n\n'

(str) command epilog

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

class nxstools.nxsetup.Set(parser)[source]

Bases: nxstools.nxsargparser.Runner

set runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'set up NXSConfigServer NXSDataWriter and NXSRecSelector servers'

(str) command description

epilog = ' examples:\n nxsetup set\n nxsetup set -b p09 -m haso228 -u p09user -d nxsconfig NXSConfigServer\n nxsetup set nexuswriter/haso228 -k NexusWriter -y \'{"p00/bliss_nexuswriter/test_session":{"session":"test_session","beacon_host":"haso228:25000"}}\' -t\n\n'

(str) command epilog

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

class nxstools.nxsetup.SetUp[source]

Bases: object

setup NXSDataWriter, NXSConfigServer and NXSRecSelector Tango servers

constructor

changePropertyName(server, oldname, newname, sclass=None)[source]

changes property name

Parameters
  • server (str) -- server name

  • oldname (str) -- old property name

  • newname (str) -- new property name

  • sclass (str) -- server class name

Returns

True if property name was changed

Return type

bool

changePropertyValue(server, newname, newvalue, sclass=None)[source]

changes/sets property value

Parameters
  • server (str) -- server name

  • newvalue (str) -- new property value

  • newname (str) -- new property name

  • sclass (str) -- server class name

Returns

True if property name was changed

Return type

bool

changeRecorderPath(path, instance=None)[source]

adds a new recorder path

Parameters
  • path (str) -- new recorder path

  • instance (str) -- MacroServer instance name

Returns

True if record path was added

Return type

bool

createConfigServer(beamline, masterhost, jsonsettings=None, hostname=None, postpone=False)[source]

creates configuration server

Parameters
  • beamline (str) -- beamline name

  • masterhost (str) -- master host of data writer

  • jsonsettings (str) -- connection settings to DB in json

  • hostname (str) -- host to run the config server

  • postpone (bool) -- postpone starting flag

Returns

True if server was created

Return type

bool

createDataWriter(beamline, masterhost, postpone=False)[source]

creates data writer

Parameters
  • beamline (str) -- beamline name

  • masterhost (str) -- master host of data writer

  • postpone (bool) -- postpone starting flag

Returns

True if server was created

Return type

bool

createSelector(beamline, masterhost, writer=None, cserver=None, postpone=False)[source]

creates selector server

Parameters
  • beamline (str) -- beamline name

  • masterhost (str) -- master host of data writer

  • writer (str) -- writer device name

  • cserver (str) -- configuration server device name

  • postpone (bool) -- postpone starting flag

Returns

True if server was created

Return type

bool

createServer(server_name, beamline, masterhost, hostname=None, class_name=None, jsondeviceproperties=None, postpone=False)[source]

creates tango server in DB

Parameters
  • server_name (str) -- server name

  • beamline (str) -- beamline name

  • masterhost (str) -- master host of data writer

  • hostname (str) -- host to run the config server

  • class_name -- class name

  • jsondeviceproperties (str) -- json device properties

  • postpone (bool) -- postpone starting flag

Returns

True if server was created

Return type

bool

cserver_name

(str) NeXus config server device name

db

(tango.Database) tango database server

getStarterName(host)[source]

restarts server

Parameters

host (str) -- server host name

Returns

starter device name

Return type

str

killServer(server)[source]
restartServer(name, host=None, level=None, restart=True, stopstart=True, wait=True, timeout=None)[source]

restarts server

Parameters
  • name (str) -- server name

  • host (str) -- server host name

  • level (int) -- start up level

  • restart (bool) -- if server should be restarted

  • stopstart (bool) -- if server should be stopped and started

  • wait (bool) -- script should wait for the server

  • timeout (float) -- timeout for start

stopServer(name, host=None)[source]

restarts server

Parameters
  • name (str) -- server name

  • host (str) -- server host name

waitServerNotRunning(server=None, device=None, adminproxy=None, maxcnt=1000, verbose=True, waitforproc=True)[source]

wait until device is exported and server is running

Parameters
  • server (str) -- server name, check if running when not None

  • device (str) -- device name, check if exported when not None

  • adminproxy (tango.DeviceProxy) -- Starter device proxy

  • maxcnt (int) -- maximal waiting time in 10ms

  • verbose (bool) -- verbose mode

  • waitforproc -- wait for process list update

Returns

True if server is running

Return type

bool

waitServerRunning(server=None, device=None, adminproxy=None, maxcnt=1000, verbose=True, waitforproc=True)[source]

wait until device is exported and server is running

Parameters
  • server (str) -- server name, check if running when not None

  • device (str) -- device name, check if exported when not None

  • adminproxy (tango.DeviceProxy) -- Starter device proxy

  • maxcnt (int) -- maximal waiting time in 10ms

  • verbose (bool) -- verbose mode

  • waitforproc -- wait for process list update

Returns

True if server is running

Return type

bool

writer_name

(str) NeXus writer device name

class nxstools.nxsetup.Start(parser)[source]

Bases: nxstools.nxsargparser.Runner

start runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'start tango server'

(str) command description

epilog = ' examples:\n nxsetup start Pool/haso228 -l 2\n\n'

(str) command epilog

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

class nxstools.nxsetup.Stop(parser)[source]

Bases: nxstools.nxsargparser.Runner

Stop runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'stop tango server'

(str) command description

epilog = ' examples:\n nxsetup stop Pool/haso228 \n\n'

(str) command epilog

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

class nxstools.nxsetup.Wait(parser)[source]

Bases: nxstools.nxsargparser.Runner

start runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'wait for tango server'

(str) command description

epilog = ' examples:\n nxsetup wait Pool/haso228 -z 30\n\n'

(str) command epilog

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

nxstools.nxsetup.knownHosts = {'cfeld-pcx27083': {'beamline': 'cfeld', 'dbname': 'nxsconfig', 'masterhost': 'cfeld-pcx27083', 'user': 'ritzkowf'}, 'has6117b': {'beamline': 'p02', 'dbname': 'nxsconfig', 'masterhost': 'has6117b', 'user': 'p02user'}, 'hascmexp': {'beamline': 'cmexp', 'dbname': 'nxsconfig', 'masterhost': 'hascmexp', 'user': 'cmexp'}, 'hasdelay': {'beamline': 'delay', 'dbname': 'nxsconfig', 'masterhost': 'hasdelay', 'user': 'delayusr'}, 'hasdelay2': {'beamline': 'delsauto', 'dbname': 'nxsconfig', 'masterhost': 'hasdelay2', 'user': 'delayusr'}, 'hasep211eh': {'beamline': 'p211', 'dbname': 'nxsconfig', 'masterhost': 'hasep211eh', 'user': 'p211user'}, 'hasep212lab': {'beamline': 'p21', 'dbname': 'nxsconfig', 'masterhost': 'hasep212lab', 'user': 'p212user'}, 'hasep212oh': {'beamline': 'p21', 'dbname': 'nxsconfig', 'masterhost': 'hasep212oh', 'user': 'p212user'}, 'hasep22ch1': {'beamline': 'p22', 'dbname': 'nxsconfig', 'masterhost': 'hasep22ch1', 'user': 'p22user'}, 'hasep22ch2': {'beamline': 'p22', 'dbname': 'nxsconfig', 'masterhost': 'hasep22ch2', 'user': 'p22user'}, 'hasep22oh': {'beamline': 'p22', 'dbname': 'nxsconfig', 'masterhost': 'hasep22oh', 'user': 'p22user'}, 'hasep23ch': {'beamline': 'p23', 'dbname': 'nxsconfig', 'masterhost': 'hasep23ch', 'user': 'p23user'}, 'hasep23dev': {'beamline': 'p23', 'dbname': 'nxsconfig', 'masterhost': 'hasep23dev', 'user': 'p23user'}, 'hasep23eh': {'beamline': 'p23', 'dbname': 'nxsconfig', 'masterhost': 'hasep23eh', 'user': 'p23user'}, 'hasep24': {'beamline': 'p24', 'dbname': 'nxsconfig', 'masterhost': 'hasep24', 'user': 'p24user'}, 'hasep24eh1': {'beamline': 'p24', 'dbname': 'nxsconfig', 'masterhost': 'hasep24eh1', 'user': 'p24user'}, 'hasfmirr': {'beamline': 'flash', 'dbname': 'nxsconfig', 'masterhost': 'hasfmirr', 'user': 'musixusr'}, 'hasfpgm1': {'beamline': 'flash', 'dbname': 'nxsconfig', 'masterhost': 'hasfpgm1', 'user': 'vuvfuser'}, 'hasfvls': {'beamline': 'flash', 'dbname': 'nxsconfig', 'masterhost': 'hasfvls', 'user': 'vuvfuser'}, 'haskmusixtng': {'beamline': 'flash', 'dbname': 'nxsconfig', 'masterhost': 'haskmusixtng', 'user': 'vuvfuser'}, 'hasmfmc': {'beamline': 'fmc', 'dbname': 'nxsconfig', 'masterhost': 'hasmfmc', 'user': 'delayusr'}, 'hasmlqj': {'beamline': 'lqj', 'dbname': 'nxsconfig', 'masterhost': 'hasmlqj', 'user': 'lqjuser'}, 'hasmrixs': {'beamline': 'rix', 'dbname': 'nxsconfig', 'masterhost': 'hasmrixs', 'user': 'rixuser'}, 'hasnp61ch1': {'beamline': 'p61', 'dbname': 'nxsconfig', 'masterhost': 'hasnp61ch1', 'user': 'p61user'}, 'hasnp64': {'beamline': 'p64', 'dbname': 'nxsconfig', 'masterhost': 'hasnp64', 'user': 'p64user'}, 'hasnp64oh': {'beamline': 'p64', 'dbname': 'nxsconfig', 'masterhost': 'hasnp64oh', 'user': 'p64user'}, 'hasnp65': {'beamline': 'p65', 'dbname': 'nxsconfig', 'masterhost': 'hasnp65', 'user': 'p65user'}, 'hasnp66': {'beamline': 'p66', 'dbname': 'nxsconfig', 'masterhost': 'hasnp66', 'user': 'p66user'}, 'haso107d1': {'beamline': 'p09', 'dbname': 'nxsconfig', 'masterhost': 'haso107d1', 'user': 'kracht'}, 'haso107klx': {'beamline': 'p09', 'dbname': 'nxsconfig', 'masterhost': 'haso107klx', 'user': 'kracht'}, 'haso107tk': {'beamline': 'p09', 'dbname': 'nxsconfig', 'masterhost': 'haso107tk', 'user': 'kracht'}, 'haso111n': {'beamline': 'p09', 'dbname': 'nxsconfig', 'masterhost': 'haso111n', 'user': 'tnunez'}, 'haso111o': {'beamline': 'p09'}, 'haso111tb': {'beamline': 'p09', 'dbname': 'nxsconfig', 'masterhost': 'haso111tb', 'user': 'tnunez'}, 'haso113b': {'beamline': 'p09', 'dbname': 'nxsconfig', 'masterhost': 'haso113b', 'user': 'blume'}, 'haso113u': {'beamline': 'p09', 'dbname': 'nxsconfig', 'masterhost': 'haso113u', 'user': 'kracht'}, 'haso204n': {'beamline': 'p23', 'dbname': 'nxsconfig', 'masterhost': 'haso204n', 'user': 'p23user'}, 'haso213p': {'beamline': 'p22', 'dbname': 'nxsconfig', 'masterhost': 'haso213p', 'user': 'spiec'}, 'haso224w': {'beamline': 'p02', 'dbname': 'nxsconfig', 'masterhost': 'haso224w', 'user': 'p021user'}, 'haso228jk': {'beamline': 'p09', 'dbname': 'nxsconfig', 'masterhost': 'haso228jk', 'user': 'jkotan'}, 'haso232s': {'beamline': 'p02', 'dbname': 'nxsconfig', 'masterhost': 'haspp232s', 'user': 'p02user'}, 'hasodlsauto': {'beamline': 'dlsauto', 'dbname': 'nxsconfig', 'masterhost': 'hasodlsauto', 'user': 'dlsuser'}, 'hasp029rack': {'beamline': 'p06', 'dbname': 'nxsconfig', 'masterhost': 'hasp029rack', 'user': 'p06user'}, 'hasp068xlab': {'beamline': 'p06', 'dbname': 'nxsconfig', 'masterhost': 'hasp068xlab', 'user': 'p06user'}, 'haspecsicl4': {'beamline': 'p02', 'dbname': 'nxsconfig', 'masterhost': 'haspecsicl4', 'user': 'lacluser'}, 'haspllabcl1': {'beamline': 'llab', 'dbname': 'nxsconfig', 'masterhost': 'haspllabcl1', 'user': 'lacluser'}, 'haspp01eh1': {'beamline': 'p01', 'dbname': 'nxsconfig', 'masterhost': 'haspp01eh1', 'user': 'p01user'}, 'haspp01eh2': {'beamline': 'p01', 'dbname': 'nxsconfig', 'masterhost': 'haspp01eh2', 'user': 'p01user'}, 'haspp01eh3': {'beamline': 'p01', 'dbname': 'nxsconfig', 'masterhost': 'haspp01eh3', 'user': 'p01user'}, 'haspp021ch1': {'beamline': 'p02', 'dbname': 'nxsconfig', 'masterhost': 'haspp021ch1', 'user': 'p021user'}, 'haspp021ch1a': {'beamline': 'p021', 'dbname': 'nxsconfig', 'masterhost': 'haspp021ch1a', 'user': 'p021user'}, 'haspp021jenkins': {'beamline': 'p021', 'dbname': 'nxsconfig', 'masterhost': 'haspp021jenkins', 'user': 'p021user'}, 'haspp022ch': {'beamline': 'p022', 'dbname': 'nxsconfig', 'masterhost': 'haspp022ch', 'user': 'p022user'}, 'haspp022chms': {'beamline': 'p022', 'dbname': 'nxsconfig', 'masterhost': 'haspp022chms', 'user': 'p022user'}, 'haspp02ch1': {'beamline': 'p02', 'dbname': 'nxsconfig', 'masterhost': 'haspp02ch1', 'user': 'p02user'}, 'haspp02ch1a': {'beamline': 'p02', 'dbname': 'nxsconfig', 'masterhost': 'haspp02ch1a', 'user': 'p02user'}, 'haspp02ch2': {'beamline': 'p02', 'dbname': 'nxsconfig', 'masterhost': 'haspp02ch2', 'user': 'p02user'}, 'haspp02lakl': {'beamline': 'p02', 'dbname': 'nxsconfig', 'masterhost': 'haspp02lakl', 'user': 'p02user'}, 'haspp02oh1': {'beamline': 'p02', 'dbname': 'nxsconfig', 'masterhost': 'haspp02oh1', 'user': 'p02user'}, 'haspp03': {'beamline': 'p03', 'dbname': 'nxsconfig', 'masterhost': 'haspp03', 'user': 'p03user'}, 'haspp03nano': {'beamline': 'p03nano', 'dbname': 'nxsconfig', 'masterhost': 'haspp03nano', 'user': 'p03nano'}, 'haspp04exp1': {'beamline': 'p04', 'dbname': 'nxsconfig', 'masterhost': 'haspp04exp1', 'user': 'p04user'}, 'haspp04exp2': {'beamline': 'p04', 'dbname': 'nxsconfig', 'masterhost': 'haspp04exp2', 'user': 'p04user'}, 'haspp06ctrl': {'beamline': 'p06', 'dbname': 'nxsconfig', 'masterhost': 'haspp06ctrl', 'user': 'p06user'}, 'haspp06mc01': {'beamline': 'p06', 'dbname': 'nxsconfig', 'masterhost': 'haspp06mc01', 'user': 'p06user'}, 'haspp06nc1': {'beamline': 'p06', 'dbname': 'nxsconfig', 'masterhost': 'haspp06nc1', 'user': 'p06user'}, 'haspp07eh2': {'beamline': 'p07', 'dbname': 'nxsconfig', 'masterhost': 'haspp07eh2', 'user': 'p07user'}, 'haspp08': {'beamline': 'p08', 'dbname': 'nxsconfig', 'masterhost': 'haspp08', 'user': 'p08user'}, 'haspp08lisa2': {'beamline': 'p08', 'dbname': 'nxsconfig', 'masterhost': 'haspp08lisa2', 'user': 'p08user'}, 'haspp09': {'beamline': 'p09', 'dbname': 'nxsconfig', 'masterhost': 'haspp09', 'user': 'p09user'}, 'haspp09dif': {'beamline': 'p09', 'dbname': 'nxsconfig', 'masterhost': 'haspp09dif', 'user': 'p09user'}, 'haspp09haxps': {'beamline': 'p09', 'dbname': 'nxsconfig', 'masterhost': 'haspp09maxps', 'user': 'p09haxps'}, 'haspp09mag': {'beamline': 'p09', 'dbname': 'nxsconfig', 'masterhost': 'haspp09mag', 'user': 'p09user'}, 'haspp10e1': {'beamline': 'p10', 'dbname': 'nxsconfig', 'masterhost': 'haspp10e1', 'user': 'p10user'}, 'haspp10e2': {'beamline': 'p10', 'dbname': 'nxsconfig', 'masterhost': 'haspp10e2', 'user': 'p10user'}, 'haspp10lab': {'beamline': 'p10', 'dbname': 'nxsconfig', 'masterhost': 'haspp10lab', 'user': 'p10user'}, 'haspp10lcx': {'beamline': 'p10', 'dbname': 'nxsconfig', 'masterhost': 'haspp10lcx', 'user': 'p10user'}, 'haspp11oh': {'beamline': 'p11', 'dbname': 'nxsconfig', 'masterhost': 'haspp11oh', 'user': 'p11user'}, 'haspp11sardana': {'beamline': 'p11', 'dbname': 'nxsconfig', 'masterhost': 'haspp11sardana', 'user': 'p11user'}, 'haspp11user02': {'beamline': 'p11', 'dbname': 'nxsconfig', 'masterhost': 'haspp11user02', 'user': 'p11user'}, 'haspp212oh': {'beamline': 'p21', 'dbname': 'nxsconfig', 'masterhost': 'hasep212oh', 'user': 'p21user'}, 'haspp21eh2': {'beamline': 'p21', 'dbname': 'nxsconfig', 'masterhost': 'hasep21eh2', 'user': 'p21user'}, 'haspp21eh3': {'beamline': 'p21', 'dbname': 'nxsconfig', 'masterhost': 'hasep21eh3', 'user': 'p21user'}, 'haspp21lab': {'beamline': 'p21', 'dbname': 'nxsconfig', 'masterhost': 'haspp21lab', 'user': 'p21user'}, 'hastodt': {'beamline': 'p09', 'dbname': 'nxsconfig', 'masterhost': 'hastodt', 'user': 'kracht'}, 'hzgpp07eh1': {'beamline': 'p07', 'dbname': 'nxsconfig', 'masterhost': 'hzgpp07eh1', 'user': 'p07user'}, 'hzgpp07eh3': {'beamline': 'p07', 'dbname': 'nxsconfig', 'masterhost': 'hzgpp07eh3', 'user': 'p07user'}, 'hzgpp07eh4': {'beamline': 'p07', 'dbname': 'nxsconfig', 'masterhost': 'hzgpp07eh4', 'user': 'p07user'}}

(dict <dict <str , str > > ) all SardanaHosts and DataBaseHosts should be known

nxstools.nxsetup.main()[source]

the main program function

nxstools.nxscreator module

Command-line tool for creating to the nexdatas configuration server

class nxstools.nxscreator.CPCreator(options, args, printouts=True)[source]

Bases: nxstools.nxscreator.Creator

component creator of all online.xml complex devices

constructor

Parameters
  • options (optparse.Values) -- command options

  • args (list <str >) -- command arguments

  • printouts (bool) -- if printout is enable

components

(dict <str, str >) component xml dictionary

create()[source]

creates components of all online.xml complex devices

createXMLs()[source]

creates component xmls of all online.xml complex devices abstract method

datasources

(dict <str, str >) datasource xml dictionary

xmlpackage

(str) xml template component package

xmltemplatepath

(str) xml template component package path

exception nxstools.nxscreator.CPExistsException[source]

Bases: Exception

Component already exists exception

class nxstools.nxscreator.ClientDSCreator(options, args, printouts=True)[source]

Bases: nxstools.nxscreator.Creator

client datasource creator

constructor

Parameters
  • options (optparse.Values) -- command options

  • args (list < str >) -- command arguments

  • printouts (bool) -- if printout is enable

create()[source]

creates a client datasource xml and stores it in DB or filesytem

class nxstools.nxscreator.CompareOnlineDS(options, args, printouts=True)[source]

Bases: object

comparing tool for online.xml files

constructor

Parameters
  • options (optparse.Values) -- command options

  • args (list < str >) -- command arguments

  • printouts (bool) -- if printout is enable

args

(list < str >) creator arguments

compare()[source]
options

(optparse.Values) creator options

class nxstools.nxscreator.ComponentCreator(options, args, printouts=True)[source]

Bases: nxstools.nxscreator.Creator

component creator

constructor

Parameters
  • options (optparse.Values) -- command options

  • args (list < str >) -- command arguments

  • printouts (bool) -- if printout is enable

create()[source]

creates a component xml and stores it in DB or filesytem

class nxstools.nxscreator.Creator(options, args, printouts=True)[source]

Bases: object

configuration server adapter

constructor

Parameters
  • options (optparse.Values) -- command options

  • args (list < str >) -- command arguments

  • printouts (bool) -- if printout is enable

args

(list < str >) creator arguments

options

(optparse.Values) creator options

exception nxstools.nxscreator.DSExistsException[source]

Bases: Exception

DataSource already exists exception

class nxstools.nxscreator.Device[source]

Bases: object

device from online.xml

attribute

(str) attribute name

compare(dv)[source]
dtype

(str) device type

findAttribute(tangohost, clientlike=False)[source]

sets attribute and datasource group of online.xml device

Parameters
  • tangohost (str) -- tango host

  • clientlike (bool) -- tango motors to be client like

findDevice(tangohost)[source]

sets sardana device name and sardana host/port of online.xml device

Parameters

tangohost (str) -- tango host

group

(str) datasource tango group

host

(str) host without port

hostname

(str) host name with port

module

(str) device module

name

(str) device name

port

(str) port

sardanahostname

(str) sardana host name

sardananame

(str) sardana name with port

sdevice

(str) sardana device name

setSardanaName(tolower)[source]

sets sardana name

Parameters

tolower (bool) -- If True name in lowercase

shost

(str) sardana host without port

splitHostPort()[source]

spilts host name from port

sport

(str) sardana tango port

tdevice

(str) tango device name

thost

(str) tango host without port

tolower()[source]

converts name, module, tdevice, hostname into lower case

tport

(str) tango port

class nxstools.nxscreator.DeviceDSCreator(options, args, printouts=True)[source]

Bases: nxstools.nxscreator.Creator

device datasource creator

constructor

Parameters
  • options (optparse.Values) -- command options

  • args (list < str >) -- command arguments

  • printouts (bool) -- if printout is enable

create()[source]

creates a tango datasources xml of given device and stores it in DB or filesytem

class nxstools.nxscreator.OnlineCPCreator(options, args, printouts=True)[source]

Bases: nxstools.nxscreator.CPCreator

component creator of online components

constructor

Parameters
  • options (optparse.Values) -- command options

  • args (list < str >) -- command arguments

  • printouts (bool) -- if printout is enable

createXMLs()[source]

creates component xmls of all online.xml complex devices

listcomponents()[source]

provides a list of components with xml templates

Returns

list of components with xml templates

Return type

list <str >

listcomponenttypes()[source]

provides a list of standard component types

Returns

list of standard component types

Return type

list <str>

class nxstools.nxscreator.OnlineDSCreator(options, args, printouts=True)[source]

Bases: nxstools.nxscreator.Creator

datasource creator of all online.xml simple devices

constructor

Parameters
  • options (optparse.Values) -- command options

  • args (list <str >) -- command arguments

  • printouts (bool) -- if printout is enable

create()[source]

creates datasources of all online.xml simple devices

createXMLs()[source]

creates datasource xmls of all online.xml simple devices

datasources

(dict <str, str >) datasource xml dictionary

xmlpackage

(str) xml template component package

xmltemplatepath

(str) xml template component package path

nxstools.nxscreator.PYTANGO = True

(bool) True if PyTango available

class nxstools.nxscreator.PoolDSCreator(options, args, printouts=True)[source]

Bases: nxstools.nxscreator.Creator

datasource creator of all sardana pool acquisition channels

constructor

Parameters
  • options (optparse.Values) -- command options

  • args (list <str >) -- command arguments

  • printouts (bool) -- if printout is enable

create()[source]

creates datasources of all online.xml simple devices

createXMLs()[source]

creates datasource xmls of all online.xml simple devices

datasources

(dict <str, str >) datasource xml dictionary

class nxstools.nxscreator.SECoPCPCreator(options, args, printouts=True)[source]

Bases: nxstools.nxscreator.CPCreator

component creator of secop components

constructor

Parameters
  • options (optparse.Values) -- command options

  • args (list < str >) -- command arguments

  • printouts (bool) -- if printout is enable

create()[source]

creates components of all online.xml complex devices

createSECoPDS(dsname, message, group=None, access=None, host=None, port=None, timeout=None)[source]

create SECoP datasource

Parameters
  • dsname (str) -- datasource name

  • message (str) -- secop command

  • group (str) -- secop group name

  • access (str) -- secop attribute access list

  • host (str) -- secop host name

  • port (str or float) -- secop port name

  • port -- minimum timeout

createSECoPLinkDS(entryname, samplename, sampleenvname, meanings, environments)[source]

create SECoP datasource

Parameters
  • entryname (str) -- secop entry name

  • samplename (str) -- secop sample name

  • sampleenvname (str) -- secop sample name

  • meanings (str) -- secop meanings list

  • environments (str) -- secop environments list

createXMLs()[source]

creates component xmls of all online.xml complex devices

listmodules()[source]

provides a list of modules for the secop node

Returns

list of modules for the secop node

Return type

list <str >

class nxstools.nxscreator.StandardCPCreator(options, args, printouts=True)[source]

Bases: nxstools.nxscreator.CPCreator

component creator of standard templates

constructor

Parameters
  • options (optparse.Values) -- command options

  • args (list < str >) -- command arguments

  • printouts (bool) -- if printout is enable

createXMLs()[source]

creates component xmls of all online.xml complex devices

listcomponenttypes()[source]

provides a list of standard component types

Returns

list of standard component types

Return type

list <str>

listcomponentvariables()[source]

provides a list of standard component types

Returns

list of standard component types

Return type

list <str>

class nxstools.nxscreator.TangoDSCreator(options, args, printouts=True)[source]

Bases: nxstools.nxscreator.Creator

tango datasource creator

constructor

Parameters
  • options (optparse.Values) -- command options

  • args (list < str >) -- command arguments

  • printouts (bool) -- if printout is enable

create()[source]

creates a tango datasource xml and stores it in DB or filesytem

exception nxstools.nxscreator.WrongParameterError[source]

Bases: Exception

wrong parameter exception

nxstools.nxsfileinfo module

Command-line tool for showing meta data from Nexus Files

class nxstools.nxsfileinfo.Attachment(parser)[source]

Bases: nxstools.nxsargparser.Runner

Attachment runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

attachment(root, options)[source]

get metadata from nexus and beamtime file

Parameters
  • root (filewriter.FTGroup) -- nexus file root

  • options (argparse.Namespace) -- parser options

Returns

atttachment metadata

Return type

str

create()[source]

creates parser

description = 'generate description of attachment'

(str) command description

epilog = " examples:\n nxsfileinfo attachment -b p00 -i 2342342 -t 'HH water' -o ~/at1.json thumbnail.png \n nxsfileinfo attachment -b p00 -i 2342342 -t 'HH water' -o ~/at2.json -s pilatus myscan_00123.nxs \n nxsfileinfo attachment -b p00 -i 2342342 -t 'HH water' -o ~/at2.json myscan_00124.fio \n\n"

(str) command epilog

postauto()[source]

parser creator after autocomplete run

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

show(root, options)[source]

the main function

Parameters
  • options (argparse.Namespace) -- parser options

  • root (filewriter.FTGroup) -- nexus file root

class nxstools.nxsfileinfo.BeamtimeLoader(options)[source]

Bases: object

loader constructor

Parameters

options (argparse.Namespace) -- parser options

append_copymap_field(metadata, cmap, clist, cmapfield=None)[source]

overwrite metadata with dictionary

Parameters
  • metadata (dict <str, any>) -- metadata dictionary to merge in

  • cmap (dict <str, str>) -- overwrite dictionary

  • clist (list < [str, str] >) -- copy list to overwrite metadata

  • cmapfield (str) -- copy map nexus field

Returns

metadata dictionary

Return type

dict <str, any>

btmdmap = {}
copylist = [['creationTime', 'endTime']]
copymap = {'description': 'scientificMetadata.title.value', 'endTime': 'scientificMetadata.end_time.value', 'scientificMetadata.ScanCommand': 'scientificMetadata.program_name.scan_command'}
cre = {'accessGroups': [], 'classification': [], 'createdAt': [], 'createdBy': [], 'creationTime': [], 'dataFormat': [], 'datasetName': [], 'datasetlifecycle': [], 'history': [], 'instrumentId': [], 'isPublished': ['false'], 'keywords': [], 'license': [], 'numberOfFiles': [], 'numberOfFilesArchived': [], 'orcidOfOwner': 'ORCID of owner https://orcid.org if available', 'ownerGroup': [], 'packedSize': [], 'publisheddataId': [], 'sampleId': [], 'scientificMetadata': {}, 'size': [], 'sourceFolderHost': [], 'techniques': [], 'updatedAt': [], 'updatedBy': [], 'validationStatus': [], 'version': []}
dr = {'applicant.*': [], 'beamlineAlias': [], 'eventStart': [], 'leader': [], 'onlineAnalysis': [], 'pi.*': [], 'proposalType': [], 'users': []}
facilityalias = {'PETRA III': 'petra3', 'PETRA IV': 'petra4'}
generate_techniques(techniques, techniques_pids=None)[source]

generate technique dictionary

Parameters
  • techniques (list <str>) -- a list of techniques splitted by comma

  • techniques_pids (list <str>) -- a list of technique pids splitted by comma

Returns

technique dictionary

Return type

dict <str, objstr>

merge(metadata)[source]

update metadata with dictionary

Parameters

metadata (dict <str, any>) -- metadata dictionary to merge in

Returns

metadata dictionary

Return type

dict <str, any>

merge_copy_lists(clist)[source]

merge copy lists

Parameters

clist -- overwrite copy list

Returns

metadata dictionary

Return type

list < [str, str] >

merge_copy_maps(cmap)[source]

merge copy maps

Parameters

cmap (dict <str, str>) -- overwrite dictionary

Returns

metadata dictionary

Return type

dict <str, any>

newbtmdmap = {'contactEmail': ['pi.email', 'applicant.email'], 'description': ['title'], 'endTime': ['eventEnd'], 'owner': ['leader.lastname', 'applicant.lastname'], 'ownerEmail': ['leader.email', 'applicant.email'], 'principalInvestigator': ['applicant.email'], 'proposalId': ['beamtimeId'], 'sourceFolder': ['corePath']}
oldbtmdmap = {'createdAt': ['generated'], 'updatedAt': ['generated']}
overwrite(metadata, cmap=None, clist=None, cmapfield=None)[source]

overwrite metadata with dictionary

Parameters
  • metadata (dict <str, any>) -- metadata dictionary to merge in

  • cmap (dict <str, str>) -- copy map to overwrite dictionary

  • clist (list < [str, str] >) -- copy list to overwrite metadata

  • cmapfield (str) -- copy map nexus field

Returns

metadata dictionary

Return type

dict <str, any>

remove_metadata(metadata, cmap=None, clist=None, cmapfield=None)[source]
remove metadata with dictionary with empty input or output

in the copy map

Parameters
  • metadata (dict <str, any>) -- metadata dictionary to merge in

  • cmap (dict <str, str>) -- overwrite dictionary

  • clist (list < [str, str] >) -- copy list to overwrite metadata

  • cmapfield (str) -- copy map nexus field

Returns

metadata dictionary

Return type

dict <str, any>

run()[source]

runner for DESY beamtime file parser

Parameters

options (argparse.Namespace) -- parser options

Returns

metadata dictionary

Return type

dict <str, any>

strcre = {'accessGroups': ['{beamtimeId}-dmgt', '{beamtimeId}-clbt', '{beamtimeId}-part', '{beamline}dmgt', '{beamline}staff'], 'creationLocation': '/DESY/{facility}/{beamlineAlias}', 'instrumentId': '/{facility}/{beamline}', 'isPublished': False, 'keywords': ['scan'], 'ownerGroup': '{beamtimeId}-dmgt', 'type': 'raw'}
update_instrumentid(metadata)[source]

update instrument id

Parameters

metadata (dict <str, any>) -- metadata dictionary to merge in

Returns

metadata dictionary

Return type

dict <str, any>

update_pid(metadata, filename=None, puuid=False, pfname=False, beamtimeid=None)[source]

update pid metadata with dictionary

Parameters
  • metadata (dict <str, any>) -- metadata dictionary to merge in

  • filename (str) -- nexus filename

  • puuid (bool) -- pid with uuid

  • pfname (bool) -- pid with file name

Returns

metadata dictionary

Return type

dict <str, any>

update_sampleid(metadata, sampleid=None, sidfromname=False)[source]

update sampleid

Parameters
  • metadata (dict <str, any>) -- metadata dictionary to merge in

  • sampleid (str) -- sample id

  • sidfromname (bool) -- sample id from its name

Returns

metadata dictionary

Return type

dict <str, any>

update_techniques(metadata, techniques=None)[source]

update techniques

Parameters
  • metadata (dict <str, any>) -- metadata dictionary to merge in

  • techniques (str) -- a list of techniques splitted by comma

Returns

metadata dictionary

Return type

dict <str, any>

class nxstools.nxsfileinfo.Field(parser)[source]

Bases: nxstools.nxsargparser.Runner

Field runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'show field information for the nexus file'

(str) command description

epilog = ' examples:\n nxsfileinfo field /user/data/myfile.nxs\n nxsfileinfo field /user/data/myfile.nxs -g\n nxsfileinfo field /user/data/myfile.nxs -s\n\n'

(str) command epilog

postauto()[source]

parser creator after autocomplete run

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

show(root, options)[source]

the main function

Parameters
  • options (argparse.Namespace) -- parser options

  • root (class:filewriter.FTGroup) -- nexus file root

class nxstools.nxsfileinfo.General(parser)[source]

Bases: nxstools.nxsargparser.Runner

General runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'show general information for the nexus file'

(str) command description

epilog = ' examples:\n nxsfileinfo general /user/data/myfile.nxs\n\n'

(str) command epilog

classmethod parseentry(entry, description)[source]

parse entry of nexus file

Parameters
  • entry (filewriter.FTGroup) -- nexus entry node

  • description (list <dict <str, any > >) -- dict description list

Returns

(key, value) name pair of table headers

Return type

[str, str]

postauto()[source]

parser creator after autocomplete run

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

show(root)[source]

show general informations

Parameters

root (class:filewriter.FTGroup) -- nexus file root

class nxstools.nxsfileinfo.GroupMetadata(parser)[source]

Bases: nxstools.nxsargparser.Runner

Group Metadata runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'group scan metadata information'

(str) command description

dicttype = ['Dict', 'D', 'd', 'dict']
endpointstype = ['Endpoints', 'endpoints', 'E', 'e']
epilog = ' examples:\n nxsfileinfo groupmetadata -o /user/data/myscan.scan.json -t /user/data/myscan.attachment.json -l /user/data/myscan.origdatablock.json -c /home/user/group_config.txt -m /user/data/myscan_00023.scan.json -d /user/data/myscan_00023.origdatablock.json -a /user/data/myscan_00023.attachment.json \n \n nxsfileinfo groupmetadata myscan_m001 -m /user/data/myscan_00021.scan.json\n -c /home/user/group_config.txt \n \n nxsfileinfo groupmetadata myscan_m001 -c /home/user/group_config.txt -m /user/data/myscan_00023.scan.json -d /user/data/myscan_00023.origdatablock.json -a /user/data/myscan_00023.attachment.json \n \n nxsfileinfo groupmetadata -m /user/data/myscan_00023.scan.json -d /user/data/myscan_00023.origdatablock.json -c /home/user/group_config.txt \n\n'

(str) command epilog

firstlasttype = ['FirstLast', 'firstlast']
firsttype = ['First', 'first', 'f', 'F']
classmethod groupmetadata(options)[source]

group scan metadata

Parameters

options (argparse.Namespace) -- parser options

Returns

[grouped metadata, grouped origdatablocks, grouped attachments]

Return type

[str,:obj:str, str]

lasttype = ['Last', 'last', 'l', 'L']
listtype = ['List', 'L', 'l', 'list']
maxtype = ['Max', 'max']
minmaxtype = ['MinMax', 'M', 'm', 'minmax']
mintype = ['Min', 'min']
postauto()[source]

parser creator after autocomplete run

rangetype = ['Range', 'R', 'r', 'rangle']
run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

show(options)[source]

the main function

Parameters

options (argparse.Namespace) -- parser options

uniquelisttype = ['UniqueList', 'U', 'u', 'uniquelist']
class nxstools.nxsfileinfo.Instrument(parser)[source]

Bases: nxstools.nxsargparser.Runner

Instrument runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'generate description of instrument'

(str) command description

epilog = ' examples:\n nxsfileinfo instrument -p /petra3/p00 -n P00 -m ~/cm.json \n\n'

(str) command epilog

instrument(options)[source]

create instrument metadata

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

postauto()[source]

parser creator after autocomplete run

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

show(options)[source]

the main function

Parameters

options (argparse.Namespace) -- parser options

class nxstools.nxsfileinfo.Metadata(parser)[source]

Bases: nxstools.nxsargparser.Runner

Metadata runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'show metadata information for the nexus file'

(str) command description

epilog = " examples:\n nxsfileinfo metadata /user/data/myfile.nxs\n nxsfileinfo metadata /user/data/myfile.fio\n nxsfileinfo metadata /user/data/myfile.nxs -p 'Group'\n nxsfileinfo metadata /user/data/myfile.nxs -s\n nxsfileinfo metadata /user/data/myfile.nxs -a units,NX_class\n\n"

(str) command epilog

classmethod metadata(root, options)[source]

get metadata from nexus and beamtime file

Parameters
  • root (filewriter.FTGroup) -- nexus file root

  • options (argparse.Namespace) -- parser options

Returns

nexus file root metadata

Return type

str

postauto()[source]

parser creator after autocomplete run

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

show(root, options)[source]

the main function

Parameters
  • options (argparse.Namespace) -- parser options

  • root (filewriter.FTGroup) -- nexus file root

class nxstools.nxsfileinfo.OrigDatablock(parser)[source]

Bases: nxstools.nxsargparser.Runner

OrigDatablock runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

datablock(options)[source]

dump scan datablock JSON

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

datafiles(scanpath, scdir, scfiles, relpath, filters=None)[source]
description = 'generate description of all scan files'

(str) command description

epilog = ' examples:\n nxsfileinfo origdatablock /user/data/scan_12345\n\n'

(str) command epilog

filterout(fpath, filters)[source]
isotime(tme)[source]

returns iso time string

Returns

iso time

Return type

str

postauto()[source]

parser creator after autocomplete run

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

show(options)[source]

the main function

Parameters

options (argparse.Namespace) -- parser options

class nxstools.nxsfileinfo.Sample(parser)[source]

Bases: nxstools.nxsargparser.Runner

Sample runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

creates parser

description = 'generate description of sample'

(str) command description

epilog = " examples:\n nxsfileinfo sample -i petra3/h2o/234234 -d 'HH water' -s ~/cm.json \n\n"

(str) command epilog

postauto()[source]

parser creator after autocomplete run

run(options)[source]

the main program function

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

sample(options)[source]

create sample metadata

Parameters

options (argparse.Namespace) -- parser options

Returns

output information

Return type

str

show(options)[source]

the main function

Parameters

options (argparse.Namespace) -- parser options

nxstools.nxsfileinfo.getlist(text)[source]
converts a text string to a list of lists

with respect to newline and space characters

Parameters

text (str) -- parser options

Returns

a list of list

Return type

list < list`<:obj:`str> >

nxstools.nxsfileinfo.main()[source]

the main program function

nxstools.nxsfileinfo.splittext(text, lmax=68)[source]

split text to lines

Parameters
  • text (str) -- parser options

  • lmax (int) -- maximal line length

Returns

split text

Return type

str

nxstools.nxsfileparser module

NeXus main metadata viewer

class nxstools.nxsfileparser.FIOFileParser(root)[source]

Bases: object

Metadata parser for FIO files

constructor

Parameters

root (str) -- fio file content

columns

(dict <str, any>) columns dictionary

group_postfix

(str) group postfix

parseMeta()[source]

parses the file and creates the filtered description list

class nxstools.nxsfileparser.NXSFileParser(root)[source]

Bases: object

Metadata parser for NeXus files

constructor

Parameters

root (filewriter.FTGroup) -- nexus root node

emptyunits

(bool) add empty units

filters

(list`< :obj:`str>) filters for full_path names

classmethod getpath(path)[source]

converts full_path with NX_classes into nexus_path

Parameters

path (str) -- nexus full_path

group_postfix

(str) group postfix

parse()[source]

parses the file and creates the filtered description list

parseMeta()[source]

parses the file and creates the filtered description list

scientific

(bool) store NXentries as scientificMetadata

valuestostore

(list`< :obj:`str>) field names which value should be stored

nxstools.nxsfileparser.getdsname(xmlstring)[source]

provides datasource name from datasource xml string

Parameters

xmlstring (str) -- datasource xml string

nxstools.nxsfileparser.getdssource(xmlstring)[source]

provides source from datasource xml string

Parameters

xmlstring (str) -- datasource xml string

nxstools.nxsfileparser.getdstype(xmlstring)[source]

provides datasource type from datasource xml string

Parameters

xmlstring (str) -- datasource xml string

nxstools.nxsfileparser.infNaN2None(obj)[source]

replace inf and NaN to None

nxstools.nxsfileparser.isoDate(text)[source]

convert date to iso format

Parameters

text (str) -- date text to convert

Returns

date in iso format

Return type

str

class nxstools.nxsfileparser.numpyEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]

Bases: json.encoder.JSONEncoder

numpy json encoder with list

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 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 OverflowError). 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 None and (',', ': ') 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.

default(obj)[source]

default encoder

Parameters

obj (object or any) -- numpy array object

class nxstools.nxsfileparser.numpyEncoderNull(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]

Bases: nxstools.nxsfileparser.numpyEncoder

numpy json encoder with list with nan/inf to null

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 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 OverflowError). 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 None and (',', ': ') 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.

encode(obj, *args, **kwargs)[source]

Return a JSON string representation of a Python data structure.

>>> from json.encoder import JSONEncoder
>>> JSONEncoder().encode({"foo": ["bar", "baz"]})
'{"foo": ["bar", "baz"]}'

nxstools.nxsargparser module

NeXus tool argumen parser

exception nxstools.nxsargparser.ErrorException[source]

Bases: Exception

error parser exception

class nxstools.nxsargparser.NXSArgParser(**kwargs)[source]

Bases: argparse.ArgumentParser

Argument parser with error exception

constructor

Parameters

kwargs -- argparse.ArgumentParser parameter dictionary

createSubParsers()[source]

creates command-line parameters parser

Returns

command runner

Return type

Runner

error(message)[source]

error handler

Parameters

message (str) -- error message

class nxstools.nxsargparser.Runner(parser)[source]

Bases: object

abstract runner

parser creator

Parameters

parser (NXSFileInfoArgParser) -- option parser

create()[source]

parser creator

description = 'abstract runner'

(str) command description

epilog = None

(str) command epilog

postauto()[source]

parser creator after autocomplete run

run(options)[source]

run commandthe main program function

Parameters

options (argparse.Namespace) -- parser options

nxstools.nxsparser module

Command-line tool for ascess to the nexdatas configuration server

class nxstools.nxsparser.ESRFConverter[source]

Bases: object

ESRF xml configuration converter

constructor

convert(text)[source]

converts ESRF xml configuration to nxsdatawriter format

Parameters

text (str) -- input xml string

Returns

output xml string

Return type

str

class nxstools.nxsparser.ParserTools[source]

Bases: object

configuration server adapter

classmethod getRecord(node)[source]

fetches record name or query from datasource node

Parameters

node (lxml.etree.Element) -- datasource node

Returns

record name or query

Return type

str

classmethod mergeDefinitions(xmls)[source]
merges the xmls list of definitions xml strings

to one output xml string

Parameters

xmls (list <str>) -- a list of xml string with definitions

Returns

one output xml string

Return type

str

classmethod parseAttributes(xmlc)[source]

provides datasources and its records from xml string

Parameters

xmlc (str) -- xml string

Returns

list of datasource descriptions

Return type

list < dict <str, any> >

classmethod parseDataSources(xmlc)[source]

provides datasources and its records from xml string

Parameters

xmlc (str) -- xml string

Returns

list of datasource descriptions

Return type

list <dict <str, str>>

classmethod parseFields(xmlc)[source]

provides datasources and its records from xml string

Parameters

xmlc (str) -- xml string

Returns

list of datasource descriptions

Return type

list < dict <str, any> >

provides datasources and its records from xml string

Parameters

xmlc (str) -- xml string

Returns

list of datasource descriptions

Return type

list < dict <str, any> >

classmethod parseRecord(xmlc)[source]

provides source record from xml string

Parameters

xmlc (str) -- xml string

Returns

source record

Return type

str

class nxstools.nxsparser.TableDictTools(description, nonone=None)[source]

Bases: object

configuration server adapter

constructor

Parameters
  • description (list <str>) -- description list

  • nonone (list <str>) -- list of parameters which have to exist to be shown

generateList()[source]

generate row lists of table

Returns

table rows

Return type

list <str>

headers

(list <str>) headers

title

(str) table title

class nxstools.nxsparser.TableTools(description, nonone=None, headers=None, filters=None)[source]

Bases: object

configuration server adapter

constructor

Parameters
  • description (list <str>) -- description list

  • nonone (list <str>) -- list of parameters which have to exist to be shown

  • headers (list <str>) -- list of output parameters

  • filters (list <str>) -- filters for first column names

filters

(list <str>) filter list

generateList()[source]

generate row lists of table

Returns

table rows

Return type

list <str>

headers

(list <str>) table headers

loadDescription(description)[source]

loads description

Parameters

description (list <str>) -- description list

title

(str) table title

nxstools.nxsxml module

Creator of XML configuration files

class nxstools.nxsxml.NAttr(parent, nameAttr, typeAttr='')[source]

Bases: nxstools.nxsxml.NTag

Attribute tag wrapper

constructor

Parameters
  • parent (NTag) -- parent tag element

  • nameAttr (str) -- name attribute

  • typeAttr (str) -- type attribute

setStrategy(mode='STEP', trigger=None, value=None, canfail=None)[source]

sets the attribute strategy

Parameters
  • mode (str) -- mode data writing, i.e. INIT, STEP, FINAL, POSTRUN

  • trigger (str) -- for asynchronous writting, e.g. with different subentries

  • value (str) -- label for postrun mode

  • canfail (bool) -- can fail strategy flag

class nxstools.nxsxml.NDSource(parent)[source]

Bases: nxstools.nxsxml.NTag

Source tag wrapper

constructor

Parameters

parent (NTag) -- parent tag element

addDoc(doc)[source]

adds doc tag content

Parameters

doc (str) -- doc tag content

initClient(name, recordName)[source]

sets paramters for Client data

Parameters
  • name (str) -- name of datasource

  • recordName (str) -- name of the data object

initDBase(name, dbtype, query, dbname=None, rank=None, mycnf=None, user=None, passwd=None, dsn=None, mode=None, host=None, port=None)[source]

sets parameters of DataBase

Parameters
  • name (str) -- name of datasource

  • dbname (str) -- name of used DataBase

  • query (str) -- database query

  • dbtype (str) -- type of the database, i.e. MYSQL, PGSQL, ORACLE

  • rank (str) -- rank of the query output, i.e. SCALAR, SPECTRUM, IMAGE

  • mycnf (str) -- MYSQL config file

  • user (str) -- database user name

  • passwd (str) -- database user password

  • dsn (str) -- DSN string to initialize ORACLE and PGSQL databases

  • mode (str) -- mode for ORACLE databases, i.e. SYSDBA or SYSOPER

  • host (str) -- name of the host

  • port (str) -- port number

initTango(name, device, memberType, recordName, host=None, port=None, encoding=None, group=None)[source]

sets paramters for Tango device

Parameters
  • name (str) -- name of datasource

  • device (str) -- device name

  • memberType (str) -- type of the data object, i.e. attribute, property, command

  • recordName (str) -- name of the data object

  • host (str) -- host name

  • port (str) -- port

  • encoding (str) -- encoding of DevEncoded data

class nxstools.nxsxml.NDeviceGroup(parent, deviceName, nameAttr, typeAttr='', commands=True, blackAttrs=None)[source]

Bases: nxstools.nxsxml.NGroup

Tango device tag creator

constructor

Parameters
  • parent (NTag) -- parent tag element

  • deviceName (str) -- tango device name

  • nameAttr (str) -- name attribute

  • typeAttr (str) -- type attribute

  • commands (bool) -- if we call the commands

  • blackAttrs (list <str>) -- list of excluded attributes

nTypes = ['NX_CHAR', 'NX_BOOLEAN', 'NX_INT32', 'NX_INT32', 'NX_FLOAT32', 'NX_FLOAT64', 'NX_UINT32', 'NX_UINT32', 'NX_CHAR', 'NX_CHAR', 'NX_INT32', 'NX_INT32', 'NX_FLOAT32', 'NX_FLOAT64', 'NX_UINT32', 'NX_UINT32', 'NX_CHAR', 'NX_CHAR', 'NX_CHAR', 'NX_CHAR', 'NX_CHAR', 'NX_BOOLEAN', 'NX_CHAR', 'NX_INT64', 'NX_UINT64', 'NX_INT64', 'NX_UINT64', 'NX_INT32', 'NX_CHAR']

(list <str>) NeXuS types corresponding to the Tango types

tTypes = ['DevVoid', 'DevBoolean', 'DevShort', 'DevLong', 'DevFloat', 'DevDouble', 'DevUShort', 'DevULong', 'DevString', 'DevVarCharArray', 'DevVarShortArray', 'DevVarLongArray', 'DevVarFloatArray', 'DevVarDoubleArray', 'DevVarUShortArray', 'DevVarULongArray', 'DevVarStringArray', 'DevVarLongStringArray', 'DevVarDoubleStringArray', 'DevState', 'ConstDevString', 'DevVarBooleanArray', 'DevUChar', 'DevLong64', 'DevULong64', 'DevVarLong64Array', 'DevVarULong64Array', 'DevInt', 'DevEncoded']

(list < str>) Tango types

class nxstools.nxsxml.NDim(parent, indexAttr, valueAttr)[source]

Bases: nxstools.nxsxml.NTag

Dim tag wrapper

constructor

Parameters
  • parent (NTag) -- parent tag element

  • indexAttr (str) -- index attribute

  • valueAttr (str) -- value attribute

class nxstools.nxsxml.NDimensions(parent, rankAttr)[source]

Bases: nxstools.nxsxml.NTag

Dimensions tag wrapper

constructor

Parameters
  • parent (NTag) -- parent tag element

  • rankAttr (str) -- rank attribute

dim(indexAttr, valueAttr)[source]

adds dim tag

Parameters
  • indexAttr (str) -- index attribute

  • valueAttr (str) -- value attribute

dims

(dict <str, NDim>) container with dim tag wrapper

class nxstools.nxsxml.NField(parent, nameAttr, typeAttr='')[source]

Bases: nxstools.nxsxml.NTag

Field tag wrapper

constructor

Parameters
  • parent (NTag) -- parent tag element

  • nameAttr (str) -- name attribute

  • typeAttr (str) -- type attribute

addAttr(attrName, attrType, attrValue='')[source]

adds attribute tag

Parameters
  • attrName (str) -- name attribute

  • attrType (str) -- type attribute

  • attrValue (str) -- content of the attribute tag

addDoc(doc)[source]

adds doc tag content

Parameters

doc (str) -- doc tag content

setStrategy(mode='STEP', trigger=None, value=None, grows=None, compression=False, rate=None, shuffle=None, canfail=None, compression_opts=None)[source]

sets the field strategy

Parameters
  • mode (str) -- mode data writing, i.e. INIT, STEP, FINAL, POSTRUN

  • trigger (str) -- for asynchronous writting, e.g. with different subentries

  • value (str) -- label for postrun mode

  • grows (str) -- growing dimension

  • compression (str) -- flag if compression shuold be applied

  • rate (str) -- compression rate

  • shuffle (str) -- flag if compression shuffle

  • canfail (bool) -- can fail strategy flag

setUnits(unitsAttr)[source]

sets the field unit

Parameters

unitsAttr (str) -- the field unit

class nxstools.nxsxml.NGroup(parent, nameAttr, typeAttr='')[source]

Bases: nxstools.nxsxml.NTag

Group tag wrapper

constructor

Parameters
  • parent (NTag) -- parent tag element

  • nameAttr (str) -- name attribute

  • typeAttr (str) -- type attribute

addAttr(attrName, attrType, attrValue='')[source]

adds attribute: tag

Parameters
  • attrName (str) -- name attribute

  • attrType (str) -- type attribute

  • attrValue (str) -- content of the attribute tag

addDoc(doc)[source]

adds doc tag content

Parameters

doc (str) -- doc tag content

Bases: nxstools.nxsxml.NTag

Link tag wrapper

constructor

Parameters
  • parent (NTag) -- parent tag element

  • nameAttr (str) -- name attribute

  • gTarget (str) -- target attribute

addDoc(doc)[source]

adds doc tag content

Parameters

doc (str) -- doc tag content

class nxstools.nxsxml.NTag(parent, tagName, nameAttr='', typeAttr='')[source]

Bases: object

tag wrapper

constructor

Parameters
  • parent (NTag) -- parent tag element

  • tagName (str) -- tag name

  • nameAttr (str) -- value of name attribute

  • typeAttr (str) -- value of type attribute

addTagAttr(name, value)[source]

adds tag attribute

Parameters
  • name (str) -- attribute name

  • value (str) -- attribute value

addText(text)[source]

adds tag content

Parameters

text (str) -- tag content

elem

(lxml.etree.Element) tag element from etree

setText(text)[source]

sets tag content

Parameters

text (str) -- tag content

class nxstools.nxsxml.XMLFile(fname)[source]

Bases: object

XML file object

constructor

Parameters

fname (str) -- XML file name

dump()[source]

dumps XML structure into the XML file

Brief

It opens XML file, calls prettyPrint and closes the XML file

elem

(lxml.etree.Element) XML root instance

fname

(str) XML file name

prettyPrint(etNode=None)[source]

prints pretty XML making use of etree

Parameters

etNode (lxml.etree.Element) -- node

setDependencies(components, entry=None)[source]

sets tag content

Parameters
  • components (list <str>) -- component dependencies

  • entry (lxml.etree.Element) -- entry node

nxstools.nxsxml.main()[source]

the main function

nxstools.nxsdevicetools module

NDTS TANGO device tools

nxstools.nxsdevicetools.PYTANGO = True

(bool) True if tango available

class nxstools.nxsdevicetools.PackageHandler(packagename='nxstools.xmltemplates')[source]

Bases: object

xml templates package loader

constructor

Parameters

packagename (str) -- full package name

loadXMLTemplates(packagename)[source]

load xml template module variables

Parameters

packagename (str) -- full package name

nxstools.nxsdevicetools.checkServer(name='NXSConfigServer')[source]

provides server device name if only one or error in the other case

Parameters

name (str) -- server name

Returns

server device name or empty string if error appears

Return type

str

nxstools.nxsdevicetools.ctModules = ['mca8715roi', 'onedroi', 'sis3820', 'sis3302roi', 'xmcd', 'vfcadc', 'mythenroi', 'mhzdaqp01', 'dgg2', 'tangoattributectctrl']

(list <str>) counter/timer modules

nxstools.nxsdevicetools.findClassName(server, name)[source]

finds class name

Parameters

name (str) -- device name

Returns

class name

Return type

str

nxstools.nxsdevicetools.generateDeviceNames(prefix, first, last, minimal=False)[source]

generates device names

Parameters
  • prefix (str) -- device name prefix

  • first (int) -- first device index

  • last (int) -- last device index

Returns

device names

Return type

list <str>

nxstools.nxsdevicetools.getAttributes(device, host=None, port=10000)[source]

provides a list of device attributes

Parameters
  • device (str) -- tango device name

  • host (str) -- device host

  • port (int) -- device port

Returns

list of device attributes

Return type

list <str>

nxstools.nxsdevicetools.getClassName(devicename)[source]

provides device class name

Parameters

devicename (str) -- device name

Returns

class name

Return type

str

nxstools.nxsdevicetools.getDataSourceComponents(server, verbose=False)[source]

gets datasource components

Parameters
  • server (str) -- configuration server

  • verbose (bool) -- additional printouts

Returns

dictionary with datasource components

Return type

dict <str, list <str>>

nxstools.nxsdevicetools.getServerTangoHost(server)[source]

fetches the server tango_host:tango_port

Parameters

server (str) -- tango server

Returns

tango host

Return type

str

nxstools.nxsdevicetools.getServers(name='NXSConfigServer')[source]

provides server device names

Parameters

name (str) -- server instance name

Returns

list of the server device names

Return type

list <str>

nxstools.nxsdevicetools.ioRegModules = ['sis3610']

(list <str>) IO register modules

nxstools.nxsdevicetools.listServers(server, name='NXSConfigServer')[source]

finds server names

Parameters

name (str) -- server instance name

Returns

server list

Return type

list <str>

nxstools.nxsdevicetools.moduleMultiAttributes = {'cobold': ['BinSize', 'ExposureTime'], 'dalsa': ['FileDir', 'FilePostfix', 'FilePrefix', 'FileSaving', 'FileStartNum', 'TriggerMode', 'Width', 'Height', 'ExtendedExposure', 'BinComment', 'FramesProcessed', 'Image16', 'Image8', 'ImageRaw', 'FramesReceived', 'FrameRate', 'FramesPerNXFile', 'NXFileCompression', 'TurboMode', 'ImageEnc', 'ViewingMode', 'ThrashedBuffers', 'FramesToAcquire', 'AcquisitionFrameCount', 'AcquisitionMode', 'AcquisitionFrameMode', 'LinearityEqualizer', 'NrExposedFrames', 'NrOffsetFrames', 'Offset', 'PixelFormat', 'ReadOutMode', 'Standby', 'SumScheme'], 'dalsavds': ['FileDir', 'FilePostfix', 'FilePrefix', 'FileSaving', 'FileStartNum', 'TriggerMode', 'Width', 'Height', 'ExtendedExposure', 'BinComment', 'FramesProcessed', 'Image16', 'Image8', 'ImageRaw', 'FramesReceived', 'FrameRate', 'FramesPerNXFile', 'NXFileCompression', 'TurboMode', 'ImageEnc', 'ViewingMode', 'ThrashedBuffers', 'FramesToAcquire', 'AcquisitionFrameCount', 'AcquisitionMode', 'AcquisitionFrameMode', 'LinearityEqualizer', 'NrExposedFrames', 'NrOffsetFrames', 'Offset', 'PixelFormat', 'ReadOutMode', 'Standby', 'SumScheme'], 'eigerdectris': ['TriggerMode', 'NbTriggers', 'Description', 'NbImages', 'BitDepth', 'ReadoutTime', 'CountTime', 'EnergyThreshold', 'FrameTime', 'RateCorrectionEnabled', 'FlatFieldEnabled', 'Temperature', 'AutoSummationEnabled', 'Humidity', 'PhotonEnergy', 'Wavelength'], 'lambda': ['TriggerMode', 'ShutterTime', 'DelayTime', 'FrameNumbers', 'ThreadNo', 'EnergyThreshold', 'OperatingMode', 'ConfigFilePath', 'SaveAllImages', 'FilePrefix', 'FileStartNum', 'FilePreExt', 'FilePostfix', 'SaveFilePath', 'SaveFileName', 'LatestImageNumber', 'LiveMode', 'TotalLossFrames', 'CompressorShuffle', 'CompressionRate', 'CompressionEnabled', 'Layout', 'ShutterTimeMax', 'ShutterTimeMin', 'Width', 'Height', 'Depth', 'LiveFrameNo', 'DistortionCorrection', 'LiveLastImageData', 'FramesPerFile', 'OpMode', 'Translations'], 'lambda2m': ['TriggerMode', 'ShutterTime', 'DelayTime', 'FrameNumbers', 'ThreadNo', 'EnergyThreshold', 'OperatingMode', 'ConfigFilePath', 'SaveAllImages', 'FilePrefix', 'FileStartNum', 'FilePreExt', 'FilePostfix', 'SaveFilePath', 'SaveFileName', 'LatestImageNumber', 'LiveMode', 'TotalLossFrames', 'CompressorShuffle', 'CompressionRate', 'CompressionEnabled', 'Layout', 'ShutterTimeMax', 'ShutterTimeMin', 'Width', 'Height', 'Depth', 'LiveFrameNo', 'DistortionCorrection', 'LiveLastImageData', 'OpMode', 'Translations'], 'lambdavds': ['TriggerMode', 'ShutterTime', 'DelayTime', 'FrameNumbers', 'ThreadNo', 'EnergyThreshold', 'OperatingMode', 'ConfigFilePath', 'SaveAllImages', 'FilePrefix', 'FileStartNum', 'FilePreExt', 'FilePostfix', 'SaveFilePath', 'SaveFileName', 'LatestImageNumber', 'LiveMode', 'TotalLossFrames', 'CompressorShuffle', 'CompressionRate', 'CompressionEnabled', 'Layout', 'ShutterTimeMax', 'ShutterTimeMin', 'Width', 'Height', 'Depth', 'LiveFrameNo', 'DistortionCorrection', 'LiveLastImageData', 'FramesPerFile', 'OpMode', 'Translations'], 'lambdavdsnm': ['TriggerMode', 'ShutterTime', 'DelayTime', 'FrameNumbers', 'ThreadNo', 'EnergyThreshold', 'OperatingMode', 'ConfigFilePath', 'SaveAllImages', 'FilePrefix', 'FileStartNum', 'FilePreExt', 'FilePostfix', 'SaveFilePath', 'SaveFileName', 'LatestImageNumber', 'LiveMode', 'TotalLossFrames', 'CompressorShuffle', 'CompressionRate', 'CompressionEnabled', 'Layout', 'ShutterTimeMax', 'ShutterTimeMin', 'Width', 'Height', 'Depth', 'LiveFrameNo', 'DistortionCorrection', 'LiveLastImageData', 'FramesPerFile', 'OpMode', 'Translations'], 'limaccd': ['camera_type', 'camera_pixelsize', 'camera_model', 'acq_mode', 'acq_nb_frames', 'acq_trigger_mode', 'last_image_saved', 'latency_time', 'acc_max_expo_time', 'acc_expo_time', 'acc_time_mode', 'acc_dead_time', 'acc_live_time', 'saving_mode', 'saving_directory', 'saving_prefix', 'saving_suffix', 'saving_next_number', 'saving_format', 'saving_frame_per_file', 'image_type', 'image_width', 'image_height', 'image_sizes', 'image_roi', 'image_bin', 'image_flip', 'image_rotation', 'shutter_mode', 'shutter_open_time'], 'limaccds': ['camera_type', 'camera_pixelsize', 'camera_model', 'acq_mode', 'acq_nb_frames', 'acq_trigger_mode', 'last_image_saved', 'latency_time', 'acc_max_expo_time', 'acc_expo_time', 'acc_time_mode', 'acc_dead_time', 'acc_live_time', 'saving_mode', 'saving_directory', 'saving_prefix', 'saving_suffix', 'saving_next_number', 'saving_format', 'saving_frame_per_file', 'image_type', 'image_width', 'image_height', 'image_sizes', 'image_roi', 'image_bin', 'image_flip', 'image_rotation', 'shutter_mode', 'shutter_open_time'], 'maiadimension': ['Name', 'PositionSource', 'PixelPitch', 'PixelOrigin', 'PixelHysteresis', 'PositionUnit', 'PixelCoordExtent'], 'maiaflux': ['FluxCoeff', 'FluxName', 'FluxUnit', 'FluxSource'], 'maiainterlock': ['BiasPeltierInterlock', 'BiasPeltierInterlockUptime', 'Pressure'], 'maialogger': ['RunNumber'], 'maiaprocessing': ['GaintrimEnable', 'LineariseEnable', 'PhotonEnable', 'PileupRejectEnable', 'PixelEnable', 'ThrottleEnable'], 'maiasensor': ['BiasVoltage', 'LeakageCurrent', 'PeltierCurrent', 'WaterTemperature', 'DetectorTemperature', 'MosfetTemperature', 'Identity'], 'marccd': ['FrameShift', 'SavingDirectory', 'SavingPostfix', 'SavingPrefix'], 'mca_xia': ['ICR', 'OCR'], 'mca_xia@pool': ['CountsRoI', 'RoIEnd', 'RoIStart'], 'mythen': ['Counts1', 'Counts2', 'CountsMax', 'CountsTotal', 'ExposureTime', 'FileDir', 'FileIndex', 'FilePrefix', 'Data', 'RoI1', 'RoI2'], 'mythen2': ['Counts1', 'Counts2', 'CountsMax', 'CountsTotal', 'ExposureTime', 'FileDir', 'FileIndex', 'FilePrefix', 'Data', 'Energy', 'NbFrames', 'RoI1End', 'RoI2End', 'RoI1Start', 'RoI2Start', 'Threshold'], 'pco': ['DelayTime', 'ExposureTime', 'NbFrames', 'TriggerMode', 'FileDir', 'FilePostfix', 'FilePrefix', 'FileStartNum', 'Binning_x', 'Binning_y', 'ROI_x_min', 'ROI_x_max', 'ROI_y_min', 'ROI_y_max', 'Pixelrate', 'ADCs', 'CoolingTemp', 'CoolingTempSet', 'ImageTimeStamp', 'RecorderMode'], 'pco4000': ['DelayTime', 'ExposureTime', 'NbFrames', 'TriggerMode', 'FileDir', 'FilePostfix', 'FilePrefix', 'FileStartNum', 'Binning_x', 'Binning_y', 'ROI_x_min', 'ROI_x_max', 'ROI_y_min', 'ROI_y_max', 'Pixelrate', 'ADCs', 'CoolingTemp', 'CoolingTempSet', 'ImageTimeStamp', 'RecorderMode'], 'pcoedge': ['DelayTime', 'ExposureTime', 'NbFrames', 'TriggerMode', 'FileDir', 'FilePostfix', 'FilePrefix', 'FileStartNum', 'Binning_x', 'Binning_y', 'ROI_x_min', 'ROI_x_max', 'ROI_y_min', 'ROI_y_max', 'Pixelrate', 'ADCs', 'CoolingTemp', 'CoolingTempSet', 'ImageTimeStamp', 'RecorderMode'], 'pedetector': ['BinningMode', 'FileIndex', 'ExposureTime', 'SkippedAtStart', 'SummedSaveImages', 'SkippedBetweenSaved', 'FilesAfterTrigger', 'FilesBeforeTrigger', 'SummedDarkImages', 'OutputDirectory', 'FilePattern', 'FileName', 'LogFile', 'UserComment1', 'CameraGain', 'UserComment2', 'UserComment3', 'UserComment4', 'SaveRawImages', 'SaveDarkImages', 'PerformIntegration', 'SaveIntegratedData', 'SaveSubtracted', 'PerformDarkSubtraction'], 'perkinelmer': ['BinningMode', 'FileIndex', 'ExposureTime', 'SkippedAtStart', 'SummedSaveImages', 'SkippedBetweenSaved', 'FilesAfterTrigger', 'FilesBeforeTrigger', 'SummedDarkImages', 'OutputDirectory', 'FilePattern', 'FileName', 'LogFile', 'UserComment1', 'CameraGain', 'UserComment2', 'UserComment3', 'UserComment4', 'SaveRawImages', 'SaveDarkImages', 'PerformIntegration', 'SaveIntegratedData', 'SaveSubtracted', 'PerformDarkSubtraction'], 'perkinelmerdetector': ['BinningMode', 'FileIndex', 'ExposureTime', 'SkippedAtStart', 'SummedSaveImages', 'SkippedBetweenSaved', 'FilesAfterTrigger', 'FilesBeforeTrigger', 'SummedDarkImages', 'OutputDirectory', 'FilePattern', 'FileName', 'LogFile', 'UserComment1', 'CameraGain', 'UserComment2', 'UserComment3', 'UserComment4', 'SaveRawImages', 'SaveDarkImages', 'PerformIntegration', 'SaveIntegratedData', 'SaveSubtracted', 'PerformDarkSubtraction'], 'pilatus': ['DelayTime', 'ExposurePeriod', 'ExposureTime', 'FileDir', 'FilePostfix', 'FilePrefix', 'FileStartNum', 'LastImageTaken', 'NbExposures', 'NbFrames', 'MXparameters'], 'pilatus100k': ['DelayTime', 'ExposurePeriod', 'ExposureTime', 'FileDir', 'FilePostfix', 'FilePrefix', 'FileStartNum', 'LastImageTaken', 'NbExposures', 'NbFrames', 'MXparameters'], 'pilatus1m': ['DelayTime', 'ExposurePeriod', 'ExposureTime', 'FileDir', 'FilePostfix', 'FilePrefix', 'FileStartNum', 'LastImageTaken', 'NbExposures', 'NbFrames', 'MXparameters'], 'pilatus2m': ['DelayTime', 'ExposurePeriod', 'ExposureTime', 'FileDir', 'FilePostfix', 'FilePrefix', 'FileStartNum', 'LastImageTaken', 'NbExposures', 'NbFrames', 'MXparameters'], 'pilatus300k': ['DelayTime', 'ExposurePeriod', 'ExposureTime', 'FileDir', 'FilePostfix', 'FilePrefix', 'FileStartNum', 'LastImageTaken', 'NbExposures', 'NbFrames', 'MXparameters'], 'pilatus6m': ['DelayTime', 'ExposurePeriod', 'ExposureTime', 'FileDir', 'FilePostfix', 'FilePrefix', 'FileStartNum', 'LastImageTaken', 'NbExposures', 'NbFrames', 'MXparameters'], 'tangovimba': ['Width', 'WidthMax', 'TriggerSource', 'PixelFormat', 'OffsetY', 'OffsetX', 'HeightMax', 'Height', 'GainRaw', 'ExposureTimeAbs', 'AcquisitionFrameRateAbs', 'AcquisitionFrameRateLimit', 'StreamBytesPerSecond', 'BinComment', 'FileDir', 'FilePostfix', 'FilePrefix', 'FileSaving', 'FileStartNum', 'FramesProcessed', 'Image16', 'Image8', 'ImageRaw', 'MaxLoad', 'ReadMode', 'TuneMode', 'ViewingMode']}

(dict <str , list <str> >) important attributes of modules

nxstools.nxsdevicetools.moduleTemplateFiles = {'cobold': ['cobold.xml'], 'dalsa': ['dalsa.xml', 'dalsa_nxdata.ds.xml', 'dalsa_external_data.ds.xml'], 'dalsavds': ['dalsavds.xml', 'dalsavds_nxdata.ds.xml', 'dalsavds_triggermode_cb.ds.xml', 'dalsavds_filestartnum_cb.ds.xml', 'dalsavds_nrexposedframes_cb.ds.xml'], 'eigerdectris': ['eigerdectris.xml', 'eigerdectris_stepindex.ds.xml', 'eigerdectris_description_cb.ds.xml', 'eigerdectris_triggermode_cb.ds.xml'], 'lambda': ['lambda.xml', 'lambda_nxdata.ds.xml', 'lambda_external_data.ds.xml'], 'lambda2m': ['lambda2m.xml', 'lambda2m_m1_nxdata.ds.xml', 'lambda2m_m2_nxdata.ds.xml', 'lambda2m_m3_nxdata.ds.xml', 'lambda2m_m1_external_data.ds.xml', 'lambda2m_m2_external_data.ds.xml', 'lambda2m_m3_external_data.ds.xml'], 'lambdavds': ['lambdavds.xml', 'lambdavds_nxdata.ds.xml', 'lambdavds_description.ds.xml', 'lambdavds_triggermode_cb.ds.xml', 'lambdavds_framenumbers_cb.ds.xml', 'lambdavds_savefilename_cb.ds.xml'], 'lambdavdsnm': ['lambdavdsnm.xml', 'lambdavdsnm_triggermode_cb.ds.xml', 'lambdavdsnm_nxdata.ds.xml'], 'limaccd': ['limaccd.xml', 'limaccd_postrun.ds.xml', 'limaccd_xpixelsize.ds.xml', 'limaccd_ypixelsize.ds.xml', 'limaccd_description.ds.xml', 'limaccd_filestartnum_cb.ds.xml'], 'limaccds': ['limaccd.xml', 'limaccd_postrun.ds.xml', 'limaccd_xpixelsize.ds.xml', 'limaccd_ypixelsize.ds.xml', 'limaccd_description.ds.xml', 'limaccd_filestartnum_cb.ds.xml'], 'marccd': ['marccd.xml', 'marccd_postrun.ds.xml'], 'mca_xia': ['mcaxia.xml'], 'mythen': ['mythen.xml', 'mythen_postrun.ds.xml', 'mythen_filestartnumber.ds.xml'], 'mythen2': ['mythen2.xml'], 'pco': ['pco.xml', 'pco_postrun.ds.xml', 'pco_description.ds.xml', 'pco_filestartnum_cb.ds.xml'], 'pco4000': ['pco.xml', 'pco_postrun.ds.xml', 'pco_description.ds.xml', 'pco_filestartnum_cb.ds.xml'], 'pcoedge': ['pco.xml', 'pco_postrun.ds.xml', 'pco_description.ds.xml', 'pco_filestartnum_cb.ds.xml'], 'pedetector': ['perkinelmerdetector.xml', 'perkinelmerdetector_postrun.ds.xml', 'perkinelmerdetector_description.ds.xml', 'perkinelmerdetector_fileindex_cb.ds.xml'], 'perkinelmer': ['perkinelmerdetector.xml', 'perkinelmerdetector_postrun.ds.xml', 'perkinelmerdetector_description.ds.xml', 'perkinelmerdetector_fileindex_cb.ds.xml'], 'perkinelmerdetector': ['perkinelmerdetector.xml', 'perkinelmerdetector_postrun.ds.xml', 'perkinelmerdetector_description.ds.xml', 'perkinelmerdetector_fileindex_cb.ds.xml'], 'pilatus': ['pilatus.xml', 'pilatus_postrun.ds.xml', 'pilatus_description.ds.xml', 'pilatus_mxparameters_cb.ds.xml', 'pilatus_filestartnum_cb.ds.xml'], 'pilatus100k': ['pilatus.xml', 'pilatus_postrun.ds.xml', 'pilatus100k_description.ds.xml', 'pilatus_mxparameters_cb.ds.xml', 'pilatus_filestartnum_cb.ds.xml'], 'pilatus1m': ['pilatus.xml', 'pilatus_postrun.ds.xml', 'pilatus1m_description.ds.xml', 'pilatus_mxparameters_cb.ds.xml', 'pilatus_filestartnum_cb.ds.xml'], 'pilatus2m': ['pilatus.xml', 'pilatus_postrun.ds.xml', 'pilatus6m_description.ds.xml', 'pilatus_mxparameters_cb.ds.xml', 'pilatus_filestartnum_cb.ds.xml'], 'pilatus300k': ['pilatus.xml', 'pilatus_postrun.ds.xml', 'pilatus300k_description.ds.xml', 'pilatus_mxparameters_cb.ds.xml', 'pilatus_filestartnum_cb.ds.xml'], 'pilatus6m': ['pilatus.xml', 'pilatus_postrun.ds.xml', 'pilatus_mxparameters_cb.ds.xml', 'pilatus6m_description.ds.xml', 'pilatus_filestartnum_cb.ds.xml'], 'tangovimba': ['tangovimba.xml', 'tangovimba_nxdata.ds.xml', 'tangovimba_external_data.ds.xml']}

(dict <str , list <str> >) xml template files of modules

nxstools.nxsdevicetools.motorModules = ['absbox', 'motor_tango', 'kohzu', 'smchydra', 'lom', 'oms58', 'e6c', 'omsmaxv', 'spk', 'pie710', 'pie712', 'e6c_p09_eh2', 'smaract']

(list <str>) modules of motors

nxstools.nxsdevicetools.oneDModules = ['mca_xia']

(list <str>) modules of 1D detectors

nxstools.nxsdevicetools.openServer(device)[source]

opens connection to the configuration server

Parameters

configuration (str) -- server device name

Returns

configuration server proxy

Return type

tango.DeviceProxy

nxstools.nxsdevicetools.standardComponentTemplateFiles = {'absorber': ['absorber_foil.ds.xml', 'absorber_thickness.ds.xml', 'absorber.xml'], 'beamstop': ['beamstop.xml'], 'beamtimefname': ['beamtimefname.xml', 'beamtimefname.ds.xml', 'start_time.ds.xml'], 'beamtimeid': ['beamtimeid.xml', 'beamtimeid.ds.xml', 'start_time.ds.xml'], 'chcut': ['chcut.xml', 'chcut_unitcalibration.ds.xml', 'chcut_crystal.ds.xml'], 'coboldhisto': ['coboldhisto.xml', 'coboldhisto_timeofflight.ds.xml'], 'collect2': ['collect2.xml'], 'collect3': ['collect3.xml'], 'collect4': ['collect4.xml'], 'collect5': ['collect5.xml'], 'collect6': ['collect6.xml'], 'common2': ['common2_common.ds.xml'], 'common3': ['common3_common.ds.xml'], 'dataaxessignal': ['dataaxessignal.xml', 'defaultsignal.ds.xml', 'defaultaxes.ds.xml', 'signal_name.ds.xml', 'signalname.ds.xml', 'sardanaenvironment.ds.xml'], 'datasignal': ['datasignal.xml', 'defaultsignal.ds.xml', 'signal_name.ds.xml', 'signalname.ds.xml', 'signal_axes.ds.xml', 'sardanaenvironment.ds.xml'], 'dcm': ['dcm.xml', 'dcm_reflection.ds.xml', 'dcm_unitcalibration.ds.xml', 'dcm_crystal.ds.xml'], 'default': ['default.xml', 'defaultsample.xml', 'defaultinstrument.xml', 'sample_name.ds.xml', 'chemical_formula.ds.xml', 'beamtime_id.ds.xml', 'beamtime_filename.ds.xml', 'start_time.ds.xml', 'end_time.ds.xml', 'nexdatas_version.ds.xml', 'nexdatas_configuration.ds.xml', 'title.ds.xml'], 'defaultinstrument': ['defaultinstrument.xml', 'beamtime_id.ds.xml', 'beamtime_filename.ds.xml', 'start_time.ds.xml', 'end_time.ds.xml', 'nexdatas_version.ds.xml', 'nexdatas_configuration.ds.xml', 'title.ds.xml'], 'defaultsample': ['defaultsample.xml', 'sample_name.ds.xml', 'chemical_formula.ds.xml'], 'description': ['description.xml', 'experiment_description.ds.xml'], 'descriptiontext': ['descriptiontext.xml'], 'detectorlive': ['detectorlive.xml'], 'empty': ['empty.xml'], 'groupsecop': ['groupsecop.ds.xml', 'groupsecop_time.ds.xml', 'client_start_time.ds.xml', 'sample_env_links.ds.xml', 'sample_log_links.ds.xml'], 'keithley': ['keithley.xml'], 'maia': ['maia.xml', 'empty.xml'], 'maiadimension': ['maiadimension.xml'], 'maiaflux': ['maiaflux.xml'], 'msnsar': ['msnsar_env.ds.xml', 'sardanaenvironment.ds.xml'], 'mssar': ['mssar_env.ds.xml', 'sardanaenvironment.ds.xml'], 'parametercopymap': ['parametercopymap.xml'], 'pinhole': ['pinhole.xml'], 'pointdet': ['pointdet.xml'], 'qbpm': ['qbpm_foil.ds.xml', 'qbpm.xml'], 'sampledescription': ['sampledescription.xml', 'sample_description.ds.xml'], 'sampledescriptiontext': ['sampledescriptiontext.xml'], 'samplehkl': ['samplehkl.xml'], 'secop': ['secop.ds.xml', 'secop_time.ds.xml', 'client_start_time.ds.xml', 'sample_env_links.ds.xml', 'sample_log_links.ds.xml'], 'secoplinks': ['sample_env_links.ds.xml', 'sample_log_links.ds.xml', 'sample_nxdata.ds.xml', 'sampleenv_nxdata.ds.xml'], 'singlesecop': ['singlesecop.ds.xml', 'singlesecop_time.ds.xml', 'client_start_time.ds.xml', 'sample_env_links.ds.xml', 'sample_log_links.ds.xml'], 'slit': ['slit.xml'], 'source': ['source.xml'], 'starttime': ['starttime.xml', 'starttime.ds.xml', 'start_timestamp.ds.xml', 'client_start_time.ds.xml'], 'tango': ['tango.ds.xml'], 'undulator': ['undulator.xml']}

(dict <str , list <str> >) xml template files of modules

nxstools.nxsdevicetools.standardComponentVariables = {'absorber': {'attenfactor': {'default': None, 'doc': 'attenuation factor (datasource)'}, 'dependstop': {'default': None, 'doc': 'the first transformation, e.g. distance (string)'}, 'distance': {'default': None, 'doc': 'distance for the sample in m, e.g. 0 (string)'}, 'distancename': {'default': 'distance', 'doc': 'distance name for the sample in m, e.g. 0 (string)'}, 'distanceoffset': {'default': None, 'doc': '3-vector distance offset in m, e.g. sample-source offset if the distance is taken from the source (string)'}, 'foil': {'default': None, 'doc': 'foil type, i.e. standard <cpname>_foil (datasource)'}, 'foillist': {'default': '["Ag", "Ag", "Ag", "Ag", "", "Al", "Al", "Al", "Al"]', 'doc': 'foil_type position json dictionary (string)'}, 'position': {'default': None, 'doc': 'which sliders are in [bitarray] MANDATORY (datasource)'}, 'thickness': {'default': None, 'doc': 'foil thickness, i.e. standard <cpname>_thickness (datasource)'}, 'thicknesslist': {'default': '[0.5, 0.05, 0.025, 0.0125, 0, 0.1, 0.3, 0.5, 1.0]', 'doc': 'foil_type position json dictionary (string)'}, 'transformations': {'default': None, 'doc': "transformations group name i.e. 'transformations'. If it is not set it is not created (string)"}, 'y': {'default': None, 'doc': 'vertical position (datasource)'}, 'yname': {'default': 'y', 'doc': 'vertical position name (string)'}}, 'beamstop': {'description': {'default': 'circular', 'doc': ' circular or rectangular (string)'}, 'x': {'default': None, 'doc': 'horizontal position (datasource)'}, 'xname': {'default': 'x', 'doc': 'horizontal position name (string)'}, 'xsign': {'default': '', 'doc': "horizontal position sign, e.g. '-' (string)"}, 'y': {'default': None, 'doc': 'vertical position (datasource)'}, 'yname': {'default': 'y', 'doc': 'vertical position name (string)'}, 'z': {'default': None, 'doc': 'vertical position (datasource)'}, 'zname': {'default': 'z', 'doc': 'along the beam position name (string)'}}, 'beamtimefname': {'commissiondir': {'default': '/gpfs/commissioning', 'doc': 'commission file directory (string)'}, 'commissionpostfix': {'default': '.json', 'doc': 'commission file postfix (string)'}, 'commissionprefix': {'default': 'commissioning-metadata-', 'doc': 'commission file prefix (string)'}, 'currentdir': {'default': '/gpfs/current', 'doc': 'beamtime file directory (string)'}, 'currentpostfix': {'default': '.json', 'doc': 'beamtime file postfix (string)'}, 'currentprefix': {'default': 'beamtime-metadata-', 'doc': 'beamtime file prefix (string)'}, 'localdir': {'default': '/gpfs/local', 'doc': 'local file directory (string)'}, 'shortname': {'default': 'P09', 'doc': 'beamline short name (string)'}}, 'beamtimeid': {'commissiondir': {'default': '/gpfs/commissioning', 'doc': 'commission file directory (string)'}, 'commissionpostfix': {'default': '.json', 'doc': 'commission file postfix (string)'}, 'commissionprefix': {'default': 'commissioning-metadata-', 'doc': 'commission file prefix (string)'}, 'currentdir': {'default': '/gpfs/current', 'doc': 'beamtime file directory (string)'}, 'currentpostfix': {'default': '.json', 'doc': 'beamtime file postfix (string)'}, 'currentprefix': {'default': 'beamtime-metadata-', 'doc': 'beamtime file prefix (string)'}, 'localdir': {'default': '/gpfs/local', 'doc': 'local file directory (string)'}, 'shortname': {'default': 'P09', 'doc': 'beamline short name (string)'}}, 'chcut': {'braggangle': {'default': None, 'doc': 'bragg angle (datasource)'}, 'bragganglename': {'default': 'bragg', 'doc': 'bragg angle name (string)'}, 'chcutdevice': {'default': None, 'doc': 'FMBOxfDCMEnergy tango device name (string)'}, 'crystal': {'default': None, 'doc': ' type of crystal i.e. 0->Si111,1->Si311,2->Si111 ChannelCut (datasource)'}, 'energy': {'default': None, 'doc': 'synchronized monochromator energy (datasource)'}, 'energyfmb': {'default': None, 'doc': 'monochromator energy (datasource)'}, 'jack1': {'default': None, 'doc': 'first vertical jack of table (datasource)'}, 'jack1name': {'default': 'jack1', 'doc': 'first vertical jack name of table (string)'}, 'jack2': {'default': None, 'doc': 'second vertical jack of table (datasource)'}, 'jack2name': {'default': 'jack2', 'doc': 'second vertical jack name of table (string)'}, 'jack3': {'default': None, 'doc': 'third vertical jack of table (datasource)'}, 'jack3name': {'default': 'jack3', 'doc': 'third vertical jack name of table (string)'}, 'lat': {'default': None, 'doc': 'horizontal lattice translation of the first cristal (datasource)'}, 'latname': {'default': 'lat', 'doc': 'horizontal lattice translation name of the first cristal (string)'}, 'oxfordhorizontal': {'default': None, 'doc': ' horizontal translation (datasource)'}, 'para': {'default': None, 'doc': 'distance between the crystals (string)'}, 'paraname': {'default': 'para', 'doc': 'beam parallel translation name of the second cristal (string)'}, 'reflection': {'default': None, 'doc': 'reflection from string (datasource)'}, 'table': {'default': None, 'doc': 'vertical position of table (datasource)'}, 'tablename': {'default': 'table', 'doc': 'vertical position name of table (string)'}, 'theta': {'default': None, 'doc': 'theta angle (datasource)'}, 'thetaname': {'default': 'theta', 'doc': 'theta angle name (string)'}, 'unitcalibration': {'default': None, 'doc': ' unit calibration from dcmmotor (datasource)'}, 'usage': {'default': 'Bragg', 'doc': 'the crystall usage, e.g. Laue (string)'}, 'yaw': {'default': None, 'doc': 'phi rotation of the first cristal (datasource)'}, 'yawname': {'default': 'phi', 'doc': 'phi rotation name of the first cristal (string)'}}, 'coboldhisto': {'binsize': {'default': None, 'doc': 'bin size of histogram data (datasource)'}, 'exposuretime': {'default': None, 'doc': 'exposure time for histogram data (datasource)'}, 'histogram': {'default': None, 'doc': 'histogram data (datasource)'}}, 'collect2': {'first': {'default': None, 'doc': 'name of the first component to collect MANDATORY (datasource)'}, 'second': {'default': None, 'doc': 'name of the second component to collect MANDATORY (datasource)'}}, 'collect3': {'first': {'default': None, 'doc': 'name of the first component to collect MANDATORY (datasource)'}, 'second': {'default': None, 'doc': 'name of the second component to collect MANDATORY (datasource)'}, 'third': {'default': None, 'doc': 'name of the third component to collect MANDATORY (datasource)'}}, 'collect4': {'first': {'default': None, 'doc': 'name of the first component to collect MANDATORY (datasource)'}, 'fourth': {'default': None, 'doc': 'name of the fourth component to collect MANDATORY (datasource)'}, 'second': {'default': None, 'doc': 'name of the second component to collect MANDATORY (datasource)'}, 'third': {'default': None, 'doc': 'name of the third component to collect MANDATORY (datasource)'}}, 'collect5': {'fifth': {'default': None, 'doc': 'name of the fifth component to collect MANDATORY (datasource)'}, 'first': {'default': None, 'doc': 'name of the first component to collect MANDATORY (datasource)'}, 'fourth': {'default': None, 'doc': 'name of the fourth component to collect MANDATORY (datasource)'}, 'second': {'default': None, 'doc': 'name of the second component to collect MANDATORY (datasource)'}, 'third': {'default': None, 'doc': 'name of the third component to collect MANDATORY (datasource)'}}, 'collect6': {'fifth': {'default': None, 'doc': 'name of the fifth component to collect MANDATORY (datasource)'}, 'first': {'default': None, 'doc': 'name of the first component to collect MANDATORY (datasource)'}, 'fourth': {'default': None, 'doc': 'name of the fourth component to collect MANDATORY (datasource)'}, 'second': {'default': None, 'doc': 'name of the second component to collect MANDATORY (datasource)'}, 'sixth': {'default': None, 'doc': 'name of the sixth component to collect MANDATORY (datasource)'}, 'third': {'default': None, 'doc': 'name of the third component to collect MANDATORY (datasource)'}}, 'common2': {'dds': {'default': None, 'doc': 'default read datasource name MANDATORY (datasource)'}, 'ods': {'default': None, 'doc': 'optional detasource name MANDATORY (datasource)'}}, 'common3': {'dds': {'default': None, 'doc': 'default read datasource name MANDATORY (datasource)'}, 'ods1': {'default': None, 'doc': 'fist optional detasource name MANDATORY (datasource)'}, 'ods2': {'default': None, 'doc': 'second optional detasource name MANDATORY (datasource)'}}, 'dataaxessignal': {'__tangohost__': {'default': 'localhost', 'doc': 'tango host (string)'}, '__tangoport__': {'default': '10000', 'doc': 'tango port (string)'}, 'axes': {'default': 'defaultaxes', 'doc': 'list of data axes field names (datasource)'}, 'defaultattrs': {'default': 'False', 'doc': 'add default attributes (string)'}, 'msenv': {'default': None, 'doc': 'sardana environment (datasource)'}, 'mssardanadevice': {'default': None, 'doc': 'macroserver sardana device name MANDATORY (string)'}, 'nchannelstoskip': {'default': '0', 'doc': 'number of mg channels to skip (string)'}, 'sardanasignal': {'default': 'SignalCounter', 'doc': 'signal sardana variable name (string)'}, 'signal': {'default': 'defaultsignal', 'doc': 'data signal field name (datasource)'}}, 'datasignal': {'__tangohost__': {'default': 'localhost', 'doc': 'tango host (string)'}, '__tangoport__': {'default': '10000', 'doc': 'tango port (string)'}, 'axes': {'default': None, 'doc': 'data axes field name(s) (datasource)'}, 'msenv': {'default': None, 'doc': 'sardana environment (datasource)'}, 'mssardanadevice': {'default': None, 'doc': 'macroserver sardana device name MANDATORY (string)'}, 'nchannelstoskip': {'default': '0', 'doc': 'number of mg channels to skip (string)'}, 'sardanasignal': {'default': 'SignalCounter', 'doc': 'signal sardana variable name (string)'}, 'signal': {'default': 'defaultsignal', 'doc': 'data signal field name (datasource)'}}, 'dcm': {'bend1': {'default': None, 'doc': 'bending of the first cristal (datasource)'}, 'bend2': {'default': None, 'doc': 'bending of the second cristal (datasource)'}, 'braggangle': {'default': None, 'doc': 'bragg angle (datasource)'}, 'bragganglename': {'default': 'bragg', 'doc': 'bragg angle name (string)'}, 'chi2dependson': {'default': 'theta', 'doc': 'the depends_on field of the second cristal chi, e.g. phi (string)'}, 'crystal': {'default': None, 'doc': 'type of crystal i.e. 0->Si111,1->Si311,2->Si111 ChannelCut (datasource)'}, 'dcmdevice': {'default': None, 'doc': 'FMBOxfDCMEnergy tango device (string)'}, 'energy': {'default': None, 'doc': 'synchronized monochromator energy (datasource)'}, 'energyfmb': {'default': None, 'doc': 'monochromator energy (datasource)'}, 'exitoffset': {'default': None, 'doc': ' exit offset (datasource)'}, 'jack1': {'default': None, 'doc': 'first vertical jack of table (datasource)'}, 'jack1name': {'default': 'jack1', 'doc': 'first vertical jack name of table (string)'}, 'jack2': {'default': None, 'doc': 'second vertical jack of table (datasource)'}, 'jack2name': {'default': 'jack2', 'doc': 'second vertical jack name of table (string)'}, 'jack3': {'default': None, 'doc': 'third vertical jack of table (datasource)'}, 'jack3name': {'default': 'jack3', 'doc': 'third vertical jack name of table (string)'}, 'lat': {'default': None, 'doc': 'horizontal lattice translation of the first cristal (datasource)'}, 'lat2': {'default': None, 'doc': 'horizontal lattice translation of the second cristal (datasource)'}, 'lat2name': {'default': 'lat', 'doc': 'horizontal lattice translation name of the second cristal (string)'}, 'latname': {'default': 'lat', 'doc': 'horizontal lattice translation name of the first cristal (string)'}, 'oxfordhorizontal': {'default': None, 'doc': ' horizontal translation (datasource)'}, 'par2': {'default': None, 'doc': 'beam parallel translation of the second cristal (datasource)'}, 'par2name': {'default': 'para', 'doc': 'beam parallel translation name of the second cristal (string)'}, 'perp2': {'default': None, 'doc': 'vertical translation of the second cristal (datasource)'}, 'perp2name': {'default': 'perp', 'doc': 'vertical translation name of the second cristal (string)'}, 'phi1dependson': {'default': '../../transformations/bragg', 'doc': 'the depends_on field of the first cristal phi, e.g. theta (string)'}, 'pitch1': {'default': None, 'doc': 'theta rotation of the first cristal (datasource)'}, 'pitch1name': {'default': 'theta', 'doc': 'theta rotation name of the first cristal (string)'}, 'pitch2': {'default': None, 'doc': 'theta rotation of the second cristal (datasource)'}, 'pitch2name': {'default': 'theta', 'doc': 'theta rotation name of the second cristal (string)'}, 'roll1': {'default': None, 'doc': 'chi rotation of the first cristal (datasource)'}, 'roll1name': {'default': 'chi', 'doc': 'chi rotation name of the first cristal (string)'}, 'roll2': {'default': None, 'doc': 'chi rotation of the second cristal (datasource)'}, 'roll2name': {'default': 'chi', 'doc': 'chi rotation name of the second cristal (string)'}, 'table': {'default': None, 'doc': 'vertical position of table (datasource)'}, 'tablename': {'default': 'table', 'doc': 'vertical position name of table (string)'}, 'theta': {'default': None, 'doc': 'theta angle (datasource)'}, 'thetaname': {'default': 'theta', 'doc': 'theta angle name (string)'}, 'topdependson2': {'default': 'chi', 'doc': 'the first transformation of the second crystal, e.g. lat (string)'}, 'unitcalibration': {'default': None, 'doc': 'unit calibration from dcmmotor (datasource)'}, 'usage': {'default': 'Bragg', 'doc': 'the crystall usage, e.g. Laue (string)'}, 'yaw': {'default': None, 'doc': 'phi rotation of the first cristal (datasource)'}, 'yaw2': {'default': None, 'doc': 'phi rotation of the second cristal (datasource)'}, 'yaw2name': {'default': 'phi', 'doc': 'phi rotation name of the second cristal (string)'}, 'yawname': {'default': 'phi', 'doc': 'phi rotation name of the first cristal (string)'}}, 'default': {'__configdevice__': {'default': 'nxs/configserver/localhost', 'doc': 'configuration server device name (string)'}, '__tangohost__': {'default': 'localhost', 'doc': 'tango host (string)'}, '__tangoport__': {'default': '10000', 'doc': 'tango port (string)'}, 'control': {'default': None, 'doc': 'group name of the monitor (string)'}, 'longname': {'default': 'P09 Resonant Scattering and Diffraction beamline', 'doc': 'beamline long name (string)'}, 'shortname': {'default': 'P09', 'doc': 'beamline short name (string)'}, 'sourcename': {'default': 'PETRA III', 'doc': 'source name (string)'}, 'srcname': {'default': 'source', 'doc': 'source group name (string)'}}, 'defaultinstrument': {'__configdevice__': {'default': 'nxs/configserver/localhost', 'doc': 'configuration server device name (string)'}, '__tangohost__': {'default': 'localhost', 'doc': 'tango host (string)'}, '__tangoport__': {'default': '10000', 'doc': 'tango port (string)'}, 'control': {'default': None, 'doc': 'group name of the monitor (string)'}, 'longname': {'default': 'P09 Resonant Scattering and Diffraction beamline', 'doc': 'beamline long name (string)'}, 'shortname': {'default': 'P09', 'doc': 'beamline short name (string)'}, 'sourcename': {'default': 'PETRA III', 'doc': 'source name (string)'}, 'srcname': {'default': 'source', 'doc': 'source group name (string)'}}, 'defaultsample': {}, 'description': {}, 'descriptiontext': {'description': {'default': 'scan', 'doc': 'scan technique (string)'}}, 'detectorlive': {'datatype': {'default': 'NX_UINT32', 'doc': 'list of devices (string)'}, 'detectordata': {'default': None, 'doc': 'detector live data (datasource)'}, 'detname': {'default': 'detector', 'doc': 'list of devices (string)'}}, 'empty': {}, 'groupsecop': {'access': {'default': None, 'doc': 'secop access list (string)'}, 'group': {'default': None, 'doc': 'secop group name (string)'}, 'host': {'default': None, 'doc': 'secop host name (string)'}, 'message': {'default': None, 'doc': 'secop command MANDATORY (string)'}, 'port': {'default': '5000', 'doc': 'secop port name (string)'}, 'timeout': {'default': '0.0001', 'doc': 'secop timeout (string)'}}, 'keithley': {'current': {'default': None, 'doc': 'current in A (datasource)'}, 'gain': {'default': None, 'doc': 'gain in V/A (datasource)'}, 'risetime': {'default': None, 'doc': 'rise time (datasource)'}, 'sourvoltlevel': {'default': None, 'doc': 'source voltage level in V (datasource)'}, 'voltage': {'default': None, 'doc': 'voltage in V (datasource)'}}, 'maia': {'chillersetpoint': {'default': None, 'doc': 'chiller set point temperature in Celsus (datasource)'}, 'chiptemperature': {'default': None, 'doc': 'detector chip temperature sensor for maia in Celsus (datasource)'}, 'gaintrimenable': {'default': None, 'doc': 'gaintrim enable status for maia (datasource)'}, 'identity': {'default': None, 'doc': 'sensor identity for maia (datasource)'}, 'interlockpressure': {'default': None, 'doc': 'interlock pressure for maia in mbar (datasource)'}, 'leakagecurrent': {'default': None, 'doc': 'leakage current sensor for maia in A (datasource)'}, 'lineariseenable': {'default': None, 'doc': 'linearise enable status for maia (datasource)'}, 'maiadimensions': {'default': 'empty', 'doc': 'maia dimensions component name (component)'}, 'maiafluxes': {'default': 'empty', 'doc': 'maia fluxes component name (component)'}, 'maiastage': {'default': 'empty', 'doc': 'maia stage component name (component)'}, 'mosfettemperature': {'default': None, 'doc': 'mosfet temperature sensor for maia in Celsus (datasource)'}, 'peltiercurrent': {'default': None, 'doc': 'peltier current sensor for maia in A (datasource)'}, 'photonenable': {'default': None, 'doc': 'photon enable status for maia (datasource)'}, 'pileuprejectionenable': {'default': None, 'doc': 'pileup rejection enable status for maia (datasource)'}, 'pixelenable': {'default': None, 'doc': 'pixel enable status for maia (datasource)'}, 'pressure': {'default': None, 'doc': 'gas pressure in mbar (datasource)'}, 'runnumber': {'default': None, 'doc': 'run number of maia (datasource)'}, 'status': {'default': None, 'doc': 'interlock status for maia (datasource)'}, 'throttleenable': {'default': None, 'doc': 'throttle enable status for maia (datasource)'}, 'uptime': {'default': None, 'doc': 'interlock uptime for maia (datasource)'}, 'voltagesetpoint': {'default': None, 'doc': 'voltage set point temperature in Celsus (datasource)'}, 'watertemperature': {'default': None, 'doc': 'water temperature sensor for maia in Celsus (datasource)'}}, 'maiadimension': {'detname': {'default': 'maia', 'doc': 'detector (alias) name (string)'}, 'dimname': {'default': None, 'doc': 'dimension name for maia (datasource)'}, 'dname': {'default': 'dimension', 'doc': 'dimension name group (string)'}, 'hysteresis': {'default': None, 'doc': 'pixel hysteresis of dimension for maia (datasource)'}, 'numberofpixels': {'default': None, 'doc': 'number of pixels of dimension for maia (datasource)'}, 'origin': {'default': None, 'doc': 'pixel origin of dimension for maia (datasource)'}, 'pixelpitch': {'default': None, 'doc': 'pixel pitch of dimension for maia (datasource)'}, 'positionsource': {'default': None, 'doc': 'position source of dimension for maia (datasource)'}, 'unit': {'default': None, 'doc': 'position units of dimension for maia (datasource)'}}, 'maiaflux': {'coefficient': {'default': None, 'doc': 'flux coefficient for maia (datasource)'}, 'detname': {'default': 'maia', 'doc': 'detector (alias) name (string)'}, 'fluxname': {'default': None, 'doc': 'flux name for maia (datasource)'}, 'fname': {'default': 'fluxdevice', 'doc': 'flux name group (string)'}, 'keithleydevice': {'default': 'keithley', 'doc': 'keithley device name (string)'}, 'source': {'default': None, 'doc': 'flux source for maia (datasource)'}, 'unit': {'default': None, 'doc': 'flux unit for maia (datasource)'}, 'vfcfactor': {'default': None, 'doc': 'vfc conversion factor (datasource)'}}, 'msnsar': {'__tangohost__': {'default': 'localhost', 'doc': 'tango host (string)'}, '__tangoport__': {'default': '10000', 'doc': 'tango port (string)'}, 'msenv': {'default': None, 'doc': 'sardana environment (datasource)'}, 'mssardanadevice': {'default': None, 'doc': 'sardana device name MANDATORY (string)'}, 'varname': {'default': None, 'doc': 'nested sardana environment variable name MANDATORY (string)'}}, 'mssar': {'__tangohost__': {'default': 'localhost', 'doc': 'tango host (string)'}, '__tangoport__': {'default': '10000', 'doc': 'tango port (string)'}, 'msenv': {'default': None, 'doc': 'sardana environment (datasource)'}, 'mssardanadevice': {'default': None, 'doc': 'macroserver sardana device name MANDATORY (string)'}, 'varname': {'default': None, 'doc': 'sardana environment variable name MANDATORY (string)'}}, 'parametercopymap': {'copymap': {'default': None, 'doc': 'yaml dictionary with {output: input} copy map (string)'}, 'parameter': {'default': 'copymap', 'doc': 'parameter name of copymap (string)'}, 'program': {'default': 'nxsfileinfo_parameters', 'doc': 'group name of NXparameters (string)'}}, 'pinhole': {'diameter': {'default': None, 'doc': 'pinhole diameter (datasource)'}, 'x': {'default': None, 'doc': 'horizontal position (datasource)'}, 'xname': {'default': 'x', 'doc': 'horizontal position name (string)'}, 'xsign': {'default': '', 'doc': "horizontal position sign, e.g. '-' (string)"}, 'y': {'default': None, 'doc': 'vertical position (datasource)'}, 'yname': {'default': 'y', 'doc': 'vertical position name (string)'}, 'z': {'default': None, 'doc': 'along the beam position (datasource)'}, 'zname': {'default': 'z', 'doc': 'along the beam position name (string)'}}, 'pointdet': {'data': {'default': None, 'doc': 'diode data (datasource)'}, 'detname': {'default': 'detector', 'doc': 'detector group name (string)'}}, 'qbpm': {'dependsony': {'default': '', 'doc': 'the depends_on y field value, e.g. distance (string)'}, 'dependstop': {'default': 'x', 'doc': 'the first transformation, e.g. distance (string)'}, 'distance': {'default': None, 'doc': 'distance for the sample in m, e.g. 0 (string)'}, 'distancename': {'default': 'distance', 'doc': 'distance name for the sample in m, e.g. 0 (string)'}, 'distanceoffset': {'default': None, 'doc': '3-vector distance offset in m, e.g. sample-source offset if the distance is taken from the source (string)'}, 'foil': {'default': None, 'doc': 'foil type, i.e. standard <cpname>_foil (datasource)'}, 'foilpos': {'default': None, 'doc': 'foil position MANDATORY (datasource)'}, 'foilposdict': {'default': '{"Ti": 43, "Ni": 23, "Out": 3}', 'doc': 'foil_type position json dictionary (string)'}, 'x': {'default': None, 'doc': 'horizontal position (datasource)'}, 'xname': {'default': 'x', 'doc': 'horizontal position name (string)'}, 'y': {'default': None, 'doc': 'vertical position (datasource)'}, 'yname': {'default': 'y', 'doc': 'vertical position name (string)'}}, 'sampledescription': {'sname': {'default': 'sample', 'doc': 'sample group name (string)'}}, 'sampledescriptiontext': {'description': {'default': '', 'doc': 'sample description or sampleId (string)'}, 'sname': {'default': 'sample', 'doc': 'sample group name (string)'}}, 'samplehkl': {'h': {'default': None, 'doc': 'h position in hkl space (datasource)'}, 'k': {'default': None, 'doc': 'k position in hkl space (datasource)'}, 'l': {'default': None, 'doc': 'l position in hkl space (datasource)'}, 'psi': {'default': None, 'doc': 'psi angle position of analyzer (datasource)'}, 'sname': {'default': 'sample', 'doc': 'sample group name (string)'}}, 'secop': {'host': {'default': None, 'doc': 'secop host name (string)'}, 'message': {'default': None, 'doc': 'secop command MANDATORY (string)'}, 'port': {'default': '5000', 'doc': 'secop port name (string)'}, 'timeout': {'default': '0.0001', 'doc': 'secop timeout (string)'}}, 'secoplinks': {'environments': {'default': 'temperature,magnetic_field', 'doc': 'secop environment link lists MANDATORY (string)'}, 'meanings': {'default': 'temperature,magnetic_field,electric_field,stress_field,pressure', 'doc': 'secop meanings link lists MANDATORY (string)'}, 'sampleenvname': {'default': 'sample_environment', 'doc': 'sample environment group name (string)'}, 'samplename': {'default': 'sample', 'doc': 'sample group name (string)'}}, 'singlesecop': {'host': {'default': None, 'doc': 'secop host name (string)'}, 'message': {'default': None, 'doc': 'secop command MANDATORY (string)'}, 'port': {'default': '5000', 'doc': 'secop port name (string)'}, 'timeout': {'default': '0.0001', 'doc': 'secop timeout (string)'}}, 'slit': {'bottom': {'default': None, 'doc': 'bottom blade position (datasource)'}, 'bottomclosed': {'default': None, 'doc': 'bottom blade closed position (datasource)'}, 'dependstop': {'default': None, 'doc': 'the first transformation, e.g. distance (string)'}, 'distance': {'default': None, 'doc': 'distance for the sample in m, e.g. 0 (string)'}, 'distancename': {'default': 'distance', 'doc': 'distance name for the sample in m, e.g. 0 (string)'}, 'distanceoffset': {'default': None, 'doc': '3-vector distance offset in m, e.g. sample-source offset if the distance is taken from the source (string)'}, 'left': {'default': None, 'doc': 'left blade position (datasource)'}, 'leftclosed': {'default': None, 'doc': 'left blade closed position (datasource)'}, 'right': {'default': None, 'doc': 'right blade position (datasource)'}, 'rightclosed': {'default': None, 'doc': 'right blade closed position (datasource)'}, 'top': {'default': None, 'doc': 'top blade position (datasource)'}, 'topclosed': {'default': None, 'doc': 'top blade closed position (datasource)'}, 'transformations': {'default': None, 'doc': "transformations group name i.e. 'transformations'. If it is not set it is not created (string)"}, 'xgap': {'default': None, 'doc': 'horizontal gap (datasource)'}, 'xoffdependson': {'default': 'y_offset', 'doc': 'the first transformation, e.g. distance (string)'}, 'xoffset': {'default': None, 'doc': 'horizontal offset (datasource)'}, 'xoffsetcalibration': {'default': None, 'doc': 'horizontal offset calibration (datasource)'}, 'xoffsetcalibrationname': {'default': 'x_offset_calibration', 'doc': 'horizontal offset calibration name (string)'}, 'xoffsetname': {'default': 'x_offset', 'doc': 'horizontal offset name (string)'}, 'ygap': {'default': None, 'doc': 'vertical gap (datasource)'}, 'yoffdependson': {'default': 'distance', 'doc': 'the first transformation, e.g. distance (string)'}, 'yoffset': {'default': None, 'doc': 'vertiacal offset (datasource)'}, 'yoffsetcalibration': {'default': None, 'doc': 'vertiacal offset calibration (datasource)'}, 'yoffsetcalibrationname': {'default': 'y_offset_calibration', 'doc': 'vertiacal offset calibration name (string)'}, 'yoffsetname': {'default': 'y_offset', 'doc': 'vertiacal offset name (string)'}}, 'source': {'beamcurrent': {'default': None, 'doc': 'ring beam current (datasource)'}, 'bunchmode': {'default': 'Multi Bunch', 'doc': 'bunch mode (string)'}, 'numberofbunches': {'default': None, 'doc': 'number of source bunches (datasource)'}, 'sourceenergy': {'default': None, 'doc': 'ring beam energy (datasource)'}, 'srcname': {'default': 'source', 'doc': 'source group name (string)'}}, 'starttime': {}, 'tango': {'attribute': {'default': 'Position', 'doc': 'tango device attribute (string)'}, 'device': {'default': None, 'doc': 'tango device MANDATORY (string)'}}, 'undulator': {'dependstop': {'default': None, 'doc': 'the first transformation, e.g. distance (string)'}, 'distance': {'default': None, 'doc': 'distance from the sample in m, e.g. 0 (string)'}, 'distancename': {'default': 'distance', 'doc': 'distance name from the sample in m, e.g. 0 (string)'}, 'distanceoffset': {'default': None, 'doc': '3-vector distance offset in m, e.g. sample-source offset if the distance is taken from the source (string)'}, 'energy': {'default': None, 'doc': 'undulator energy (datasource)'}, 'gap': {'default': None, 'doc': 'separation between opposing pairs of magnetic pole (datasource)'}, 'gapunits': {'default': 'mm', 'doc': 'gap units (string)'}, 'harmonic': {'default': None, 'doc': 'undulator harmonic (datasource)'}, 'length': {'default': '2', 'doc': 'length of insertion device in meters (string)'}, 'shift': {'default': None, 'doc': 'undulator shift (datasource)'}, 'shiftunits': {'default': 'mm', 'doc': 'shift units (string)'}, 'speed': {'default': None, 'doc': 'undulator speed (datasource)'}, 'speedunits': {'default': '', 'doc': 'speed units (string)'}, 'taper': {'default': None, 'doc': 'gap difference between upstream and downstream ends of the insertion device (datasource)'}, 'taperunits': {'default': 'mm', 'doc': 'gap units (string)'}, 'transformations': {'default': None, 'doc': "transformations group name i.e. 'transformations'. If it is not set it is not created (string)"}, 'type': {'default': 'undulator', 'doc': 'undulator or wiggler (string)'}, 'uname': {'default': 'insertion_device', 'doc': 'insertion_device group name (string)'}}}

(dict <str , dict <str , str > >) standard component template variables and its [default value, doc string]

nxstools.nxsdevicetools.storeComponent(name, xml, server, mandatory=False)[source]

stores components in Configuration Server

Parameters
  • name (str) -- component name

  • xml (str) -- component xml string

  • server (str) -- configuration server

  • mandatory (bool) -- set component as mandatory

nxstools.nxsdevicetools.storeDataSource(name, xml, server)[source]

stores datasources in Configuration Server

Parameters
  • name (str) -- datasource name

  • xml (str) -- datasource xml string

  • server (str) -- configuration server

nxstools.nxsdevicetools.twoDModules = ['pilatus100k', 'pilatus300k', 'pilatus1m', 'pilatus2m', 'pilatus6m', 'pco4000', 'perkinelmerdetector', 'lambda', 'pedetector', 'perkinelmer', 'pco', 'pcoedge', 'marccd', 'perkinelmer', 'lcxcamera', 'limaccd', 'eigerpsi', 'eigerdectris']

(list <str>) modules of 2d detectors

nxstools.nxsdevicetools.xmlPackageHandler = <nxstools.nxsdevicetools.PackageHandler object>

(PackageHandler) xml template package handler

nxstools.nxsdevicetools.zeroDModules = ['tip830']

(list <str>) modules of 0D detectors

nxstools.filenamegenerator module

Filename generator

class nxstools.filenamegenerator.FilenameGenerator(fname_template, start_index=0, stop_index=None)[source]

Bases: object

Generate image file names

(c) Copyright 2015 Eugen Wintersberger <eugen.wintersberger@gmail.com> (c) Copyright 2015 DESY This file is part of nx2img.

nx2img is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.

nx2img is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with nx2img. If not, see <http://www.gnu.org/licenses/>.

Generator class creating image file names.

Parameters
  • fname_template (str) -- file name template

  • start_index (int) -- file start index

  • stop_index (int) -- file stop index

file_index

(int) file start index

file_template

(str) file name template

static from_slice(file_template)[source]

Static factory method to create a filename_generator instance from a sliced user input

Parameters

file_template (str) -- file template

Returns

filename generator object

Return type

FilenameGenerator

stop_index

(int) file stop index

nxstools.release module

NXS tools release version

Module contents

NXS tools

xml templates

nxstools.xmltemplates.moduleMultiAttributes = {'cobold': ['BinSize', 'ExposureTime'], 'dalsa': ['FileDir', 'FilePostfix', 'FilePrefix', 'FileSaving', 'FileStartNum', 'TriggerMode', 'Width', 'Height', 'ExtendedExposure', 'BinComment', 'FramesProcessed', 'Image16', 'Image8', 'ImageRaw', 'FramesReceived', 'FrameRate', 'FramesPerNXFile', 'NXFileCompression', 'TurboMode', 'ImageEnc', 'ViewingMode', 'ThrashedBuffers', 'FramesToAcquire', 'AcquisitionFrameCount', 'AcquisitionMode', 'AcquisitionFrameMode', 'LinearityEqualizer', 'NrExposedFrames', 'NrOffsetFrames', 'Offset', 'PixelFormat', 'ReadOutMode', 'Standby', 'SumScheme'], 'dalsavds': ['FileDir', 'FilePostfix', 'FilePrefix', 'FileSaving', 'FileStartNum', 'TriggerMode', 'Width', 'Height', 'ExtendedExposure', 'BinComment', 'FramesProcessed', 'Image16', 'Image8', 'ImageRaw', 'FramesReceived', 'FrameRate', 'FramesPerNXFile', 'NXFileCompression', 'TurboMode', 'ImageEnc', 'ViewingMode', 'ThrashedBuffers', 'FramesToAcquire', 'AcquisitionFrameCount', 'AcquisitionMode', 'AcquisitionFrameMode', 'LinearityEqualizer', 'NrExposedFrames', 'NrOffsetFrames', 'Offset', 'PixelFormat', 'ReadOutMode', 'Standby', 'SumScheme'], 'eigerdectris': ['TriggerMode', 'NbTriggers', 'Description', 'NbImages', 'BitDepth', 'ReadoutTime', 'CountTime', 'EnergyThreshold', 'FrameTime', 'RateCorrectionEnabled', 'FlatFieldEnabled', 'Temperature', 'AutoSummationEnabled', 'Humidity', 'PhotonEnergy', 'Wavelength'], 'lambda': ['TriggerMode', 'ShutterTime', 'DelayTime', 'FrameNumbers', 'ThreadNo', 'EnergyThreshold', 'OperatingMode', 'ConfigFilePath', 'SaveAllImages', 'FilePrefix', 'FileStartNum', 'FilePreExt', 'FilePostfix', 'SaveFilePath', 'SaveFileName', 'LatestImageNumber', 'LiveMode', 'TotalLossFrames', 'CompressorShuffle', 'CompressionRate', 'CompressionEnabled', 'Layout', 'ShutterTimeMax', 'ShutterTimeMin', 'Width', 'Height', 'Depth', 'LiveFrameNo', 'DistortionCorrection', 'LiveLastImageData', 'FramesPerFile', 'OpMode', 'Translations'], 'lambda2m': ['TriggerMode', 'ShutterTime', 'DelayTime', 'FrameNumbers', 'ThreadNo', 'EnergyThreshold', 'OperatingMode', 'ConfigFilePath', 'SaveAllImages', 'FilePrefix', 'FileStartNum', 'FilePreExt', 'FilePostfix', 'SaveFilePath', 'SaveFileName', 'LatestImageNumber', 'LiveMode', 'TotalLossFrames', 'CompressorShuffle', 'CompressionRate', 'CompressionEnabled', 'Layout', 'ShutterTimeMax', 'ShutterTimeMin', 'Width', 'Height', 'Depth', 'LiveFrameNo', 'DistortionCorrection', 'LiveLastImageData', 'OpMode', 'Translations'], 'lambdavds': ['TriggerMode', 'ShutterTime', 'DelayTime', 'FrameNumbers', 'ThreadNo', 'EnergyThreshold', 'OperatingMode', 'ConfigFilePath', 'SaveAllImages', 'FilePrefix', 'FileStartNum', 'FilePreExt', 'FilePostfix', 'SaveFilePath', 'SaveFileName', 'LatestImageNumber', 'LiveMode', 'TotalLossFrames', 'CompressorShuffle', 'CompressionRate', 'CompressionEnabled', 'Layout', 'ShutterTimeMax', 'ShutterTimeMin', 'Width', 'Height', 'Depth', 'LiveFrameNo', 'DistortionCorrection', 'LiveLastImageData', 'FramesPerFile', 'OpMode', 'Translations'], 'lambdavdsnm': ['TriggerMode', 'ShutterTime', 'DelayTime', 'FrameNumbers', 'ThreadNo', 'EnergyThreshold', 'OperatingMode', 'ConfigFilePath', 'SaveAllImages', 'FilePrefix', 'FileStartNum', 'FilePreExt', 'FilePostfix', 'SaveFilePath', 'SaveFileName', 'LatestImageNumber', 'LiveMode', 'TotalLossFrames', 'CompressorShuffle', 'CompressionRate', 'CompressionEnabled', 'Layout', 'ShutterTimeMax', 'ShutterTimeMin', 'Width', 'Height', 'Depth', 'LiveFrameNo', 'DistortionCorrection', 'LiveLastImageData', 'FramesPerFile', 'OpMode', 'Translations'], 'limaccd': ['camera_type', 'camera_pixelsize', 'camera_model', 'acq_mode', 'acq_nb_frames', 'acq_trigger_mode', 'last_image_saved', 'latency_time', 'acc_max_expo_time', 'acc_expo_time', 'acc_time_mode', 'acc_dead_time', 'acc_live_time', 'saving_mode', 'saving_directory', 'saving_prefix', 'saving_suffix', 'saving_next_number', 'saving_format', 'saving_frame_per_file', 'image_type', 'image_width', 'image_height', 'image_sizes', 'image_roi', 'image_bin', 'image_flip', 'image_rotation', 'shutter_mode', 'shutter_open_time'], 'limaccds': ['camera_type', 'camera_pixelsize', 'camera_model', 'acq_mode', 'acq_nb_frames', 'acq_trigger_mode', 'last_image_saved', 'latency_time', 'acc_max_expo_time', 'acc_expo_time', 'acc_time_mode', 'acc_dead_time', 'acc_live_time', 'saving_mode', 'saving_directory', 'saving_prefix', 'saving_suffix', 'saving_next_number', 'saving_format', 'saving_frame_per_file', 'image_type', 'image_width', 'image_height', 'image_sizes', 'image_roi', 'image_bin', 'image_flip', 'image_rotation', 'shutter_mode', 'shutter_open_time'], 'maiadimension': ['Name', 'PositionSource', 'PixelPitch', 'PixelOrigin', 'PixelHysteresis', 'PositionUnit', 'PixelCoordExtent'], 'maiaflux': ['FluxCoeff', 'FluxName', 'FluxUnit', 'FluxSource'], 'maiainterlock': ['BiasPeltierInterlock', 'BiasPeltierInterlockUptime', 'Pressure'], 'maialogger': ['RunNumber'], 'maiaprocessing': ['GaintrimEnable', 'LineariseEnable', 'PhotonEnable', 'PileupRejectEnable', 'PixelEnable', 'ThrottleEnable'], 'maiasensor': ['BiasVoltage', 'LeakageCurrent', 'PeltierCurrent', 'WaterTemperature', 'DetectorTemperature', 'MosfetTemperature', 'Identity'], 'marccd': ['FrameShift', 'SavingDirectory', 'SavingPostfix', 'SavingPrefix'], 'mca_xia': ['ICR', 'OCR'], 'mca_xia@pool': ['CountsRoI', 'RoIEnd', 'RoIStart'], 'mythen': ['Counts1', 'Counts2', 'CountsMax', 'CountsTotal', 'ExposureTime', 'FileDir', 'FileIndex', 'FilePrefix', 'Data', 'RoI1', 'RoI2'], 'mythen2': ['Counts1', 'Counts2', 'CountsMax', 'CountsTotal', 'ExposureTime', 'FileDir', 'FileIndex', 'FilePrefix', 'Data', 'Energy', 'NbFrames', 'RoI1End', 'RoI2End', 'RoI1Start', 'RoI2Start', 'Threshold'], 'pco': ['DelayTime', 'ExposureTime', 'NbFrames', 'TriggerMode', 'FileDir', 'FilePostfix', 'FilePrefix', 'FileStartNum', 'Binning_x', 'Binning_y', 'ROI_x_min', 'ROI_x_max', 'ROI_y_min', 'ROI_y_max', 'Pixelrate', 'ADCs', 'CoolingTemp', 'CoolingTempSet', 'ImageTimeStamp', 'RecorderMode'], 'pco4000': ['DelayTime', 'ExposureTime', 'NbFrames', 'TriggerMode', 'FileDir', 'FilePostfix', 'FilePrefix', 'FileStartNum', 'Binning_x', 'Binning_y', 'ROI_x_min', 'ROI_x_max', 'ROI_y_min', 'ROI_y_max', 'Pixelrate', 'ADCs', 'CoolingTemp', 'CoolingTempSet', 'ImageTimeStamp', 'RecorderMode'], 'pcoedge': ['DelayTime', 'ExposureTime', 'NbFrames', 'TriggerMode', 'FileDir', 'FilePostfix', 'FilePrefix', 'FileStartNum', 'Binning_x', 'Binning_y', 'ROI_x_min', 'ROI_x_max', 'ROI_y_min', 'ROI_y_max', 'Pixelrate', 'ADCs', 'CoolingTemp', 'CoolingTempSet', 'ImageTimeStamp', 'RecorderMode'], 'pedetector': ['BinningMode', 'FileIndex', 'ExposureTime', 'SkippedAtStart', 'SummedSaveImages', 'SkippedBetweenSaved', 'FilesAfterTrigger', 'FilesBeforeTrigger', 'SummedDarkImages', 'OutputDirectory', 'FilePattern', 'FileName', 'LogFile', 'UserComment1', 'CameraGain', 'UserComment2', 'UserComment3', 'UserComment4', 'SaveRawImages', 'SaveDarkImages', 'PerformIntegration', 'SaveIntegratedData', 'SaveSubtracted', 'PerformDarkSubtraction'], 'perkinelmer': ['BinningMode', 'FileIndex', 'ExposureTime', 'SkippedAtStart', 'SummedSaveImages', 'SkippedBetweenSaved', 'FilesAfterTrigger', 'FilesBeforeTrigger', 'SummedDarkImages', 'OutputDirectory', 'FilePattern', 'FileName', 'LogFile', 'UserComment1', 'CameraGain', 'UserComment2', 'UserComment3', 'UserComment4', 'SaveRawImages', 'SaveDarkImages', 'PerformIntegration', 'SaveIntegratedData', 'SaveSubtracted', 'PerformDarkSubtraction'], 'perkinelmerdetector': ['BinningMode', 'FileIndex', 'ExposureTime', 'SkippedAtStart', 'SummedSaveImages', 'SkippedBetweenSaved', 'FilesAfterTrigger', 'FilesBeforeTrigger', 'SummedDarkImages', 'OutputDirectory', 'FilePattern', 'FileName', 'LogFile', 'UserComment1', 'CameraGain', 'UserComment2', 'UserComment3', 'UserComment4', 'SaveRawImages', 'SaveDarkImages', 'PerformIntegration', 'SaveIntegratedData', 'SaveSubtracted', 'PerformDarkSubtraction'], 'pilatus': ['DelayTime', 'ExposurePeriod', 'ExposureTime', 'FileDir', 'FilePostfix', 'FilePrefix', 'FileStartNum', 'LastImageTaken', 'NbExposures', 'NbFrames', 'MXparameters'], 'pilatus100k': ['DelayTime', 'ExposurePeriod', 'ExposureTime', 'FileDir', 'FilePostfix', 'FilePrefix', 'FileStartNum', 'LastImageTaken', 'NbExposures', 'NbFrames', 'MXparameters'], 'pilatus1m': ['DelayTime', 'ExposurePeriod', 'ExposureTime', 'FileDir', 'FilePostfix', 'FilePrefix', 'FileStartNum', 'LastImageTaken', 'NbExposures', 'NbFrames', 'MXparameters'], 'pilatus2m': ['DelayTime', 'ExposurePeriod', 'ExposureTime', 'FileDir', 'FilePostfix', 'FilePrefix', 'FileStartNum', 'LastImageTaken', 'NbExposures', 'NbFrames', 'MXparameters'], 'pilatus300k': ['DelayTime', 'ExposurePeriod', 'ExposureTime', 'FileDir', 'FilePostfix', 'FilePrefix', 'FileStartNum', 'LastImageTaken', 'NbExposures', 'NbFrames', 'MXparameters'], 'pilatus6m': ['DelayTime', 'ExposurePeriod', 'ExposureTime', 'FileDir', 'FilePostfix', 'FilePrefix', 'FileStartNum', 'LastImageTaken', 'NbExposures', 'NbFrames', 'MXparameters'], 'tangovimba': ['Width', 'WidthMax', 'TriggerSource', 'PixelFormat', 'OffsetY', 'OffsetX', 'HeightMax', 'Height', 'GainRaw', 'ExposureTimeAbs', 'AcquisitionFrameRateAbs', 'AcquisitionFrameRateLimit', 'StreamBytesPerSecond', 'BinComment', 'FileDir', 'FilePostfix', 'FilePrefix', 'FileSaving', 'FileStartNum', 'FramesProcessed', 'Image16', 'Image8', 'ImageRaw', 'MaxLoad', 'ReadMode', 'TuneMode', 'ViewingMode']}

(dict <str , list <str> >) important attributes of modules

nxstools.xmltemplates.moduleTemplateFiles = {'cobold': ['cobold.xml'], 'dalsa': ['dalsa.xml', 'dalsa_nxdata.ds.xml', 'dalsa_external_data.ds.xml'], 'dalsavds': ['dalsavds.xml', 'dalsavds_nxdata.ds.xml', 'dalsavds_triggermode_cb.ds.xml', 'dalsavds_filestartnum_cb.ds.xml', 'dalsavds_nrexposedframes_cb.ds.xml'], 'eigerdectris': ['eigerdectris.xml', 'eigerdectris_stepindex.ds.xml', 'eigerdectris_description_cb.ds.xml', 'eigerdectris_triggermode_cb.ds.xml'], 'lambda': ['lambda.xml', 'lambda_nxdata.ds.xml', 'lambda_external_data.ds.xml'], 'lambda2m': ['lambda2m.xml', 'lambda2m_m1_nxdata.ds.xml', 'lambda2m_m2_nxdata.ds.xml', 'lambda2m_m3_nxdata.ds.xml', 'lambda2m_m1_external_data.ds.xml', 'lambda2m_m2_external_data.ds.xml', 'lambda2m_m3_external_data.ds.xml'], 'lambdavds': ['lambdavds.xml', 'lambdavds_nxdata.ds.xml', 'lambdavds_description.ds.xml', 'lambdavds_triggermode_cb.ds.xml', 'lambdavds_framenumbers_cb.ds.xml', 'lambdavds_savefilename_cb.ds.xml'], 'lambdavdsnm': ['lambdavdsnm.xml', 'lambdavdsnm_triggermode_cb.ds.xml', 'lambdavdsnm_nxdata.ds.xml'], 'limaccd': ['limaccd.xml', 'limaccd_postrun.ds.xml', 'limaccd_xpixelsize.ds.xml', 'limaccd_ypixelsize.ds.xml', 'limaccd_description.ds.xml', 'limaccd_filestartnum_cb.ds.xml'], 'limaccds': ['limaccd.xml', 'limaccd_postrun.ds.xml', 'limaccd_xpixelsize.ds.xml', 'limaccd_ypixelsize.ds.xml', 'limaccd_description.ds.xml', 'limaccd_filestartnum_cb.ds.xml'], 'marccd': ['marccd.xml', 'marccd_postrun.ds.xml'], 'mca_xia': ['mcaxia.xml'], 'mythen': ['mythen.xml', 'mythen_postrun.ds.xml', 'mythen_filestartnumber.ds.xml'], 'mythen2': ['mythen2.xml'], 'pco': ['pco.xml', 'pco_postrun.ds.xml', 'pco_description.ds.xml', 'pco_filestartnum_cb.ds.xml'], 'pco4000': ['pco.xml', 'pco_postrun.ds.xml', 'pco_description.ds.xml', 'pco_filestartnum_cb.ds.xml'], 'pcoedge': ['pco.xml', 'pco_postrun.ds.xml', 'pco_description.ds.xml', 'pco_filestartnum_cb.ds.xml'], 'pedetector': ['perkinelmerdetector.xml', 'perkinelmerdetector_postrun.ds.xml', 'perkinelmerdetector_description.ds.xml', 'perkinelmerdetector_fileindex_cb.ds.xml'], 'perkinelmer': ['perkinelmerdetector.xml', 'perkinelmerdetector_postrun.ds.xml', 'perkinelmerdetector_description.ds.xml', 'perkinelmerdetector_fileindex_cb.ds.xml'], 'perkinelmerdetector': ['perkinelmerdetector.xml', 'perkinelmerdetector_postrun.ds.xml', 'perkinelmerdetector_description.ds.xml', 'perkinelmerdetector_fileindex_cb.ds.xml'], 'pilatus': ['pilatus.xml', 'pilatus_postrun.ds.xml', 'pilatus_description.ds.xml', 'pilatus_mxparameters_cb.ds.xml', 'pilatus_filestartnum_cb.ds.xml'], 'pilatus100k': ['pilatus.xml', 'pilatus_postrun.ds.xml', 'pilatus100k_description.ds.xml', 'pilatus_mxparameters_cb.ds.xml', 'pilatus_filestartnum_cb.ds.xml'], 'pilatus1m': ['pilatus.xml', 'pilatus_postrun.ds.xml', 'pilatus1m_description.ds.xml', 'pilatus_mxparameters_cb.ds.xml', 'pilatus_filestartnum_cb.ds.xml'], 'pilatus2m': ['pilatus.xml', 'pilatus_postrun.ds.xml', 'pilatus6m_description.ds.xml', 'pilatus_mxparameters_cb.ds.xml', 'pilatus_filestartnum_cb.ds.xml'], 'pilatus300k': ['pilatus.xml', 'pilatus_postrun.ds.xml', 'pilatus300k_description.ds.xml', 'pilatus_mxparameters_cb.ds.xml', 'pilatus_filestartnum_cb.ds.xml'], 'pilatus6m': ['pilatus.xml', 'pilatus_postrun.ds.xml', 'pilatus_mxparameters_cb.ds.xml', 'pilatus6m_description.ds.xml', 'pilatus_filestartnum_cb.ds.xml'], 'tangovimba': ['tangovimba.xml', 'tangovimba_nxdata.ds.xml', 'tangovimba_external_data.ds.xml']}

(dict <str , list <str> >) xml template files of modules

nxstools.xmltemplates.standardComponentTemplateFiles = {'absorber': ['absorber_foil.ds.xml', 'absorber_thickness.ds.xml', 'absorber.xml'], 'beamstop': ['beamstop.xml'], 'beamtimefname': ['beamtimefname.xml', 'beamtimefname.ds.xml', 'start_time.ds.xml'], 'beamtimeid': ['beamtimeid.xml', 'beamtimeid.ds.xml', 'start_time.ds.xml'], 'chcut': ['chcut.xml', 'chcut_unitcalibration.ds.xml', 'chcut_crystal.ds.xml'], 'coboldhisto': ['coboldhisto.xml', 'coboldhisto_timeofflight.ds.xml'], 'collect2': ['collect2.xml'], 'collect3': ['collect3.xml'], 'collect4': ['collect4.xml'], 'collect5': ['collect5.xml'], 'collect6': ['collect6.xml'], 'common2': ['common2_common.ds.xml'], 'common3': ['common3_common.ds.xml'], 'dataaxessignal': ['dataaxessignal.xml', 'defaultsignal.ds.xml', 'defaultaxes.ds.xml', 'signal_name.ds.xml', 'signalname.ds.xml', 'sardanaenvironment.ds.xml'], 'datasignal': ['datasignal.xml', 'defaultsignal.ds.xml', 'signal_name.ds.xml', 'signalname.ds.xml', 'signal_axes.ds.xml', 'sardanaenvironment.ds.xml'], 'dcm': ['dcm.xml', 'dcm_reflection.ds.xml', 'dcm_unitcalibration.ds.xml', 'dcm_crystal.ds.xml'], 'default': ['default.xml', 'defaultsample.xml', 'defaultinstrument.xml', 'sample_name.ds.xml', 'chemical_formula.ds.xml', 'beamtime_id.ds.xml', 'beamtime_filename.ds.xml', 'start_time.ds.xml', 'end_time.ds.xml', 'nexdatas_version.ds.xml', 'nexdatas_configuration.ds.xml', 'title.ds.xml'], 'defaultinstrument': ['defaultinstrument.xml', 'beamtime_id.ds.xml', 'beamtime_filename.ds.xml', 'start_time.ds.xml', 'end_time.ds.xml', 'nexdatas_version.ds.xml', 'nexdatas_configuration.ds.xml', 'title.ds.xml'], 'defaultsample': ['defaultsample.xml', 'sample_name.ds.xml', 'chemical_formula.ds.xml'], 'description': ['description.xml', 'experiment_description.ds.xml'], 'descriptiontext': ['descriptiontext.xml'], 'detectorlive': ['detectorlive.xml'], 'empty': ['empty.xml'], 'groupsecop': ['groupsecop.ds.xml', 'groupsecop_time.ds.xml', 'client_start_time.ds.xml', 'sample_env_links.ds.xml', 'sample_log_links.ds.xml'], 'keithley': ['keithley.xml'], 'maia': ['maia.xml', 'empty.xml'], 'maiadimension': ['maiadimension.xml'], 'maiaflux': ['maiaflux.xml'], 'msnsar': ['msnsar_env.ds.xml', 'sardanaenvironment.ds.xml'], 'mssar': ['mssar_env.ds.xml', 'sardanaenvironment.ds.xml'], 'parametercopymap': ['parametercopymap.xml'], 'pinhole': ['pinhole.xml'], 'pointdet': ['pointdet.xml'], 'qbpm': ['qbpm_foil.ds.xml', 'qbpm.xml'], 'sampledescription': ['sampledescription.xml', 'sample_description.ds.xml'], 'sampledescriptiontext': ['sampledescriptiontext.xml'], 'samplehkl': ['samplehkl.xml'], 'secop': ['secop.ds.xml', 'secop_time.ds.xml', 'client_start_time.ds.xml', 'sample_env_links.ds.xml', 'sample_log_links.ds.xml'], 'secoplinks': ['sample_env_links.ds.xml', 'sample_log_links.ds.xml', 'sample_nxdata.ds.xml', 'sampleenv_nxdata.ds.xml'], 'singlesecop': ['singlesecop.ds.xml', 'singlesecop_time.ds.xml', 'client_start_time.ds.xml', 'sample_env_links.ds.xml', 'sample_log_links.ds.xml'], 'slit': ['slit.xml'], 'source': ['source.xml'], 'starttime': ['starttime.xml', 'starttime.ds.xml', 'start_timestamp.ds.xml', 'client_start_time.ds.xml'], 'tango': ['tango.ds.xml'], 'undulator': ['undulator.xml']}

(dict <str , list <str> >) xml template files of modules

nxstools.xmltemplates.standardComponentVariables = {'absorber': {'attenfactor': {'default': None, 'doc': 'attenuation factor (datasource)'}, 'dependstop': {'default': None, 'doc': 'the first transformation, e.g. distance (string)'}, 'distance': {'default': None, 'doc': 'distance for the sample in m, e.g. 0 (string)'}, 'distancename': {'default': 'distance', 'doc': 'distance name for the sample in m, e.g. 0 (string)'}, 'distanceoffset': {'default': None, 'doc': '3-vector distance offset in m, e.g. sample-source offset if the distance is taken from the source (string)'}, 'foil': {'default': None, 'doc': 'foil type, i.e. standard <cpname>_foil (datasource)'}, 'foillist': {'default': '["Ag", "Ag", "Ag", "Ag", "", "Al", "Al", "Al", "Al"]', 'doc': 'foil_type position json dictionary (string)'}, 'position': {'default': None, 'doc': 'which sliders are in [bitarray] MANDATORY (datasource)'}, 'thickness': {'default': None, 'doc': 'foil thickness, i.e. standard <cpname>_thickness (datasource)'}, 'thicknesslist': {'default': '[0.5, 0.05, 0.025, 0.0125, 0, 0.1, 0.3, 0.5, 1.0]', 'doc': 'foil_type position json dictionary (string)'}, 'transformations': {'default': None, 'doc': "transformations group name i.e. 'transformations'. If it is not set it is not created (string)"}, 'y': {'default': None, 'doc': 'vertical position (datasource)'}, 'yname': {'default': 'y', 'doc': 'vertical position name (string)'}}, 'beamstop': {'description': {'default': 'circular', 'doc': ' circular or rectangular (string)'}, 'x': {'default': None, 'doc': 'horizontal position (datasource)'}, 'xname': {'default': 'x', 'doc': 'horizontal position name (string)'}, 'xsign': {'default': '', 'doc': "horizontal position sign, e.g. '-' (string)"}, 'y': {'default': None, 'doc': 'vertical position (datasource)'}, 'yname': {'default': 'y', 'doc': 'vertical position name (string)'}, 'z': {'default': None, 'doc': 'vertical position (datasource)'}, 'zname': {'default': 'z', 'doc': 'along the beam position name (string)'}}, 'beamtimefname': {'commissiondir': {'default': '/gpfs/commissioning', 'doc': 'commission file directory (string)'}, 'commissionpostfix': {'default': '.json', 'doc': 'commission file postfix (string)'}, 'commissionprefix': {'default': 'commissioning-metadata-', 'doc': 'commission file prefix (string)'}, 'currentdir': {'default': '/gpfs/current', 'doc': 'beamtime file directory (string)'}, 'currentpostfix': {'default': '.json', 'doc': 'beamtime file postfix (string)'}, 'currentprefix': {'default': 'beamtime-metadata-', 'doc': 'beamtime file prefix (string)'}, 'localdir': {'default': '/gpfs/local', 'doc': 'local file directory (string)'}, 'shortname': {'default': 'P09', 'doc': 'beamline short name (string)'}}, 'beamtimeid': {'commissiondir': {'default': '/gpfs/commissioning', 'doc': 'commission file directory (string)'}, 'commissionpostfix': {'default': '.json', 'doc': 'commission file postfix (string)'}, 'commissionprefix': {'default': 'commissioning-metadata-', 'doc': 'commission file prefix (string)'}, 'currentdir': {'default': '/gpfs/current', 'doc': 'beamtime file directory (string)'}, 'currentpostfix': {'default': '.json', 'doc': 'beamtime file postfix (string)'}, 'currentprefix': {'default': 'beamtime-metadata-', 'doc': 'beamtime file prefix (string)'}, 'localdir': {'default': '/gpfs/local', 'doc': 'local file directory (string)'}, 'shortname': {'default': 'P09', 'doc': 'beamline short name (string)'}}, 'chcut': {'braggangle': {'default': None, 'doc': 'bragg angle (datasource)'}, 'bragganglename': {'default': 'bragg', 'doc': 'bragg angle name (string)'}, 'chcutdevice': {'default': None, 'doc': 'FMBOxfDCMEnergy tango device name (string)'}, 'crystal': {'default': None, 'doc': ' type of crystal i.e. 0->Si111,1->Si311,2->Si111 ChannelCut (datasource)'}, 'energy': {'default': None, 'doc': 'synchronized monochromator energy (datasource)'}, 'energyfmb': {'default': None, 'doc': 'monochromator energy (datasource)'}, 'jack1': {'default': None, 'doc': 'first vertical jack of table (datasource)'}, 'jack1name': {'default': 'jack1', 'doc': 'first vertical jack name of table (string)'}, 'jack2': {'default': None, 'doc': 'second vertical jack of table (datasource)'}, 'jack2name': {'default': 'jack2', 'doc': 'second vertical jack name of table (string)'}, 'jack3': {'default': None, 'doc': 'third vertical jack of table (datasource)'}, 'jack3name': {'default': 'jack3', 'doc': 'third vertical jack name of table (string)'}, 'lat': {'default': None, 'doc': 'horizontal lattice translation of the first cristal (datasource)'}, 'latname': {'default': 'lat', 'doc': 'horizontal lattice translation name of the first cristal (string)'}, 'oxfordhorizontal': {'default': None, 'doc': ' horizontal translation (datasource)'}, 'para': {'default': None, 'doc': 'distance between the crystals (string)'}, 'paraname': {'default': 'para', 'doc': 'beam parallel translation name of the second cristal (string)'}, 'reflection': {'default': None, 'doc': 'reflection from string (datasource)'}, 'table': {'default': None, 'doc': 'vertical position of table (datasource)'}, 'tablename': {'default': 'table', 'doc': 'vertical position name of table (string)'}, 'theta': {'default': None, 'doc': 'theta angle (datasource)'}, 'thetaname': {'default': 'theta', 'doc': 'theta angle name (string)'}, 'unitcalibration': {'default': None, 'doc': ' unit calibration from dcmmotor (datasource)'}, 'usage': {'default': 'Bragg', 'doc': 'the crystall usage, e.g. Laue (string)'}, 'yaw': {'default': None, 'doc': 'phi rotation of the first cristal (datasource)'}, 'yawname': {'default': 'phi', 'doc': 'phi rotation name of the first cristal (string)'}}, 'coboldhisto': {'binsize': {'default': None, 'doc': 'bin size of histogram data (datasource)'}, 'exposuretime': {'default': None, 'doc': 'exposure time for histogram data (datasource)'}, 'histogram': {'default': None, 'doc': 'histogram data (datasource)'}}, 'collect2': {'first': {'default': None, 'doc': 'name of the first component to collect MANDATORY (datasource)'}, 'second': {'default': None, 'doc': 'name of the second component to collect MANDATORY (datasource)'}}, 'collect3': {'first': {'default': None, 'doc': 'name of the first component to collect MANDATORY (datasource)'}, 'second': {'default': None, 'doc': 'name of the second component to collect MANDATORY (datasource)'}, 'third': {'default': None, 'doc': 'name of the third component to collect MANDATORY (datasource)'}}, 'collect4': {'first': {'default': None, 'doc': 'name of the first component to collect MANDATORY (datasource)'}, 'fourth': {'default': None, 'doc': 'name of the fourth component to collect MANDATORY (datasource)'}, 'second': {'default': None, 'doc': 'name of the second component to collect MANDATORY (datasource)'}, 'third': {'default': None, 'doc': 'name of the third component to collect MANDATORY (datasource)'}}, 'collect5': {'fifth': {'default': None, 'doc': 'name of the fifth component to collect MANDATORY (datasource)'}, 'first': {'default': None, 'doc': 'name of the first component to collect MANDATORY (datasource)'}, 'fourth': {'default': None, 'doc': 'name of the fourth component to collect MANDATORY (datasource)'}, 'second': {'default': None, 'doc': 'name of the second component to collect MANDATORY (datasource)'}, 'third': {'default': None, 'doc': 'name of the third component to collect MANDATORY (datasource)'}}, 'collect6': {'fifth': {'default': None, 'doc': 'name of the fifth component to collect MANDATORY (datasource)'}, 'first': {'default': None, 'doc': 'name of the first component to collect MANDATORY (datasource)'}, 'fourth': {'default': None, 'doc': 'name of the fourth component to collect MANDATORY (datasource)'}, 'second': {'default': None, 'doc': 'name of the second component to collect MANDATORY (datasource)'}, 'sixth': {'default': None, 'doc': 'name of the sixth component to collect MANDATORY (datasource)'}, 'third': {'default': None, 'doc': 'name of the third component to collect MANDATORY (datasource)'}}, 'common2': {'dds': {'default': None, 'doc': 'default read datasource name MANDATORY (datasource)'}, 'ods': {'default': None, 'doc': 'optional detasource name MANDATORY (datasource)'}}, 'common3': {'dds': {'default': None, 'doc': 'default read datasource name MANDATORY (datasource)'}, 'ods1': {'default': None, 'doc': 'fist optional detasource name MANDATORY (datasource)'}, 'ods2': {'default': None, 'doc': 'second optional detasource name MANDATORY (datasource)'}}, 'dataaxessignal': {'__tangohost__': {'default': 'localhost', 'doc': 'tango host (string)'}, '__tangoport__': {'default': '10000', 'doc': 'tango port (string)'}, 'axes': {'default': 'defaultaxes', 'doc': 'list of data axes field names (datasource)'}, 'defaultattrs': {'default': 'False', 'doc': 'add default attributes (string)'}, 'msenv': {'default': None, 'doc': 'sardana environment (datasource)'}, 'mssardanadevice': {'default': None, 'doc': 'macroserver sardana device name MANDATORY (string)'}, 'nchannelstoskip': {'default': '0', 'doc': 'number of mg channels to skip (string)'}, 'sardanasignal': {'default': 'SignalCounter', 'doc': 'signal sardana variable name (string)'}, 'signal': {'default': 'defaultsignal', 'doc': 'data signal field name (datasource)'}}, 'datasignal': {'__tangohost__': {'default': 'localhost', 'doc': 'tango host (string)'}, '__tangoport__': {'default': '10000', 'doc': 'tango port (string)'}, 'axes': {'default': None, 'doc': 'data axes field name(s) (datasource)'}, 'msenv': {'default': None, 'doc': 'sardana environment (datasource)'}, 'mssardanadevice': {'default': None, 'doc': 'macroserver sardana device name MANDATORY (string)'}, 'nchannelstoskip': {'default': '0', 'doc': 'number of mg channels to skip (string)'}, 'sardanasignal': {'default': 'SignalCounter', 'doc': 'signal sardana variable name (string)'}, 'signal': {'default': 'defaultsignal', 'doc': 'data signal field name (datasource)'}}, 'dcm': {'bend1': {'default': None, 'doc': 'bending of the first cristal (datasource)'}, 'bend2': {'default': None, 'doc': 'bending of the second cristal (datasource)'}, 'braggangle': {'default': None, 'doc': 'bragg angle (datasource)'}, 'bragganglename': {'default': 'bragg', 'doc': 'bragg angle name (string)'}, 'chi2dependson': {'default': 'theta', 'doc': 'the depends_on field of the second cristal chi, e.g. phi (string)'}, 'crystal': {'default': None, 'doc': 'type of crystal i.e. 0->Si111,1->Si311,2->Si111 ChannelCut (datasource)'}, 'dcmdevice': {'default': None, 'doc': 'FMBOxfDCMEnergy tango device (string)'}, 'energy': {'default': None, 'doc': 'synchronized monochromator energy (datasource)'}, 'energyfmb': {'default': None, 'doc': 'monochromator energy (datasource)'}, 'exitoffset': {'default': None, 'doc': ' exit offset (datasource)'}, 'jack1': {'default': None, 'doc': 'first vertical jack of table (datasource)'}, 'jack1name': {'default': 'jack1', 'doc': 'first vertical jack name of table (string)'}, 'jack2': {'default': None, 'doc': 'second vertical jack of table (datasource)'}, 'jack2name': {'default': 'jack2', 'doc': 'second vertical jack name of table (string)'}, 'jack3': {'default': None, 'doc': 'third vertical jack of table (datasource)'}, 'jack3name': {'default': 'jack3', 'doc': 'third vertical jack name of table (string)'}, 'lat': {'default': None, 'doc': 'horizontal lattice translation of the first cristal (datasource)'}, 'lat2': {'default': None, 'doc': 'horizontal lattice translation of the second cristal (datasource)'}, 'lat2name': {'default': 'lat', 'doc': 'horizontal lattice translation name of the second cristal (string)'}, 'latname': {'default': 'lat', 'doc': 'horizontal lattice translation name of the first cristal (string)'}, 'oxfordhorizontal': {'default': None, 'doc': ' horizontal translation (datasource)'}, 'par2': {'default': None, 'doc': 'beam parallel translation of the second cristal (datasource)'}, 'par2name': {'default': 'para', 'doc': 'beam parallel translation name of the second cristal (string)'}, 'perp2': {'default': None, 'doc': 'vertical translation of the second cristal (datasource)'}, 'perp2name': {'default': 'perp', 'doc': 'vertical translation name of the second cristal (string)'}, 'phi1dependson': {'default': '../../transformations/bragg', 'doc': 'the depends_on field of the first cristal phi, e.g. theta (string)'}, 'pitch1': {'default': None, 'doc': 'theta rotation of the first cristal (datasource)'}, 'pitch1name': {'default': 'theta', 'doc': 'theta rotation name of the first cristal (string)'}, 'pitch2': {'default': None, 'doc': 'theta rotation of the second cristal (datasource)'}, 'pitch2name': {'default': 'theta', 'doc': 'theta rotation name of the second cristal (string)'}, 'roll1': {'default': None, 'doc': 'chi rotation of the first cristal (datasource)'}, 'roll1name': {'default': 'chi', 'doc': 'chi rotation name of the first cristal (string)'}, 'roll2': {'default': None, 'doc': 'chi rotation of the second cristal (datasource)'}, 'roll2name': {'default': 'chi', 'doc': 'chi rotation name of the second cristal (string)'}, 'table': {'default': None, 'doc': 'vertical position of table (datasource)'}, 'tablename': {'default': 'table', 'doc': 'vertical position name of table (string)'}, 'theta': {'default': None, 'doc': 'theta angle (datasource)'}, 'thetaname': {'default': 'theta', 'doc': 'theta angle name (string)'}, 'topdependson2': {'default': 'chi', 'doc': 'the first transformation of the second crystal, e.g. lat (string)'}, 'unitcalibration': {'default': None, 'doc': 'unit calibration from dcmmotor (datasource)'}, 'usage': {'default': 'Bragg', 'doc': 'the crystall usage, e.g. Laue (string)'}, 'yaw': {'default': None, 'doc': 'phi rotation of the first cristal (datasource)'}, 'yaw2': {'default': None, 'doc': 'phi rotation of the second cristal (datasource)'}, 'yaw2name': {'default': 'phi', 'doc': 'phi rotation name of the second cristal (string)'}, 'yawname': {'default': 'phi', 'doc': 'phi rotation name of the first cristal (string)'}}, 'default': {'__configdevice__': {'default': 'nxs/configserver/localhost', 'doc': 'configuration server device name (string)'}, '__tangohost__': {'default': 'localhost', 'doc': 'tango host (string)'}, '__tangoport__': {'default': '10000', 'doc': 'tango port (string)'}, 'control': {'default': None, 'doc': 'group name of the monitor (string)'}, 'longname': {'default': 'P09 Resonant Scattering and Diffraction beamline', 'doc': 'beamline long name (string)'}, 'shortname': {'default': 'P09', 'doc': 'beamline short name (string)'}, 'sourcename': {'default': 'PETRA III', 'doc': 'source name (string)'}, 'srcname': {'default': 'source', 'doc': 'source group name (string)'}}, 'defaultinstrument': {'__configdevice__': {'default': 'nxs/configserver/localhost', 'doc': 'configuration server device name (string)'}, '__tangohost__': {'default': 'localhost', 'doc': 'tango host (string)'}, '__tangoport__': {'default': '10000', 'doc': 'tango port (string)'}, 'control': {'default': None, 'doc': 'group name of the monitor (string)'}, 'longname': {'default': 'P09 Resonant Scattering and Diffraction beamline', 'doc': 'beamline long name (string)'}, 'shortname': {'default': 'P09', 'doc': 'beamline short name (string)'}, 'sourcename': {'default': 'PETRA III', 'doc': 'source name (string)'}, 'srcname': {'default': 'source', 'doc': 'source group name (string)'}}, 'defaultsample': {}, 'description': {}, 'descriptiontext': {'description': {'default': 'scan', 'doc': 'scan technique (string)'}}, 'detectorlive': {'datatype': {'default': 'NX_UINT32', 'doc': 'list of devices (string)'}, 'detectordata': {'default': None, 'doc': 'detector live data (datasource)'}, 'detname': {'default': 'detector', 'doc': 'list of devices (string)'}}, 'empty': {}, 'groupsecop': {'access': {'default': None, 'doc': 'secop access list (string)'}, 'group': {'default': None, 'doc': 'secop group name (string)'}, 'host': {'default': None, 'doc': 'secop host name (string)'}, 'message': {'default': None, 'doc': 'secop command MANDATORY (string)'}, 'port': {'default': '5000', 'doc': 'secop port name (string)'}, 'timeout': {'default': '0.0001', 'doc': 'secop timeout (string)'}}, 'keithley': {'current': {'default': None, 'doc': 'current in A (datasource)'}, 'gain': {'default': None, 'doc': 'gain in V/A (datasource)'}, 'risetime': {'default': None, 'doc': 'rise time (datasource)'}, 'sourvoltlevel': {'default': None, 'doc': 'source voltage level in V (datasource)'}, 'voltage': {'default': None, 'doc': 'voltage in V (datasource)'}}, 'maia': {'chillersetpoint': {'default': None, 'doc': 'chiller set point temperature in Celsus (datasource)'}, 'chiptemperature': {'default': None, 'doc': 'detector chip temperature sensor for maia in Celsus (datasource)'}, 'gaintrimenable': {'default': None, 'doc': 'gaintrim enable status for maia (datasource)'}, 'identity': {'default': None, 'doc': 'sensor identity for maia (datasource)'}, 'interlockpressure': {'default': None, 'doc': 'interlock pressure for maia in mbar (datasource)'}, 'leakagecurrent': {'default': None, 'doc': 'leakage current sensor for maia in A (datasource)'}, 'lineariseenable': {'default': None, 'doc': 'linearise enable status for maia (datasource)'}, 'maiadimensions': {'default': 'empty', 'doc': 'maia dimensions component name (component)'}, 'maiafluxes': {'default': 'empty', 'doc': 'maia fluxes component name (component)'}, 'maiastage': {'default': 'empty', 'doc': 'maia stage component name (component)'}, 'mosfettemperature': {'default': None, 'doc': 'mosfet temperature sensor for maia in Celsus (datasource)'}, 'peltiercurrent': {'default': None, 'doc': 'peltier current sensor for maia in A (datasource)'}, 'photonenable': {'default': None, 'doc': 'photon enable status for maia (datasource)'}, 'pileuprejectionenable': {'default': None, 'doc': 'pileup rejection enable status for maia (datasource)'}, 'pixelenable': {'default': None, 'doc': 'pixel enable status for maia (datasource)'}, 'pressure': {'default': None, 'doc': 'gas pressure in mbar (datasource)'}, 'runnumber': {'default': None, 'doc': 'run number of maia (datasource)'}, 'status': {'default': None, 'doc': 'interlock status for maia (datasource)'}, 'throttleenable': {'default': None, 'doc': 'throttle enable status for maia (datasource)'}, 'uptime': {'default': None, 'doc': 'interlock uptime for maia (datasource)'}, 'voltagesetpoint': {'default': None, 'doc': 'voltage set point temperature in Celsus (datasource)'}, 'watertemperature': {'default': None, 'doc': 'water temperature sensor for maia in Celsus (datasource)'}}, 'maiadimension': {'detname': {'default': 'maia', 'doc': 'detector (alias) name (string)'}, 'dimname': {'default': None, 'doc': 'dimension name for maia (datasource)'}, 'dname': {'default': 'dimension', 'doc': 'dimension name group (string)'}, 'hysteresis': {'default': None, 'doc': 'pixel hysteresis of dimension for maia (datasource)'}, 'numberofpixels': {'default': None, 'doc': 'number of pixels of dimension for maia (datasource)'}, 'origin': {'default': None, 'doc': 'pixel origin of dimension for maia (datasource)'}, 'pixelpitch': {'default': None, 'doc': 'pixel pitch of dimension for maia (datasource)'}, 'positionsource': {'default': None, 'doc': 'position source of dimension for maia (datasource)'}, 'unit': {'default': None, 'doc': 'position units of dimension for maia (datasource)'}}, 'maiaflux': {'coefficient': {'default': None, 'doc': 'flux coefficient for maia (datasource)'}, 'detname': {'default': 'maia', 'doc': 'detector (alias) name (string)'}, 'fluxname': {'default': None, 'doc': 'flux name for maia (datasource)'}, 'fname': {'default': 'fluxdevice', 'doc': 'flux name group (string)'}, 'keithleydevice': {'default': 'keithley', 'doc': 'keithley device name (string)'}, 'source': {'default': None, 'doc': 'flux source for maia (datasource)'}, 'unit': {'default': None, 'doc': 'flux unit for maia (datasource)'}, 'vfcfactor': {'default': None, 'doc': 'vfc conversion factor (datasource)'}}, 'msnsar': {'__tangohost__': {'default': 'localhost', 'doc': 'tango host (string)'}, '__tangoport__': {'default': '10000', 'doc': 'tango port (string)'}, 'msenv': {'default': None, 'doc': 'sardana environment (datasource)'}, 'mssardanadevice': {'default': None, 'doc': 'sardana device name MANDATORY (string)'}, 'varname': {'default': None, 'doc': 'nested sardana environment variable name MANDATORY (string)'}}, 'mssar': {'__tangohost__': {'default': 'localhost', 'doc': 'tango host (string)'}, '__tangoport__': {'default': '10000', 'doc': 'tango port (string)'}, 'msenv': {'default': None, 'doc': 'sardana environment (datasource)'}, 'mssardanadevice': {'default': None, 'doc': 'macroserver sardana device name MANDATORY (string)'}, 'varname': {'default': None, 'doc': 'sardana environment variable name MANDATORY (string)'}}, 'parametercopymap': {'copymap': {'default': None, 'doc': 'yaml dictionary with {output: input} copy map (string)'}, 'parameter': {'default': 'copymap', 'doc': 'parameter name of copymap (string)'}, 'program': {'default': 'nxsfileinfo_parameters', 'doc': 'group name of NXparameters (string)'}}, 'pinhole': {'diameter': {'default': None, 'doc': 'pinhole diameter (datasource)'}, 'x': {'default': None, 'doc': 'horizontal position (datasource)'}, 'xname': {'default': 'x', 'doc': 'horizontal position name (string)'}, 'xsign': {'default': '', 'doc': "horizontal position sign, e.g. '-' (string)"}, 'y': {'default': None, 'doc': 'vertical position (datasource)'}, 'yname': {'default': 'y', 'doc': 'vertical position name (string)'}, 'z': {'default': None, 'doc': 'along the beam position (datasource)'}, 'zname': {'default': 'z', 'doc': 'along the beam position name (string)'}}, 'pointdet': {'data': {'default': None, 'doc': 'diode data (datasource)'}, 'detname': {'default': 'detector', 'doc': 'detector group name (string)'}}, 'qbpm': {'dependsony': {'default': '', 'doc': 'the depends_on y field value, e.g. distance (string)'}, 'dependstop': {'default': 'x', 'doc': 'the first transformation, e.g. distance (string)'}, 'distance': {'default': None, 'doc': 'distance for the sample in m, e.g. 0 (string)'}, 'distancename': {'default': 'distance', 'doc': 'distance name for the sample in m, e.g. 0 (string)'}, 'distanceoffset': {'default': None, 'doc': '3-vector distance offset in m, e.g. sample-source offset if the distance is taken from the source (string)'}, 'foil': {'default': None, 'doc': 'foil type, i.e. standard <cpname>_foil (datasource)'}, 'foilpos': {'default': None, 'doc': 'foil position MANDATORY (datasource)'}, 'foilposdict': {'default': '{"Ti": 43, "Ni": 23, "Out": 3}', 'doc': 'foil_type position json dictionary (string)'}, 'x': {'default': None, 'doc': 'horizontal position (datasource)'}, 'xname': {'default': 'x', 'doc': 'horizontal position name (string)'}, 'y': {'default': None, 'doc': 'vertical position (datasource)'}, 'yname': {'default': 'y', 'doc': 'vertical position name (string)'}}, 'sampledescription': {'sname': {'default': 'sample', 'doc': 'sample group name (string)'}}, 'sampledescriptiontext': {'description': {'default': '', 'doc': 'sample description or sampleId (string)'}, 'sname': {'default': 'sample', 'doc': 'sample group name (string)'}}, 'samplehkl': {'h': {'default': None, 'doc': 'h position in hkl space (datasource)'}, 'k': {'default': None, 'doc': 'k position in hkl space (datasource)'}, 'l': {'default': None, 'doc': 'l position in hkl space (datasource)'}, 'psi': {'default': None, 'doc': 'psi angle position of analyzer (datasource)'}, 'sname': {'default': 'sample', 'doc': 'sample group name (string)'}}, 'secop': {'host': {'default': None, 'doc': 'secop host name (string)'}, 'message': {'default': None, 'doc': 'secop command MANDATORY (string)'}, 'port': {'default': '5000', 'doc': 'secop port name (string)'}, 'timeout': {'default': '0.0001', 'doc': 'secop timeout (string)'}}, 'secoplinks': {'environments': {'default': 'temperature,magnetic_field', 'doc': 'secop environment link lists MANDATORY (string)'}, 'meanings': {'default': 'temperature,magnetic_field,electric_field,stress_field,pressure', 'doc': 'secop meanings link lists MANDATORY (string)'}, 'sampleenvname': {'default': 'sample_environment', 'doc': 'sample environment group name (string)'}, 'samplename': {'default': 'sample', 'doc': 'sample group name (string)'}}, 'singlesecop': {'host': {'default': None, 'doc': 'secop host name (string)'}, 'message': {'default': None, 'doc': 'secop command MANDATORY (string)'}, 'port': {'default': '5000', 'doc': 'secop port name (string)'}, 'timeout': {'default': '0.0001', 'doc': 'secop timeout (string)'}}, 'slit': {'bottom': {'default': None, 'doc': 'bottom blade position (datasource)'}, 'bottomclosed': {'default': None, 'doc': 'bottom blade closed position (datasource)'}, 'dependstop': {'default': None, 'doc': 'the first transformation, e.g. distance (string)'}, 'distance': {'default': None, 'doc': 'distance for the sample in m, e.g. 0 (string)'}, 'distancename': {'default': 'distance', 'doc': 'distance name for the sample in m, e.g. 0 (string)'}, 'distanceoffset': {'default': None, 'doc': '3-vector distance offset in m, e.g. sample-source offset if the distance is taken from the source (string)'}, 'left': {'default': None, 'doc': 'left blade position (datasource)'}, 'leftclosed': {'default': None, 'doc': 'left blade closed position (datasource)'}, 'right': {'default': None, 'doc': 'right blade position (datasource)'}, 'rightclosed': {'default': None, 'doc': 'right blade closed position (datasource)'}, 'top': {'default': None, 'doc': 'top blade position (datasource)'}, 'topclosed': {'default': None, 'doc': 'top blade closed position (datasource)'}, 'transformations': {'default': None, 'doc': "transformations group name i.e. 'transformations'. If it is not set it is not created (string)"}, 'xgap': {'default': None, 'doc': 'horizontal gap (datasource)'}, 'xoffdependson': {'default': 'y_offset', 'doc': 'the first transformation, e.g. distance (string)'}, 'xoffset': {'default': None, 'doc': 'horizontal offset (datasource)'}, 'xoffsetcalibration': {'default': None, 'doc': 'horizontal offset calibration (datasource)'}, 'xoffsetcalibrationname': {'default': 'x_offset_calibration', 'doc': 'horizontal offset calibration name (string)'}, 'xoffsetname': {'default': 'x_offset', 'doc': 'horizontal offset name (string)'}, 'ygap': {'default': None, 'doc': 'vertical gap (datasource)'}, 'yoffdependson': {'default': 'distance', 'doc': 'the first transformation, e.g. distance (string)'}, 'yoffset': {'default': None, 'doc': 'vertiacal offset (datasource)'}, 'yoffsetcalibration': {'default': None, 'doc': 'vertiacal offset calibration (datasource)'}, 'yoffsetcalibrationname': {'default': 'y_offset_calibration', 'doc': 'vertiacal offset calibration name (string)'}, 'yoffsetname': {'default': 'y_offset', 'doc': 'vertiacal offset name (string)'}}, 'source': {'beamcurrent': {'default': None, 'doc': 'ring beam current (datasource)'}, 'bunchmode': {'default': 'Multi Bunch', 'doc': 'bunch mode (string)'}, 'numberofbunches': {'default': None, 'doc': 'number of source bunches (datasource)'}, 'sourceenergy': {'default': None, 'doc': 'ring beam energy (datasource)'}, 'srcname': {'default': 'source', 'doc': 'source group name (string)'}}, 'starttime': {}, 'tango': {'attribute': {'default': 'Position', 'doc': 'tango device attribute (string)'}, 'device': {'default': None, 'doc': 'tango device MANDATORY (string)'}}, 'undulator': {'dependstop': {'default': None, 'doc': 'the first transformation, e.g. distance (string)'}, 'distance': {'default': None, 'doc': 'distance from the sample in m, e.g. 0 (string)'}, 'distancename': {'default': 'distance', 'doc': 'distance name from the sample in m, e.g. 0 (string)'}, 'distanceoffset': {'default': None, 'doc': '3-vector distance offset in m, e.g. sample-source offset if the distance is taken from the source (string)'}, 'energy': {'default': None, 'doc': 'undulator energy (datasource)'}, 'gap': {'default': None, 'doc': 'separation between opposing pairs of magnetic pole (datasource)'}, 'gapunits': {'default': 'mm', 'doc': 'gap units (string)'}, 'harmonic': {'default': None, 'doc': 'undulator harmonic (datasource)'}, 'length': {'default': '2', 'doc': 'length of insertion device in meters (string)'}, 'shift': {'default': None, 'doc': 'undulator shift (datasource)'}, 'shiftunits': {'default': 'mm', 'doc': 'shift units (string)'}, 'speed': {'default': None, 'doc': 'undulator speed (datasource)'}, 'speedunits': {'default': '', 'doc': 'speed units (string)'}, 'taper': {'default': None, 'doc': 'gap difference between upstream and downstream ends of the insertion device (datasource)'}, 'taperunits': {'default': 'mm', 'doc': 'gap units (string)'}, 'transformations': {'default': None, 'doc': "transformations group name i.e. 'transformations'. If it is not set it is not created (string)"}, 'type': {'default': 'undulator', 'doc': 'undulator or wiggler (string)'}, 'uname': {'default': 'insertion_device', 'doc': 'insertion_device group name (string)'}}}

(dict <str , dict <str , str > >) standard component template variables and its [default value, doc string]