nxselector


Namenxselector JSON
Version 3.20.0 PyPI version JSON
download
home_pagehttps://github.com/nexdatas/nxselector
SummaryGUI for Setting Nexus Sardana Recorder
upload_time2023-08-03 09:38:14
maintainerJan Kotanski
docs_urlNone
authorJan Kotanski
requires_python
licenseGNU GENERAL PUBLIC LICENSE, version 3
keywords configuration scan nexus sardana recorder tango component data
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Welcome to nxselector's documentation!
=======================================


|github workflow|
|docs|
|Pypi Version|
|Python Versions|

.. |github workflow| image:: https://github.com/nexdatas/nxselector/actions/workflows/tests.yml/badge.svg
   :target: https://github.com/nexdatas/nxselector/actions
   :alt:

.. |docs| image:: https://img.shields.io/badge/Documentation-webpages-ADD8E6.svg
   :target: https://nexdatas.github.io/nxselector/index.html
   :alt:

.. |Pypi Version| image:: https://img.shields.io/pypi/v/nxselector.svg
                  :target: https://pypi.python.org/pypi/nxselector
                  :alt:

.. |Python Versions| image:: https://img.shields.io/pypi/pyversions/nxselector.svg
                     :target: https://pypi.python.org/pypi/nxselector/
                     :alt:



Authors: Jan Kotanski

NeXus Component Selector
is a GUI configuration tool dedicated to select components
as well as datasources which constitute the XML configuration strings of
Nexus Data Writer via Sardana NeXus Recorder.

| Source code: https://github.com/nexdatas/nxselector
| Web page:  https://nexdatas.github.io/nxselector
| NexDaTaS Web page: https://nexdatas.github.io


------------
Installation
------------

Install the dependencies:

|    Sardana, tango, sphinx, Taurus, NXSRecSelector

From sources
^^^^^^^^^^^^

Download the latest version of NeXuS Configuration Server from

|    https://github.com/nexdatas/nxselector

Extract the sources and run

.. code-block:: console

	  $ python setup.py install

Debian packages
^^^^^^^^^^^^^^^

Debian `bookworm`, `bullseye`, `buster` or Ubuntu  `lunar`, `jammy`, `focal` packages can be found in the HDRI repository.

To install the debian packages, add the PGP repository key

.. code-block:: console

	  $ sudo su
	  $ wget -q -O - http://repos.pni-hdri.de/debian_repo.pub.gpg | apt-key add -

and then download the corresponding source list, e.g.

.. code-block:: console

	  $ cd /etc/apt/sources.list.d
	  $ wget http://repos.pni-hdri.de/bookworm-pni-hdri.list

Finally,

.. code-block:: console

	  $ apt-get update
	  $ apt-get install python3-nxsrecselector nxselector nxsrecselector

To instal other NexDaTaS packages

.. code-block:: console

	  $ apt-get install python3-nxswriter nxsconfigtool nxstools python3-nxsconfigserver nxsconfigserver-db

and

.. code-block:: console

	  $ apt-get install python3-sardana-nxsrecorder nxstaurusgui

for NeXus recorder and MacroGUI packages.

From pip
^^^^^^^^

To install it from pip you need also to install pyqt5, e.g.

.. code-block:: console

   $ python3 -m venv myvenv
   $ . myvenv/bin/activate

   $ pip install pyqt5

   $ pip install nxselector

Moreover it is also good to install

.. code-block:: console

   $ pip install pytango
   $ pip install sardana
   $ pip install nxswriter
   $ pip install nxsrecselector
   $ pip install nxsconfigserver
   $ pip install nxstools
   $ pip install pymysqldb


-------------------
Setting environment
-------------------


Setting Saradna
^^^^^^^^^^^^^^^
If sardana is not yet set up run


.. code-block:: console

	  $ Pool

- enter a new instance name
- create the new instance

Then wait a while until Pool is started and in a new terminal run

.. code-block:: console

	  $ MacroServer

- enter a new instance name
- create the new instance
- connect pool

Next, run Astor and change start-up levels: for Pool to 2,
for MacroServer to 3 and restart servers.

Alternatively, terminate Pool and MacroServer in the terminals and run

.. code-block:: console

          $ nxsetup start Pool -l2

wait until Pool is started and run

.. code-block:: console

          $ nxsetup start MacroServer -l3


Additionally, one can create dummy devices by running `sar_demo` in

.. code-block:: console

	  $ spock



Setting NeXus Servers
^^^^^^^^^^^^^^^^^^^^^

To set up  NeXus Servers run

.. code-block:: console

	  $ nxsetup set

or

