{ "info": { "author": "Jan Kotanski, Eugen Wintersberger , Halil Pasic", "author_email": "jankotan@gmail.com, eugen.wintersberger@gmail.com, halil.pasic@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Scientific/Engineering :: Physics", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Welcome to NXSDataWriter's documentation!\n=========================================\n\nAuthors: Jan Kotanski, Eugen Wintersberger, Halil Pasic\n\n------------\nIntroduction\n------------\n\nNXSDataWriter is a Tango server which allows to store NeXuS Data in H5 files.\n\nThe server provides storing data from other Tango devices,\nvarious databases as well as passed by a user client via JSON strings.\n\nTango Server API: https://nexdatas.github.io/writer/doc_html\n\n| Source code: https://github.com/nexdatas/writer\n| Project Web page: https://nexdatas.github.io/writer\n| NexDaTaS Web page: https://nexdatas.github.io\n\n------------\nInstallation\n------------\n\nInstall the dependencies:\n\n| pni-libraries, PyTango, numpy\n\nFrom sources\n\"\"\"\"\"\"\"\"\"\"\"\"\n\nDownload the latest NexDaTaS version from\n\n| https://github.com/nexdatas/writer\n\nExtract sources and run\n\n.. code-block:: console\n\n\t $ python setup.py install\n\nDebian packages\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\nDebian Jessie (and Wheezy) 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\n\n.. code-block:: console\n\n\t $ cd /etc/apt/sources.list.d\n\t $ wget http://repos.pni-hdri.de/jessie-pni-hdri.list\n\nFinally,\n\n.. code-block:: console\n\n\t $ apt-get update\n\t $ apt-get install python-nxswriter\n\nTo instal other NexDaTaS packages\n\n.. code-block:: console\n\n\t $ apt-get install python-nxstools nxsconfigserver-db python-nxsconfigserver nxsconfigtool\n\nand\n\n.. code-block:: console\n\n\t $ apt-get install python-nxsrecselector nxselector python-sardana-nxsrecorder\n\nfor Component Selector and Sardana related packages.\n\nSetting NeXus Writer Server\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\nTo set up NeXus Writer Server run\n\n.. code-block:: console\n\n $ nxsetup -x NXSDataWriter\n\nThe *nxsetup* command comes from the **python-nxstools** package.\n\n-------------------------\nInstallation from sources\n-------------------------\n\n\nExtract sources and run\n\n.. code-block:: console\n\n $ python setup.py install\n\n-----------\nClient code\n-----------\n\nIn order to use Nexus Data Server one has to write a client code. Some simple client codes\nare in the nexdatas repository. In this section we add some\ncomments related to the client code.\n\n.. code-block:: python\n\n # To use the Tango Server we must import the PyTango module and\n # create DeviceProxy for the server.\n\n import PyTango\n\n device = \"p09/tdw/r228\"\n dpx = PyTango.DeviceProxy(device)\n dpx.set_timeout_millis(10000)\n\n dpx.Init()\n\n # Here device corresponds to a name of our Nexus Data Server.\n # The Init() method resets the state of the server.\n\n dpx.FileName = \"test.h5\"\n dpx.OpenFile()\n\n # We set the name of the output HDF5 file and open it.\n\n # Now we are ready to pass the XML settings describing a structure of\n # the output file as well as defining a way of data storing.\n # Examples of the XMLSettings can be found in the XMLExamples directory.\n\n xml = open(\"test.xml\", 'r').read()\n dpx.XMLSettings = xml\n\n dpx.JSONRecord = '{\"data\": {\"parameterA\":0.2},\n\t\t\t \"decoders\":{\"DESY2D\":\"desydecoders.desy2Ddec.desy2d\"},\n\t\t\t \"datasources\":{\n\t\t \"MCLIENT\":\"sources.DataSources.LocalClientSource\"}\n }'\n\n dpx.OpenEntry()\n\n # We read our XML settings settings from a file and pass them to the server via\n # the XMLSettings attribute. Then we open an entry group related to the XML\n # configuration. Optionally, we can also set JSONRecord, i.e. an attribute\n # which contains a global JSON string with data needed to store during opening\n # the entry and also other stages of recording. If external decoder for\n # DevEncoded data is need one can registred it passing its packages and\n # class names in JSONRecord,\n # e.g. \"desy2d\" class of \"DESY2D\" label in \"desydecoders.desy2Ddec\" package.\n # Similarly making use of \"datasources\" records of the JSON string one can\n # registred additional datasources. The OpenEntry method stores data defined\n # in the XML string with strategy=INIT.\n # The JSONRecord attribute can be changed during recording our data.\n\n # After finalization of the configuration process we can start recording\n # the main experiment data in a STEP mode.\n\n dpx.Record('{\"data\": {\"p09/counter/exp.01\":0.1, \"p09/counter/exp.02\":1.1}}')\n\n # Every time we call the Record method all nexus fields defined with\n # strategy=STEP are extended by one record unit and the assigned to them data\n # is stored. As the method argument we pass a local JSON string with the client\n # data. To record the client data one can also use the global JSONRecord string.\n # Contrary to the global JSON string the local one is only\n # valid during one record step.\n\n dpx.Record('{\"data\": {\"emittance_x\": 0.1}, \"triggers\":[\"trigger1\", \"trigger2\"] }')\n\n # If you denote in your XML configuration string some fields by additional\n # trigger attributes you may ask the server to store your data only in specific\n # record steps. This can be helpful if you want to store your data in\n # asynchronous mode. To this end you define in the local JSON string a list of\n # triggers which are used in the current record step.\n\n dpx.JSONRecord = '{\"data\": {\"parameterB\":0.3}}'\n dpx.CloseEntry()\n\n # After scanning experiment data in 'STEP' mode we close the entry.\n # To this end we call the CloseEntry method which also stores data defined\n # with strategy=FINAL. Since our HDF5 file can contain many entries we can again\n # open the entry and repeat our record procedure. If we define more than one entry\n # in one XML setting string the defined entries are recorded parallel\n # with the same steps.\n\n # Finally, we can close our output file by\n\n dpx.CloseFile()\n\nAdditionally, one can use asynchronous versions of **OpenEntry**, **Record**, **CloseEntry**, i.e.\n**OpenEntryAsynch**, **RecordAsynch**, **CloseEntryAsynch**. In this case data is stored\nin a background thread and during this writing Tango Data Server has a state *RUNNING*.\n\nIn order to build the XML configurations in the easy way the authors of the server provide\nfor this purpose a specialized GUI tool, Component Designer.\nThe attached to the server XML examples\nwas created by XMLFile class defined in XMLCreator/simpleXML.py.\n\nFrom pip\n\"\"\"\"\"\"\"\"\n\nTo install it from pip you can\n\n.. code-block:: console\n\n $ python3 -m venv myvenv\n $ . myvenv/bin/activate\n\n $ pip install nxswriter\n\nMoreover it is also good to install\n\n.. code-block:: console\n\n $ pip install pytango\n $ pip install pymysqldb\n $ pip install psycopg2-binary\n $ pip install cx-oracle", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jkotan/nexdatas/writer", "keywords": "writer Tango server nexus data", "license": "GNU GENERAL PUBLIC LICENSE v3", "maintainer": "", "maintainer_email": "", "name": "nxswriter", "package_url": "https://pypi.org/project/nxswriter/", "platform": "", "project_url": "https://pypi.org/project/nxswriter/", "project_urls": { "Homepage": "https://github.com/jkotan/nexdatas/writer" }, "release_url": "https://pypi.org/project/nxswriter/2.25.1/", "requires_dist": null, "requires_python": "", "summary": "Nexus Data writer implemented as a Tango Server", "version": "2.25.1" }, "last_serial": 5958800, "releases": { "2.25.0": [ { "comment_text": "", "digests": { "md5": "bf83549dc3a68a71eb059b7c7083c4b1", "sha256": "f72664b2cca37110c433d5964472420e20a784380b3600583e9d552cb34aa8d6" }, "downloads": -1, "filename": "nxswriter-2.25.0.tar.gz", "has_sig": false, "md5_digest": "bf83549dc3a68a71eb059b7c7083c4b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 75550, "upload_time": "2019-10-10T18:19:45", "url": "https://files.pythonhosted.org/packages/89/28/10dad6ffc06677c5cd4a9f6060ffd9e064e1473e24913fafdb3bea385d1a/nxswriter-2.25.0.tar.gz" } ], "2.25.1": [ { "comment_text": "", "digests": { "md5": "6446140c6ff7c33667cb14e0aff6a579", "sha256": "95a53a6f7798b7ad88f47e114220ee1c5d6e987e5238d60a0ff3028fad09e8e2" }, "downloads": -1, "filename": "nxswriter-2.25.1.tar.gz", "has_sig": false, "md5_digest": "6446140c6ff7c33667cb14e0aff6a579", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 79571, "upload_time": "2019-10-11T07:22:12", "url": "https://files.pythonhosted.org/packages/a2/8e/762b7da2c8b2ad5d63a46b5a5b9b6fb3d46078b0f6ac83db1f91621b41a3/nxswriter-2.25.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6446140c6ff7c33667cb14e0aff6a579", "sha256": "95a53a6f7798b7ad88f47e114220ee1c5d6e987e5238d60a0ff3028fad09e8e2" }, "downloads": -1, "filename": "nxswriter-2.25.1.tar.gz", "has_sig": false, "md5_digest": "6446140c6ff7c33667cb14e0aff6a579", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 79571, "upload_time": "2019-10-11T07:22:12", "url": "https://files.pythonhosted.org/packages/a2/8e/762b7da2c8b2ad5d63a46b5a5b9b6fb3d46078b0f6ac83db1f91621b41a3/nxswriter-2.25.1.tar.gz" } ] }