srsinst.uga


Namesrsinst.uga JSON
Version 0.0.5 PyPI version JSON
download
home_page
SummaryInstrument driver package for Universal Gas Analyzers (UGA) from Stanford Research Systems
upload_time2023-06-15 19:21:30
maintainer
docs_urlNone
authorChulhoon Kim
requires_python>=3.7
licenseMIT license
keywords uga universal gas analyzer srs stanford research systems
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # `srsinst.uga`

`srsinst.uga` contains a Python instrument driver to control and acquire 
mass spectra of atmospheric gas samples from 
[Stanford Research Systems (SRS) Universal Gas Analyzer (UGA)](https://thinksrs.com/products/uga.html).
It also provides a collection of Python scripts that runs on a graphic user interface (GUI) based on
[srsgui](https://thinksrs.github.io/srsgui/) and 
[srsinst.rga](https://thinksrs.github.io/srsinst.rga/). 

![screenshot](https://github.com/thinkSRS/srsinst.uga/blob/main/docs/_static/image/UGA100_composition_analysis_screenshot.png?raw=true " ")

## Installation
You need a working Python version 3.7 or later with `pip` (Python package installer) installed.
If you don't, [install Python 3](https://www.python.org/) to your system.

To install `srsinst.uga` as an instrument driver only, use Python package installer `pip` 
from the command line.

    python -m pip install srsinst.uga

To use its full GUI application, create a virtual environment, if necessary,
and install with *[full]* option:

    # To create a simple virtual environment (Optional)
    python -m venv venv
    venv\scripts\activate

    # To install full GUI application 
    python -m pip install srsinst.uga[full]


## Run `srsinst.uga` as GUI application
If the Python Scripts directory is in PATH environment variable,
Start the application by typing from the command line:

    uga

If not,

    python -m srsinst.uga

It will start the GUI application.

Connect to an UGA from the Instruments menu.
Select a task from the Task menu. The available tasks are to acquire data from UGA
and to run various RGA scans.  Press the green arrow to run the selected task. 

There is a tree view widget displaying commands to adjust interactively. 
It can be accessed from the main menu/Docks/uga-Capture. Double-clicking on a value
can change the command parameter, if allowed.

You can write your own task or modify an existing one and run it from the application
by adding it to a ".taskconfig" configuration file. 


## Use `srsinst.uga` as instrument driver

### Connect to UGA
* Start a Python program, a Jupyter notebook, or an editor of your 
  choice to write a Python script.
* import the **UGA100** class from `srsinst.uga` package.
* Instantiate **UGA100** to connect to an SRS UGA.

|

    C:\>python
    Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.    
    >>>
    >>> from srsinst.uga import UGA100
    >>>
    >>> ip_address = '172.25.128.13'  # Use IP address of your UGA
    >>> user_id = 'srsuga'
    >>> password = 'srsuga'
    >>>
    >>> uga = UGA100('tcpip',ip_address, user_id, password)
    >>>
    >>> # for serial communication
    >>> # Baud rate for UGA100 is available: 28800 and 38400
    >>> # uga2 = UGA100('serial', /dev/ttyUSB0', 28800)  # for Linux serial communication
    >>> # or,
    >>> # uga2 = UGA100('serial', 'COM3', 28800)  # for Windows serial communication
    >>> # or,
    >>> # initialize a RGA100 instance without connection, then connect.
    >>> # uga3 = UGA100()
    >>> # uga3.connect('tcpip', ip_address, user_id, password)

* Query check_id() to configure components of the connected UGA properly,    
  depending on the variation: UGA, UGA_LT, UGA_HT, or UGA_PM.

        uga.check_id()
        > ('SRS_UGA', '94224', '1.018')     
 
**UGA100** comprises multiple subcomponents, their associated commands and class methods.
 **Component** class has a convenience attribute `dir` to show its  available attributes 
 and methods in the Python dictionary format.

    >>> uga.dir.keys()
    dict_keys(['components', 'commands', 'methods'])

**UGA100** has more than 10 components holding their remote commands and methods
to configure and acquire data from a UGA unit.

    >>> uga.dir['components']
    {'mode': 'instance of Mode', 
     'bp': 'instance of BypassPump',
     'rp': 'instance of RoughingPump',
     'tp': 'instance of TurboPump',
     'vv': 'instance of VentValve', 
     'rga': 'instance of RGA', 
     'ig': 'instance of IonGauge', 
     'ht': 'instance of Heaters', 
     'temperature': 'instance of Temperature', 
     'pressure': 'instance of Pressure', 
     'ethernet': 'instance of Ethernet', 
     'status': 'instance of Status'}

### Control UGA100 components
Let's control the ion gauge. It has no subcomponents, two commands, and a method.

    >>> uga.ig.dir
    {'components': {}, 
     'commands': {'state': ('DictCommand', 'ZCIG'), 
                  'filament': ('DictCommand', 'ZPFL')}, 
     'methods': ['get_pressure']}

The *state* commands is to turn on and off the ion gauge, and the *filament* command 
is to select a filament to use.

    >>> uga.ig.filament
    'Fil. 1'
    >>> uga1.ig.state
    'Off'
    >>> uga1.ig.state = 'On'
    >>> uga1.ig.state
    'On'

With get_command_info() method, you can find out what parameter to use to set the command
and what parameters to expect for a query reply. For the uga.ig.state command, you can use
'Off', 'On', or 'Degas' parameters to set the state, and you will get one of 12 possible 
states.

    >>> uga.ig.get_command_info('state')
    {'command class': 'DictCommand', 
     'raw remote command': 'ZCIG', 
     'set_dict': {'Off': 0, 
         'On': 1, 
         'Degas': 2}, 
     'get_dict': {'Off': 0, 
         'On': 1, 
         'Idle': 2, 
         'Turning on (3)': 3, 
         'Turning on (4)': 4, 
         'Turning on (5)': 5, 
         'Turning off (6)': 6, 
         'Turning off (7)': 7, 
         'Turning idle (8)': 8, 
         'Turning idle (9)': 9, 
         'Turning idle (10)': 10, 
         'Error': 12}, 
     'index_dict': None}

When the ion gauge is on, you can get a pressure measurement with the get_pressure() method.

    >>> uga.ig.get_pressure()
    1.115742e-07

Commands in other components can be used in a similar way. 

The most important component in a UGA is the Residual Gas Analyzer, 
which has the separate [RGA instrument driver package](https://github.com/thinkSRS/srsinst.rga)
 for its independent usage.
Refer to [RGA documentation](https://thinksrs.github.io/srsinst.rga/) for RGA component usage.  

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "srsinst.uga",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "UGA,universal gas analyzer,SRS,Stanford Research Systems",
    "author": "Chulhoon Kim",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/0d/f8/365e57a93abe0364a34361e850ca12c075f374e8e2db621fff6116e64ac7/srsinst.uga-0.0.5.tar.gz",
    "platform": null,
    "description": "# `srsinst.uga`\r\n\r\n`srsinst.uga` contains a Python instrument driver to control and acquire \r\nmass spectra of atmospheric gas samples from \r\n[Stanford Research Systems (SRS) Universal Gas Analyzer (UGA)](https://thinksrs.com/products/uga.html).\r\nIt also provides a collection of Python scripts that runs on a graphic user interface (GUI) based on\r\n[srsgui](https://thinksrs.github.io/srsgui/) and \r\n[srsinst.rga](https://thinksrs.github.io/srsinst.rga/). \r\n\r\n![screenshot](https://github.com/thinkSRS/srsinst.uga/blob/main/docs/_static/image/UGA100_composition_analysis_screenshot.png?raw=true \" \")\r\n\r\n## Installation\r\nYou need a working Python version 3.7 or later with `pip` (Python package installer) installed.\r\nIf you don't, [install Python 3](https://www.python.org/) to your system.\r\n\r\nTo install `srsinst.uga` as an instrument driver only, use Python package installer `pip` \r\nfrom the command line.\r\n\r\n    python -m pip install srsinst.uga\r\n\r\nTo use its full GUI application, create a virtual environment, if necessary,\r\nand install with *[full]* option:\r\n\r\n    # To create a simple virtual environment (Optional)\r\n    python -m venv venv\r\n    venv\\scripts\\activate\r\n\r\n    # To install full GUI application \r\n    python -m pip install srsinst.uga[full]\r\n\r\n\r\n## Run `srsinst.uga` as GUI application\r\nIf the Python Scripts directory is in PATH environment variable,\r\nStart the application by typing from the command line:\r\n\r\n    uga\r\n\r\nIf not,\r\n\r\n    python -m srsinst.uga\r\n\r\nIt will start the GUI application.\r\n\r\nConnect to an UGA from the Instruments menu.\r\nSelect a task from the Task menu. The available tasks are to acquire data from UGA\r\nand to run various RGA scans.  Press the green arrow to run the selected task. \r\n\r\nThere is a tree view widget displaying commands to adjust interactively. \r\nIt can be accessed from the main menu/Docks/uga-Capture. Double-clicking on a value\r\ncan change the command parameter, if allowed.\r\n\r\nYou can write your own task or modify an existing one and run it from the application\r\nby adding it to a \".taskconfig\" configuration file. \r\n\r\n\r\n## Use `srsinst.uga` as instrument driver\r\n\r\n### Connect to UGA\r\n* Start a Python program, a Jupyter notebook, or an editor of your \r\n  choice to write a Python script.\r\n* import the **UGA100** class from `srsinst.uga` package.\r\n* Instantiate **UGA100** to connect to an SRS UGA.\r\n\r\n|\r\n\r\n    C:\\>python\r\n    Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)] on win32\r\n    Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.    \r\n    >>>\r\n    >>> from srsinst.uga import UGA100\r\n    >>>\r\n    >>> ip_address = '172.25.128.13'  # Use IP address of your UGA\r\n    >>> user_id = 'srsuga'\r\n    >>> password = 'srsuga'\r\n    >>>\r\n    >>> uga = UGA100('tcpip',ip_address, user_id, password)\r\n    >>>\r\n    >>> # for serial communication\r\n    >>> # Baud rate for UGA100 is available: 28800 and 38400\r\n    >>> # uga2 = UGA100('serial', /dev/ttyUSB0', 28800)  # for Linux serial communication\r\n    >>> # or,\r\n    >>> # uga2 = UGA100('serial', 'COM3', 28800)  # for Windows serial communication\r\n    >>> # or,\r\n    >>> # initialize a RGA100 instance without connection, then connect.\r\n    >>> # uga3 = UGA100()\r\n    >>> # uga3.connect('tcpip', ip_address, user_id, password)\r\n\r\n* Query check_id() to configure components of the connected UGA properly,    \r\n  depending on the variation: UGA, UGA_LT, UGA_HT, or UGA_PM.\r\n\r\n        uga.check_id()\r\n        > ('SRS_UGA', '94224', '1.018')     \r\n \r\n**UGA100** comprises multiple subcomponents, their associated commands and class methods.\r\n **Component** class has a convenience attribute `dir` to show its  available attributes \r\n and methods in the Python dictionary format.\r\n\r\n    >>> uga.dir.keys()\r\n    dict_keys(['components', 'commands', 'methods'])\r\n\r\n**UGA100** has more than 10 components holding their remote commands and methods\r\nto configure and acquire data from a UGA unit.\r\n\r\n    >>> uga.dir['components']\r\n    {'mode': 'instance of Mode', \r\n     'bp': 'instance of BypassPump',\r\n     'rp': 'instance of RoughingPump',\r\n     'tp': 'instance of TurboPump',\r\n     'vv': 'instance of VentValve', \r\n     'rga': 'instance of RGA', \r\n     'ig': 'instance of IonGauge', \r\n     'ht': 'instance of Heaters', \r\n     'temperature': 'instance of Temperature', \r\n     'pressure': 'instance of Pressure', \r\n     'ethernet': 'instance of Ethernet', \r\n     'status': 'instance of Status'}\r\n\r\n### Control UGA100 components\r\nLet's control the ion gauge. It has no subcomponents, two commands, and a method.\r\n\r\n    >>> uga.ig.dir\r\n    {'components': {}, \r\n     'commands': {'state': ('DictCommand', 'ZCIG'), \r\n                  'filament': ('DictCommand', 'ZPFL')}, \r\n     'methods': ['get_pressure']}\r\n\r\nThe *state* commands is to turn on and off the ion gauge, and the *filament* command \r\nis to select a filament to use.\r\n\r\n    >>> uga.ig.filament\r\n    'Fil. 1'\r\n    >>> uga1.ig.state\r\n    'Off'\r\n    >>> uga1.ig.state = 'On'\r\n    >>> uga1.ig.state\r\n    'On'\r\n\r\nWith get_command_info() method, you can find out what parameter to use to set the command\r\nand what parameters to expect for a query reply. For the uga.ig.state command, you can use\r\n'Off', 'On', or 'Degas' parameters to set the state, and you will get one of 12 possible \r\nstates.\r\n\r\n    >>> uga.ig.get_command_info('state')\r\n    {'command class': 'DictCommand', \r\n     'raw remote command': 'ZCIG', \r\n     'set_dict': {'Off': 0, \r\n         'On': 1, \r\n         'Degas': 2}, \r\n     'get_dict': {'Off': 0, \r\n         'On': 1, \r\n         'Idle': 2, \r\n         'Turning on (3)': 3, \r\n         'Turning on (4)': 4, \r\n         'Turning on (5)': 5, \r\n         'Turning off (6)': 6, \r\n         'Turning off (7)': 7, \r\n         'Turning idle (8)': 8, \r\n         'Turning idle (9)': 9, \r\n         'Turning idle (10)': 10, \r\n         'Error': 12}, \r\n     'index_dict': None}\r\n\r\nWhen the ion gauge is on, you can get a pressure measurement with the get_pressure() method.\r\n\r\n    >>> uga.ig.get_pressure()\r\n    1.115742e-07\r\n\r\nCommands in other components can be used in a similar way. \r\n\r\nThe most important component in a UGA is the Residual Gas Analyzer, \r\nwhich has the separate [RGA instrument driver package](https://github.com/thinkSRS/srsinst.rga)\r\n for its independent usage.\r\nRefer to [RGA documentation](https://thinksrs.github.io/srsinst.rga/) for RGA component usage.  \r\n",
    "bugtrack_url": null,
    "license": "MIT license",
    "summary": "Instrument driver package for Universal Gas Analyzers (UGA) from Stanford Research Systems",
    "version": "0.0.5",
    "project_urls": {
        "homepage": "https://github.com/thinkSRS/srsinst.uga",
        "repository": "https://github.com/thinkSRS/srsinst.uga.git"
    },
    "split_keywords": [
        "uga",
        "universal gas analyzer",
        "srs",
        "stanford research systems"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d7d363b461ad9682bbf26ed6adc928e02a6f955caf7d1dbc550ecef0f152cde6",
                "md5": "4548e4a194518ff886f58b408f95892a",
                "sha256": "f0231d6feff2ff72bfa2b2646ee2619f284c74493647aa6b3e8968883c7f8e89"
            },
            "downloads": -1,
            "filename": "srsinst.uga-0.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4548e4a194518ff886f58b408f95892a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 21709,
            "upload_time": "2023-06-15T19:21:28",
            "upload_time_iso_8601": "2023-06-15T19:21:28.588894Z",
            "url": "https://files.pythonhosted.org/packages/d7/d3/63b461ad9682bbf26ed6adc928e02a6f955caf7d1dbc550ecef0f152cde6/srsinst.uga-0.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0df8365e57a93abe0364a34361e850ca12c075f374e8e2db621fff6116e64ac7",
                "md5": "80081c62c13edbd4c2836c351d853f6d",
                "sha256": "f2c762fc53ebbefa6441da3c55f08c5006ecef309a51302940ae04a9155f1123"
            },
            "downloads": -1,
            "filename": "srsinst.uga-0.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "80081c62c13edbd4c2836c351d853f6d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 193847,
            "upload_time": "2023-06-15T19:21:30",
            "upload_time_iso_8601": "2023-06-15T19:21:30.230128Z",
            "url": "https://files.pythonhosted.org/packages/0d/f8/365e57a93abe0364a34361e850ca12c075f374e8e2db621fff6116e64ac7/srsinst.uga-0.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-15 19:21:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "thinkSRS",
    "github_project": "srsinst.uga",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "srsinst.uga"
}
        
Elapsed time: 0.08073s