.. code-block:: console

          $ nxsetup set NXSDataWriter
          $ nxsetup set NXSConfigServer
	  $ nxsetup set NXSRecSelector

for specific servers.

If the `RecoderPath` property of MacroServer is not set one can do it by

.. code-block:: console

	  $ nxsetup add-recoder-path /usr/lib/python2.7/dist-packages/sardananxsrecorder

where the path should point the `sardananxsrecorder` package.

General overview
================

----------------
Device Selection
----------------

Every measurement requires devices to be selected. The Component Selector (CS) is a graphical user interface serving this purpose. It is launched from a Linux terminal by

.. code-block:: console

   $ nxselector

or from Spock by

.. code-block:: console

   p09/door/haspp09.01 [1]: nxselector

.. _Figure_1.1:

.. figure:: https://github.com/nexdatas/nxselector/blob/develop/doc/png/detectors_23.png?raw=true

   Figure 1.1: Component Selector: Detectors

Configuration of the each hardware device for the NeXus files is described inside a configution string, i.e. a configuration component. The employed configuration concept is inspired by the following hardware/configuration correspondences:
.. For more details about NeXus configuration components and their data sources see Section 10.7

| *measurement* <=> *file*
| *experimental setup* <=> *NeXus configuration*
| *hardware device* <=> *component*
| *device attribute*, e.g. counter reading, motor position <=> *data source*
|

The `Figure 1.1` displays the Detectors tab of the Component Selector including the available device components. Composite components are the one with multiple data sources. Simple components are distributed in the frames labelled Counters, ADC, MCA, etc. Components are selected by activating the *Sel.* checkbox. If the *Dis.* checkbox is enabled, the output of the device is displayed during the scan for monitoring purposes.

Simple components may be part of composite components. As a consequence, selecting a composite component may implicitly select one or more simple components. This dependency has to be visible for the users. Therefore, simple components being implicitly selected are deactivated and their font colour changes to grey. The user may also move the mouse over a composite component to inspect the contents.

Ideally all devices are contained in components ensuring that they have sensible NeXus paths and meaningful metadata associated with them. In practice this is not always possible. Consider a counter module with 32 channels. Some of them are permanently connected to specific detectors. It is an easy task to create components for these inputs. However, during the course of a beamtime, it may happen that a researcher needs to record some other signal. Depending on the circumstances it may be impossible to create a new component immediately. Still the new signal has to be recorded. In order to handle this situation, dynamical components have been introduced. They are automatically created whenever a selected device is not covered by a component.

In the upper part of the Selector window the user sets Scan File, Scan Directory and if consecutive scans are appended to one file or stored separately. To use NeXus Sardana Recorder the file extension has to be set to *.nxs* , *.nx* , *.h5*, *.ndf*. **Before the scan all the changes has to be confirmed by the Apply button**. Its action updates settings of the active Sardana measurement group and configuration of the Component Selector.

The Others button of Detectors allows for the user to add simple devices into the measurement group. Its attribute values will be stored for each the scan point.

After devices have been selected and applied the state of all tabs is stored into a profile in the NeXuS Configuration Server. The **profile** contains setting informations, i.e. selected components, user data and file settings, required to prepare configuration for the NeXus writer. The profile extends its measurement group so they share the same name. It is possible to create several profiles. A required profile can be loaded to restore a particular device selection. It is done automatically by changing *MntGrp* in the Selector.

Moreover, by pressing the *Save* or *Load* buttons, the user can save to a file or load the current scan profile. This way, the researcher can easily switch from one data acquisition setup to another.


.. _Figure_1.2:

.. figure:: https://github.com/nexdatas/nxselector/blob/develop/doc/png/descriptions_23.png?raw=true

   Figure 1.2: Component Selector: Descriptions

The Descriptions tab, `Figure 1.2`, displays components containing metadata which are stored only before or after the scan. They are divided into two groups: the *Mandatory* beamline-specific components and the *Optional* discipline-specific components. The *Mandatory* beamline group describes the source device and the facility. The *Optional* discipline group contains information about the spatial arrangement of the experimental setup, mainly motor positions. The user can select or deselect the optional components from the current profile.

Moreover, the *Reset Desc.* button of Descriptions sets a group of descriptive components to the default one, i.e. defined in the DefaultAutomaticComponents property of the current NXSRecSelector server.

The *Others* button of Descriptions allows for the user to add simple devices into the profile descriptions, i.e. *Other Optional*. Its attribute values will be stored before the scan point.

During appling the selected profile informations from Descriptive components are also stored in the *PreScanSnapshot* door environment variable.
This helps to store the metadata informations by other Sardana recorders.

.. _Figure_1.3:

.. figure:: https://github.com/nexdatas/nxselector/blob/develop/doc/png/udata_23.png?raw=true

   Figure 1.3: Component Selector: NeXus User Data

In order to describe the experiment completely some of the client data have to be provided by the user. The `Figure 1.3` shows the CS tab allowing the researcher to supply this information. Typical examples for user-supplied metadata are title, sample name and user comment.

The layout of the Component Selector can be easily adapted into different beamline specification in the Configuration tab.

.. The Section 10.8.5 contains more detail description of the settings, i.e. the Configuration tag.

-----
Icons
-----

Icons fetched from http://findicons.com/pack/990/vistaico_toolbar.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/nexdatas/nxselector",
    "name": "nxselector",
    "maintainer": "Jan Kotanski",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "jankotan@gmail.com",
    "keywords": "configuration scan nexus sardana recorder tango component data",
    "author": "Jan Kotanski",
    "author_email": "jankotan@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/c9/8d/5079260be99983bf30cb357937ef02a874bb4b496a857f8f1400f86777d3/nxselector-3.20.0.tar.gz",
    "platform": "Linux",
    "description": "Welcome to nxselector's documentation!\n=======================================\n\n\n|github workflow|\n|docs|\n|Pypi Version|\n|Python Versions|\n\n.. |github workflow| image:: https://github.com/nexdatas/nxselector/actions/workflows/tests.yml/badge.svg\n   :target: https://github.com/nexdatas/nxselector/actions\n   :alt:\n\n.. |docs| image:: https://img.shields.io/badge/Documentation-webpages-ADD8E6.svg\n   :target: https://nexdatas.github.io/nxselector/index.html\n   :alt:\n\n.. |Pypi Version| image:: https://img.shields.io/pypi/v/nxselector.svg\n                  :target: https://pypi.python.org/pypi/nxselector\n                  :alt:\n\n.. |Python Versions| image:: https://img.shields.io/pypi/pyversions/nxselector.svg\n                     :target: https://pypi.python.org/pypi/nxselector/\n                     :alt:\n\n\n\nAuthors: Jan Kotanski\n\nNeXus Component Selector\nis a GUI configuration tool dedicated to select components\nas well as datasources which constitute the XML configuration strings of\nNexus Data Writer via Sardana NeXus Recorder.\n\n| Source code: https://github.com/nexdatas/nxselector\n| Web page:  https://nexdatas.github.io/nxselector\n| NexDaTaS Web page: https://nexdatas.github.io\n\n\n------------\nInstallation\n------------\n\nInstall the dependencies:\n\n|    Sardana, tango, sphinx, Taurus, NXSRecSelector\n\nFrom sources\n^^^^^^^^^^^^\n\nDownload the latest version of NeXuS Configuration Server from\n\n|    https://github.com/nexdatas/nxselector\n\nExtract the sources and run\n\n.. code-block:: console\n\n\t  $ python setup.py install\n\nDebian packages\n^^^^^^^^^^^^^^^\n\nDebian `bookworm`, `bullseye`, `buster` or Ubuntu  `lunar`, `jammy`, `focal` packages can be found in the HDRI repository.\n\nTo install the debian packages, add the PGP repository key\n\n.. code-block:: console\n\n\t  $ sudo su\n\t  $ wget -q -O - http://repos.pni-hdri.de/debian_repo.pub.gpg | apt-key add -\n\nand then download the corresponding source list, e.g.\n\n.. code-block:: console\n\n\t  $ cd /etc/apt/sources.list.d\n\t  $ wget http://repos.pni-hdri.de/bookworm-pni-hdri.list\n\nFinally,\n\n.. code-block:: console\n\n\t  $ apt-get update\n\t  $ apt-get install python3-nxsrecselector nxselector nxsrecselector\n\nTo instal other NexDaTaS packages\n\n.. code-block:: console\n\n\t  $ apt-get install python3-nxswriter nxsconfigtool nxstools python3-nxsconfigserver nxsconfigserver-db\n\nand\n\n.. code-block:: console\n\n\t  $ apt-get install python3-sardana-nxsrecorder nxstaurusgui\n\nfor NeXus recorder and MacroGUI packages.\n\nFrom pip\n^^^^^^^^\n\nTo install it from pip you need also to install pyqt5, e.g.\n\n.. code-block:: console\n\n   $ python3 -m venv myvenv\n   $ . myvenv/bin/activate\n\n   $ pip install pyqt5\n\n   $ pip install nxselector\n\nMoreover it is also good to install\n\n.. code-block:: console\n\n   $ pip install pytango\n   $ pip install sardana\n   $ pip install nxswriter\n   $ pip install nxsrecselector\n   $ pip install nxsconfigserver\n   $ pip install nxstools\n   $ pip install pymysqldb\n\n\n-------------------\nSetting environment\n-------------------\n\n\nSetting Saradna\n^^^^^^^^^^^^^^^\nIf sardana is not yet set up run\n\n\n.. code-block:: console\n\n\t  $ Pool\n\n- enter a new instance name\n- create the new instance\n\nThen wait a while until Pool is started and in a new terminal run\n\n.. code-block:: console\n\n\t  $ MacroServer\n\n- enter a new instance name\n- create the new instance\n- connect pool\n\nNext, run Astor and change start-up levels: for Pool to 2,\nfor MacroServer to 3 and restart servers.\n\nAlternatively, terminate Pool and MacroServer in the terminals and run\n\n.. code-block:: console\n\n          $ nxsetup start Pool -l2\n\nwait until Pool is started and run\n\n.. code-block:: console\n\n          $ nxsetup start MacroServer -l3\n\n\nAdditionally, one can create dummy devices by running `sar_demo` in\n\n.. code-block:: console\n\n\t  $ spock\n\n\n\nSetting NeXus Servers\n^^^^^^^^^^^^^^^^^^^^^\n\nTo set up  NeXus Servers run\n\n.. code-block:: console\n\n\t  $ nxsetup set\n\nor\n\n.. code-block:: console\n\n          $ nxsetup set NXSDataWriter\n          $ nxsetup set NXSConfigServer\n\t  $ nxsetup set NXSRecSelector\n\nfor specific servers.\n\nIf the `RecoderPath` property of MacroServer is not set one can do it by\n\n.. code-block:: console\n\n\t  $ nxsetup add-recoder-path /usr/lib/python2.7/dist-packages/sardananxsrecorder\n\nwhere the path should point the `sardananxsrecorder` package.\n\nGeneral overview\n================\n\n----------------\nDevice Selection\n----------------\n\nEvery measurement requires devices to be selected. The Component Selector (CS) is a graphical user interface serving this purpose. It is launched from a Linux terminal by\n\n.. code-block:: console\n\n   $ nxselector\n\nor from Spock by\n\n.. code-block:: console\n\n   p09/door/haspp09.01 [1]: nxselector\n\n.. _Figure_1.1:\n\n.. figure:: https://github.com/nexdatas/nxselector/blob/develop/doc/png/detectors_23.png?raw=true\n\n   Figure 1.1: Component Selector: Detectors\n\nConfiguration of the each hardware device for the NeXus files is described inside a configution string, i.e. a configuration component. The employed configuration concept is inspired by the following hardware/configuration correspondences:\n.. For more details about NeXus configuration components and their data sources see Section 10.7\n\n| *measurement* <=> *file*\n| *experimental setup* <=> *NeXus configuration*\n| *hardware device* <=> *component*\n| *device attribute*, e.g. counter reading, motor position <=> *data source*\n|\n\nThe `Figure 1.1` displays the Detectors tab of the Component Selector including the available device components. Composite components are the one with multiple data sources. Simple components are distributed in the frames labelled Counters, ADC, MCA, etc. Components are selected by activating the *Sel.* checkbox. If the *Dis.* checkbox is enabled, the output of the device is displayed during the scan for monitoring purposes.\n\nSimple components may be part of composite components. As a consequence, selecting a composite component may implicitly select one or more simple components. This dependency has to be visible for the users. Therefore, simple components being implicitly selected are deactivated and their font colour changes to grey. The user may also move the mouse over a composite component to inspect the contents.\n\nIdeally all devices are contained in components ensuring that they have sensible NeXus paths and meaningful metadata associated with them. In practice this is not always possible. Consider a counter module with 32 channels. Some of them are permanently connected to specific detectors. It is an easy task to create components for these inputs. However, during the course of a beamtime, it may happen that a researcher needs to record some other signal. Depending on the circumstances it may be impossible to create a new component immediately. Still the new signal has to be recorded. In order to handle this situation, dynamical components have been introduced. They are automatically created whenever a selected device is not covered by a component.\n\nIn the upper part of the Selector window the user sets Scan File, Scan Directory and if consecutive scans are appended to one file or stored separately. To use NeXus Sardana Recorder the file extension has to be set to *.nxs* , *.nx* , *.h5*, *.ndf*. **Before the scan all the changes has to be confirmed by the Apply button**. Its action updates settings of the active Sardana measurement group and configuration of the Component Selector.\n\nThe Others button of Detectors allows for the user to add simple devices into the measurement group. Its attribute values will be stored for each the scan point.\n\nAfter devices have been selected and applied the state of all tabs is stored into a profile in the NeXuS Configuration Server. The **profile** contains setting informations, i.e. selected components, user data and file settings, required to prepare configuration for the NeXus writer. The profile extends its measurement group so they share the same name. It is possible to create several profiles. A required profile can be loaded to restore a particular device selection. It is done automatically by changing *MntGrp* in the Selector.\n\nMoreover, by pressing the *Save* or *Load* buttons, the user can save to a file or load the current scan profile. This way, the researcher can easily switch from one data acquisition setup to another.\n\n\n.. _Figure_1.2:\n\n.. figure:: https://github.com/nexdatas/nxselector/blob/develop/doc/png/descriptions_23.png?raw=true\n\n   Figure 1.2: Component Selector: Descriptions\n\nThe Descriptions tab, `Figure 1.2`, displays components containing metadata which are stored only before or after the scan. They are divided into two groups: the *Mandatory* beamline-specific components and the *Optional* discipline-specific components. The *Mandatory* beamline group describes the source device and the facility. The *Optional* discipline group contains information about the spatial arrangement of the experimental setup, mainly motor positions. The user can select or deselect the optional components from the current profile.\n\nMoreover, the *Reset Desc.* button of Descriptions sets a group of descriptive components to the default one, i.e. defined in the DefaultAutomaticComponents property of the current NXSRecSelector server.\n\nThe *Others* button of Descriptions allows for the user to add simple devices into the profile descriptions, i.e. *Other Optional*. Its attribute values will be stored before the scan point.\n\nDuring appling the selected profile informations from Descriptive components are also stored in the *PreScanSnapshot* door environment variable.\nThis helps to store the metadata informations by other Sardana recorders.\n\n.. _Figure_1.3:\n\n.. figure:: https://github.com/nexdatas/nxselector/blob/develop/doc/png/udata_23.png?raw=true\n\n   Figure 1.3: Component Selector: NeXus User Data\n\nIn order to describe the experiment completely some of the client data have to be provided by the user. The `Figure 1.3` shows the CS tab allowing the researcher to supply this information. Typical examples for user-supplied metadata are title, sample name and user comment.\n\nThe layout of the Component Selector can be easily adapted into different beamline specification in the Configuration tab.\n\n.. The Section 10.8.5 contains more detail description of the settings, i.e. the Configuration tag.\n\n-----\nIcons\n-----\n\nIcons fetched from http://findicons.com/pack/990/vistaico_toolbar.\n\n\n",
    "bugtrack_url": null,
    "license": "GNU GENERAL PUBLIC LICENSE, version 3",
    "summary": "GUI for Setting Nexus Sardana Recorder",
    "version": "3.20.0",
    "project_urls": {
        "Homepage": "https://github.com/nexdatas/nxselector"
    },
    "split_keywords": [
        "configuration",
        "scan",
        "nexus",
        "sardana",
        "recorder",
        "tango",
        "component",
        "data"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bddf64d9c401152ad6f04bf60a3b839fa67841ce6e809798bd1e8d5cb8807bf6",
                "md5": "841444c362424621a45024e7d7dd92ed",
                "sha256": "cd43d0b7f9382307c238e27902fff7ec16cf5b4778b9f31d1efa168e8b69f492"
            },
            "downloads": -1,
            "filename": "nxselector-3.20.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "841444c362424621a45024e7d7dd92ed",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 117604,
            "upload_time": "2023-08-03T09:38:11",
            "upload_time_iso_8601": "2023-08-03T09:38:11.805572Z",
            "url": "https://files.pythonhosted.org/packages/bd/df/64d9c401152ad6f04bf60a3b839fa67841ce6e809798bd1e8d5cb8807bf6/nxselector-3.20.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c98d5079260be99983bf30cb357937ef02a874bb4b496a857f8f1400f86777d3",
                "md5": "a8e9a5236ca6a96b3b75c1145178ab9c",
                "sha256": "d5f77ff63642663e6047bf902735da486a00f90e3f8147eeb1bbe3bfb0cdf659"
            },
            "downloads": -1,
            "filename": "nxselector-3.20.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a8e9a5236ca6a96b3b75c1145178ab9c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 110224,
            "upload_time": "2023-08-03T09:38:14",
            "upload_time_iso_8601": "2023-08-03T09:38:14.152273Z",
            "url": "https://files.pythonhosted.org/packages/c9/8d/5079260be99983bf30cb357937ef02a874bb4b496a857f8f1400f86777d3/nxselector-3.20.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-03 09:38:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nexdatas",
    "github_project": "nxselector",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "nxselector"
}
        
Elapsed time: 0.10212s