nbs-bl 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nbs_bl-0.2.0/.github/workflows/python-publish.yml +70 -0
- nbs_bl-0.2.0/.gitignore +82 -0
- nbs_bl-0.2.0/.readthedocs.yaml +13 -0
- nbs_bl-0.2.0/LICENSE +13 -0
- nbs_bl-0.2.0/PKG-INFO +71 -0
- nbs_bl-0.2.0/README.md +46 -0
- nbs_bl-0.2.0/docs/conf.py +41 -0
- nbs_bl-0.2.0/docs/configuration_reference.md +210 -0
- nbs_bl-0.2.0/docs/getting_started.md +163 -0
- nbs_bl-0.2.0/docs/index.rst +47 -0
- nbs_bl-0.2.0/docs/overview.md +129 -0
- nbs_bl-0.2.0/docs/requirements.txt +4 -0
- nbs_bl-0.2.0/docs/template_beamline.toml +39 -0
- nbs_bl-0.2.0/docs/template_devices.toml +50 -0
- nbs_bl-0.2.0/pyproject.toml +52 -0
- nbs_bl-0.2.0/src/nbs_bl/__init__.py +15 -0
- nbs_bl-0.2.0/src/nbs_bl/beamline.py +450 -0
- nbs_bl-0.2.0/src/nbs_bl/configuration.py +838 -0
- nbs_bl-0.2.0/src/nbs_bl/detectors.py +89 -0
- nbs_bl-0.2.0/src/nbs_bl/devices/__init__.py +12 -0
- nbs_bl-0.2.0/src/nbs_bl/devices/detectors.py +154 -0
- nbs_bl-0.2.0/src/nbs_bl/devices/motors.py +242 -0
- nbs_bl-0.2.0/src/nbs_bl/devices/sampleholders.py +360 -0
- nbs_bl-0.2.0/src/nbs_bl/devices/shutters.py +120 -0
- nbs_bl-0.2.0/src/nbs_bl/devices/slits.py +51 -0
- nbs_bl-0.2.0/src/nbs_bl/gGrEqns.py +171 -0
- nbs_bl-0.2.0/src/nbs_bl/geometry/__init__.py +0 -0
- nbs_bl-0.2.0/src/nbs_bl/geometry/affine.py +197 -0
- nbs_bl-0.2.0/src/nbs_bl/geometry/bars.py +189 -0
- nbs_bl-0.2.0/src/nbs_bl/geometry/frames.py +534 -0
- nbs_bl-0.2.0/src/nbs_bl/geometry/linalg.py +138 -0
- nbs_bl-0.2.0/src/nbs_bl/geometry/polygons.py +56 -0
- nbs_bl-0.2.0/src/nbs_bl/help.py +126 -0
- nbs_bl-0.2.0/src/nbs_bl/hw.py +270 -0
- nbs_bl-0.2.0/src/nbs_bl/load.py +113 -0
- nbs_bl-0.2.0/src/nbs_bl/motors.py +19 -0
- nbs_bl-0.2.0/src/nbs_bl/planStatus.py +5 -0
- nbs_bl-0.2.0/src/nbs_bl/plans/__init__.py +8 -0
- nbs_bl-0.2.0/src/nbs_bl/plans/batches.py +174 -0
- nbs_bl-0.2.0/src/nbs_bl/plans/conditions.py +77 -0
- nbs_bl-0.2.0/src/nbs_bl/plans/flyscan_base.py +180 -0
- nbs_bl-0.2.0/src/nbs_bl/plans/groups.py +55 -0
- nbs_bl-0.2.0/src/nbs_bl/plans/maximizers.py +423 -0
- nbs_bl-0.2.0/src/nbs_bl/plans/metaplans.py +179 -0
- nbs_bl-0.2.0/src/nbs_bl/plans/plan_stubs.py +246 -0
- nbs_bl-0.2.0/src/nbs_bl/plans/preprocessors.py +160 -0
- nbs_bl-0.2.0/src/nbs_bl/plans/scan_base.py +58 -0
- nbs_bl-0.2.0/src/nbs_bl/plans/scan_decorators.py +524 -0
- nbs_bl-0.2.0/src/nbs_bl/plans/scans.py +145 -0
- nbs_bl-0.2.0/src/nbs_bl/plans/suspenders.py +87 -0
- nbs_bl-0.2.0/src/nbs_bl/plans/time_estimation.py +168 -0
- nbs_bl-0.2.0/src/nbs_bl/plans/xas.py +123 -0
- nbs_bl-0.2.0/src/nbs_bl/printing.py +221 -0
- nbs_bl-0.2.0/src/nbs_bl/qt/models/beamline.py +11 -0
- nbs_bl-0.2.0/src/nbs_bl/qt/models/energy.py +53 -0
- nbs_bl-0.2.0/src/nbs_bl/qt/widgets/energy.py +225 -0
- nbs_bl-0.2.0/src/nbs_bl/queueserver.py +249 -0
- nbs_bl-0.2.0/src/nbs_bl/redisDevice.py +96 -0
- nbs_bl-0.2.0/src/nbs_bl/run_engine.py +63 -0
- nbs_bl-0.2.0/src/nbs_bl/samples.py +130 -0
- nbs_bl-0.2.0/src/nbs_bl/settings.py +68 -0
- nbs_bl-0.2.0/src/nbs_bl/shutters.py +39 -0
- nbs_bl-0.2.0/src/nbs_bl/sim/__init__.py +2 -0
- nbs_bl-0.2.0/src/nbs_bl/sim/config/polphase.nc +0 -0
- nbs_bl-0.2.0/src/nbs_bl/sim/energy.py +403 -0
- nbs_bl-0.2.0/src/nbs_bl/sim/manipulator.py +14 -0
- nbs_bl-0.2.0/src/nbs_bl/sim/utils.py +36 -0
- nbs_bl-0.2.0/src/nbs_bl/startup.py +27 -0
- nbs_bl-0.2.0/src/nbs_bl/status.py +114 -0
- nbs_bl-0.2.0/src/nbs_bl/tests/__init__.py +0 -0
- nbs_bl-0.2.0/src/nbs_bl/tests/modify_regions.py +160 -0
- nbs_bl-0.2.0/src/nbs_bl/tests/test_frames.py +99 -0
- nbs_bl-0.2.0/src/nbs_bl/tests/test_panels.py +69 -0
- nbs_bl-0.2.0/src/nbs_bl/utils.py +235 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# This workflow will upload a Python Package to PyPI when a release is created
|
|
2
|
+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
|
|
3
|
+
|
|
4
|
+
# This workflow uses actions that are not certified by GitHub.
|
|
5
|
+
# They are provided by a third-party and are governed by
|
|
6
|
+
# separate terms of service, privacy policy, and support
|
|
7
|
+
# documentation.
|
|
8
|
+
|
|
9
|
+
name: Upload Python Package
|
|
10
|
+
|
|
11
|
+
on:
|
|
12
|
+
release:
|
|
13
|
+
types: [published]
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
release-build:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v4
|
|
24
|
+
|
|
25
|
+
- uses: actions/setup-python@v5
|
|
26
|
+
with:
|
|
27
|
+
python-version: "3.x"
|
|
28
|
+
|
|
29
|
+
- name: Build release distributions
|
|
30
|
+
run: |
|
|
31
|
+
# NOTE: put your own distribution build steps here.
|
|
32
|
+
python -m pip install build
|
|
33
|
+
python -m build
|
|
34
|
+
|
|
35
|
+
- name: Upload distributions
|
|
36
|
+
uses: actions/upload-artifact@v4
|
|
37
|
+
with:
|
|
38
|
+
name: release-dists
|
|
39
|
+
path: dist/
|
|
40
|
+
|
|
41
|
+
pypi-publish:
|
|
42
|
+
runs-on: ubuntu-latest
|
|
43
|
+
needs:
|
|
44
|
+
- release-build
|
|
45
|
+
permissions:
|
|
46
|
+
# IMPORTANT: this permission is mandatory for trusted publishing
|
|
47
|
+
id-token: write
|
|
48
|
+
|
|
49
|
+
# Dedicated environments with protections for publishing are strongly recommended.
|
|
50
|
+
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
|
|
51
|
+
environment:
|
|
52
|
+
name: pypi
|
|
53
|
+
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
|
|
54
|
+
url: https://pypi.org/p/nbs-bl
|
|
55
|
+
#
|
|
56
|
+
# ALTERNATIVE: if your GitHub Release name is the PyPI project version string
|
|
57
|
+
# ALTERNATIVE: exactly, uncomment the following line instead:
|
|
58
|
+
# url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
|
|
59
|
+
|
|
60
|
+
steps:
|
|
61
|
+
- name: Retrieve release distributions
|
|
62
|
+
uses: actions/download-artifact@v4
|
|
63
|
+
with:
|
|
64
|
+
name: release-dists
|
|
65
|
+
path: dist/
|
|
66
|
+
|
|
67
|
+
- name: Publish release distributions to PyPI
|
|
68
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
69
|
+
with:
|
|
70
|
+
packages-dir: dist/
|
nbs_bl-0.2.0/.gitignore
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
env/
|
|
12
|
+
build/
|
|
13
|
+
develop-eggs/
|
|
14
|
+
dist/
|
|
15
|
+
downloads/
|
|
16
|
+
eggs/
|
|
17
|
+
.eggs/
|
|
18
|
+
lib/
|
|
19
|
+
lib64/
|
|
20
|
+
parts/
|
|
21
|
+
sdist/
|
|
22
|
+
var/
|
|
23
|
+
venv/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
|
|
28
|
+
# PyInstaller
|
|
29
|
+
# Usually these files are written by a python script from a template
|
|
30
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
31
|
+
*.manifest
|
|
32
|
+
*.spec
|
|
33
|
+
|
|
34
|
+
# Installer logs
|
|
35
|
+
pip-log.txt
|
|
36
|
+
pip-delete-this-directory.txt
|
|
37
|
+
|
|
38
|
+
# Unit test / coverage reports
|
|
39
|
+
htmlcov/
|
|
40
|
+
.tox/
|
|
41
|
+
.coverage
|
|
42
|
+
.coverage.*
|
|
43
|
+
.cache
|
|
44
|
+
nosetests.xml
|
|
45
|
+
coverage.xml
|
|
46
|
+
*,cover
|
|
47
|
+
.hypothesis/
|
|
48
|
+
|
|
49
|
+
# Translations
|
|
50
|
+
*.mo
|
|
51
|
+
*.pot
|
|
52
|
+
|
|
53
|
+
# Django stuff:
|
|
54
|
+
*.log
|
|
55
|
+
|
|
56
|
+
# Sphinx documentation
|
|
57
|
+
docs/build/
|
|
58
|
+
docs/source/generated/
|
|
59
|
+
|
|
60
|
+
# pytest
|
|
61
|
+
.pytest_cache/
|
|
62
|
+
|
|
63
|
+
# PyBuilder
|
|
64
|
+
target/
|
|
65
|
+
|
|
66
|
+
# Editor files
|
|
67
|
+
#mac
|
|
68
|
+
.DS_Store
|
|
69
|
+
*~
|
|
70
|
+
|
|
71
|
+
#vim
|
|
72
|
+
*.swp
|
|
73
|
+
*.swo
|
|
74
|
+
|
|
75
|
+
#pycharm
|
|
76
|
+
.idea/
|
|
77
|
+
|
|
78
|
+
#VSCode
|
|
79
|
+
.vscode/
|
|
80
|
+
|
|
81
|
+
#Ipython Notebook
|
|
82
|
+
.ipynb_checkpoints
|
nbs_bl-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
NIST Software Licensing Statement
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
NIST-developed software is provided by NIST as a public service. You may use, copy, and distribute copies of the software in any medium, provided that you keep intact this entire notice. You may improve, modify, and create derivative works of the software or any portion of the software, and you may copy and distribute such modifications or works. Modified works should carry a notice stating that you changed the software and should note the date and nature of any such change. Please explicitly acknowledge the National Institute of Standards and Technology as the source of the software.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
NIST-developed software is expressly provided "AS IS." NIST MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED, IN FACT, OR ARISING BY OPERATION OF LAW, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND DATA ACCURACY. NIST NEITHER REPRESENTS NOR WARRANTS THAT THE OPERATION OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT ANY DEFECTS WILL BE CORRECTED. NIST DOES NOT WARRANT OR MAKE ANY REPRESENTATIONS REGARDING THE USE OF THE SOFTWARE OR THE RESULTS THEREOF, INCLUDING BUT NOT LIMITED TO THE CORRECTNESS, ACCURACY, RELIABILITY, OR USEFULNESS OF THE SOFTWARE.
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
You are solely responsible for determining the appropriateness of using and distributing the software and you assume all risks associated with its use, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and the unavailability or interruption of operation. This software is not intended to be used in any situation where a failure could cause risk of injury or damage to property. The software developed by NIST employees is not subject to copyright protection within the United States.
|
nbs_bl-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: nbs-bl
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: NBS Beamline Framework
|
|
5
|
+
Project-URL: homepage, https://github.com/xraygui/nbs-bl
|
|
6
|
+
Author-email: Charles Titus <ctitus@bnl.gov>
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Keywords: beamline,bluesky,nsls-ii
|
|
9
|
+
Classifier: Intended Audience :: Science/Research
|
|
10
|
+
Classifier: License :: Public Domain
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Requires-Python: >=3.9
|
|
14
|
+
Requires-Dist: bluesky
|
|
15
|
+
Requires-Dist: bluesky-queueserver
|
|
16
|
+
Requires-Dist: databroker>=2.0.0b67
|
|
17
|
+
Requires-Dist: ipython
|
|
18
|
+
Requires-Dist: nbs-core>=0.1
|
|
19
|
+
Requires-Dist: numpy
|
|
20
|
+
Requires-Dist: numpydoc
|
|
21
|
+
Requires-Dist: ophyd
|
|
22
|
+
Requires-Dist: redis-json-dict
|
|
23
|
+
Requires-Dist: tomli; python_version < '3.11'
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
26
|
+
# NSLS-II Beamline Support Library
|
|
27
|
+
|
|
28
|
+
A Python library for beamline operation and control at NSLS-II, providing configuration management, device control, and scan plans.
|
|
29
|
+
|
|
30
|
+
## Features
|
|
31
|
+
|
|
32
|
+
- TOML-based beamline configuration system
|
|
33
|
+
- Device control and monitoring
|
|
34
|
+
- Scan plans and utilities
|
|
35
|
+
- Simulation capabilities for offline testing
|
|
36
|
+
- Integration with Bluesky/Ophyd ecosystem
|
|
37
|
+
|
|
38
|
+
## Installation
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Clone the repository
|
|
42
|
+
git clone https://github.com/xraygui/nbs-bl.git
|
|
43
|
+
cd nbs-bl
|
|
44
|
+
|
|
45
|
+
# Install in development mode
|
|
46
|
+
pip install -e .
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Dependencies
|
|
50
|
+
|
|
51
|
+
- Python 3.8+
|
|
52
|
+
- Bluesky
|
|
53
|
+
- Ophyd
|
|
54
|
+
- NumPy
|
|
55
|
+
- nbs-core
|
|
56
|
+
|
|
57
|
+
## Documentation
|
|
58
|
+
|
|
59
|
+
Documentation is available at [https://nbs-bl.readthedocs.io](https://nbs-bl.readthedocs.io)
|
|
60
|
+
|
|
61
|
+
## Configuration
|
|
62
|
+
|
|
63
|
+
The library uses TOML configuration files to define beamline devices and settings:
|
|
64
|
+
- `beamline.toml`: General beamline configuration
|
|
65
|
+
- `devices.toml`: Device-specific configuration
|
|
66
|
+
|
|
67
|
+
See the [configuration reference](https://nbs-bl.readthedocs.io/configuration_reference.html) for detailed documentation.
|
|
68
|
+
|
|
69
|
+
## License
|
|
70
|
+
|
|
71
|
+
This project is licensed under the BSD 3-Clause License - see the [LICENSE](LICENSE) file for details.
|
nbs_bl-0.2.0/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# NSLS-II Beamline Support Library
|
|
2
|
+
|
|
3
|
+
A Python library for beamline operation and control at NSLS-II, providing configuration management, device control, and scan plans.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- TOML-based beamline configuration system
|
|
8
|
+
- Device control and monitoring
|
|
9
|
+
- Scan plans and utilities
|
|
10
|
+
- Simulation capabilities for offline testing
|
|
11
|
+
- Integration with Bluesky/Ophyd ecosystem
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Clone the repository
|
|
17
|
+
git clone https://github.com/xraygui/nbs-bl.git
|
|
18
|
+
cd nbs-bl
|
|
19
|
+
|
|
20
|
+
# Install in development mode
|
|
21
|
+
pip install -e .
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Dependencies
|
|
25
|
+
|
|
26
|
+
- Python 3.8+
|
|
27
|
+
- Bluesky
|
|
28
|
+
- Ophyd
|
|
29
|
+
- NumPy
|
|
30
|
+
- nbs-core
|
|
31
|
+
|
|
32
|
+
## Documentation
|
|
33
|
+
|
|
34
|
+
Documentation is available at [https://nbs-bl.readthedocs.io](https://nbs-bl.readthedocs.io)
|
|
35
|
+
|
|
36
|
+
## Configuration
|
|
37
|
+
|
|
38
|
+
The library uses TOML configuration files to define beamline devices and settings:
|
|
39
|
+
- `beamline.toml`: General beamline configuration
|
|
40
|
+
- `devices.toml`: Device-specific configuration
|
|
41
|
+
|
|
42
|
+
See the [configuration reference](https://nbs-bl.readthedocs.io/configuration_reference.html) for detailed documentation.
|
|
43
|
+
|
|
44
|
+
## License
|
|
45
|
+
|
|
46
|
+
This project is licensed under the BSD 3-Clause License - see the [LICENSE](LICENSE) file for details.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"""Sphinx configuration for nbs-bl documentation."""
|
|
2
|
+
|
|
3
|
+
project = "NBS-BL"
|
|
4
|
+
copyright = "2024, NSLS-II"
|
|
5
|
+
author = "NSLS-II"
|
|
6
|
+
|
|
7
|
+
extensions = [
|
|
8
|
+
"sphinx.ext.autodoc",
|
|
9
|
+
"sphinx.ext.napoleon",
|
|
10
|
+
"sphinx.ext.viewcode",
|
|
11
|
+
"sphinx.ext.intersphinx",
|
|
12
|
+
"sphinx_rtd_theme",
|
|
13
|
+
"myst_parser", # For markdown support
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
templates_path = ["_templates"]
|
|
17
|
+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
|
|
18
|
+
|
|
19
|
+
# HTML output options
|
|
20
|
+
html_theme = "sphinx_rtd_theme"
|
|
21
|
+
html_static_path = ["_static"]
|
|
22
|
+
|
|
23
|
+
# Intersphinx mapping
|
|
24
|
+
intersphinx_mapping = {
|
|
25
|
+
"python": ("https://docs.python.org/3", None),
|
|
26
|
+
"numpy": ("https://numpy.org/doc/stable/", None),
|
|
27
|
+
"ophyd": ("https://blueskyproject.io/ophyd/", None),
|
|
28
|
+
"bluesky": ("https://blueskyproject.io/bluesky/", None),
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
# Napoleon settings
|
|
32
|
+
napoleon_google_docstring = False
|
|
33
|
+
napoleon_numpy_docstring = True
|
|
34
|
+
napoleon_include_init_with_doc = True
|
|
35
|
+
napoleon_include_private_with_doc = True
|
|
36
|
+
|
|
37
|
+
# MyST settings
|
|
38
|
+
myst_enable_extensions = [
|
|
39
|
+
"colon_fence",
|
|
40
|
+
"deflist",
|
|
41
|
+
]
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# Beamline Configuration Reference
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
The beamline configuration system uses TOML files to define the hardware, settings, and behavior of a beamline. The configuration is split into two main files:
|
|
5
|
+
- `beamline.toml`: Core beamline settings and capabilities
|
|
6
|
+
- `devices.toml`: Hardware device definitions and properties
|
|
7
|
+
|
|
8
|
+
## beamline.toml Reference
|
|
9
|
+
|
|
10
|
+
### Configuration Section
|
|
11
|
+
```toml
|
|
12
|
+
[configuration]
|
|
13
|
+
# List of groups that should be automatically added to baseline readings
|
|
14
|
+
baseline = ["motors", "vacuum", "shutters"]
|
|
15
|
+
|
|
16
|
+
# Core beamline capabilities
|
|
17
|
+
has_slits = true # Whether beamline has slit devices
|
|
18
|
+
has_motorized_samples = true # Whether beamline has motorized sample stages
|
|
19
|
+
has_motorized_eref = false # Whether beamline has motorized energy reference
|
|
20
|
+
has_polarization = false # Whether beamline has polarization control
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Detector Sets
|
|
24
|
+
Define groups of detectors that are commonly used together.
|
|
25
|
+
```toml
|
|
26
|
+
[detector_sets.default]
|
|
27
|
+
primary = "main_detector" # Primary detector for measurements
|
|
28
|
+
normalization = "i0" # Detector used for normalization
|
|
29
|
+
reference = "ir" # Reference detector
|
|
30
|
+
|
|
31
|
+
[detector_sets.transmission]
|
|
32
|
+
primary = "it"
|
|
33
|
+
normalization = "i0"
|
|
34
|
+
reference = "ir"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Settings
|
|
38
|
+
General beamline settings and module configuration.
|
|
39
|
+
```toml
|
|
40
|
+
[settings]
|
|
41
|
+
# Python modules to load at startup
|
|
42
|
+
# nbs_bl provides a default, but you should
|
|
43
|
+
# define your own in your beamline's code package
|
|
44
|
+
modules = ["nbs_bl.startup"]
|
|
45
|
+
|
|
46
|
+
# Plan load files, located in the ipython startup directory
|
|
47
|
+
# Keys should correspond to entrypoints in the beamline's code package
|
|
48
|
+
[settings.plans]
|
|
49
|
+
xas = ["xas.toml"]
|
|
50
|
+
xps = ["xps.toml"]
|
|
51
|
+
|
|
52
|
+
# Redis configuration for RE.md
|
|
53
|
+
[settings.redis.md]
|
|
54
|
+
host = "redis"
|
|
55
|
+
prefix = "beamline_name"
|
|
56
|
+
|
|
57
|
+
# Redis configuration for other metadata to share with QueueServer
|
|
58
|
+
[settings.redis.info]
|
|
59
|
+
host = "redisInfo"
|
|
60
|
+
prefix = ""
|
|
61
|
+
port = 60737
|
|
62
|
+
db = 1
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## devices.toml Reference
|
|
66
|
+
|
|
67
|
+
### Device Configuration Format
|
|
68
|
+
Each device entry follows this general structure:
|
|
69
|
+
```toml
|
|
70
|
+
[device_name]
|
|
71
|
+
# Required fields
|
|
72
|
+
_target = "package.module.DeviceClass" # Python class to instantiate
|
|
73
|
+
name = "human_readable_name" # Display name
|
|
74
|
+
prefix = "PV:PREFIX:" # EPICS PV prefix
|
|
75
|
+
|
|
76
|
+
# Optional fields
|
|
77
|
+
_defer_loading = false # Whether to defer device loading
|
|
78
|
+
_add_to_ns = true # Add to IPython namespace
|
|
79
|
+
_load_order = 1 # Load order, if device must be loaded after others
|
|
80
|
+
_baseline = true # Override for group baseline setting
|
|
81
|
+
description = "Device description" # Human-readable description
|
|
82
|
+
|
|
83
|
+
# Group membership
|
|
84
|
+
_group = "group_name" # Device groups
|
|
85
|
+
_role = "role_name" # Device roles
|
|
86
|
+
|
|
87
|
+
# Device-specific parameters
|
|
88
|
+
param1 = value1
|
|
89
|
+
param2 = value2
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Common Device Types
|
|
93
|
+
|
|
94
|
+
#### Motors
|
|
95
|
+
```toml
|
|
96
|
+
[sample_x]
|
|
97
|
+
_target = "nbs_bl.devices.motors.DeadbandEpicsMotor"
|
|
98
|
+
_group = "motors"
|
|
99
|
+
name = "Sample X"
|
|
100
|
+
prefix = "MOTOR:X:"
|
|
101
|
+
tolerance = 0.1
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
#### Detectors
|
|
105
|
+
```toml
|
|
106
|
+
[main_detector]
|
|
107
|
+
_target = "nbs_bl.devices.detectors.ophScalar"
|
|
108
|
+
_group = "detectors"
|
|
109
|
+
name = "Main Detector"
|
|
110
|
+
prefix = "DET:MAIN:"
|
|
111
|
+
description = "Main measurement detector"
|
|
112
|
+
rescale = 1.0
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
#### Sample Holders
|
|
116
|
+
```toml
|
|
117
|
+
[sample_holder]
|
|
118
|
+
_target = "nbs_bl.devices.sampleholders.Manipulator4AxBase"
|
|
119
|
+
name = "Sample Manipulator"
|
|
120
|
+
prefix = "MANIP:"
|
|
121
|
+
_group = "manipulators"
|
|
122
|
+
_role = "primary_sampleholder"
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
#### Shutters
|
|
126
|
+
```toml
|
|
127
|
+
[photon_shutter]
|
|
128
|
+
_target = "nbs_bl.devices.shutters.EPS_Shutter"
|
|
129
|
+
name = "Photon Shutter"
|
|
130
|
+
prefix = "PS:"
|
|
131
|
+
_group = "shutters"
|
|
132
|
+
openval = 1
|
|
133
|
+
closeval = 0
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Best Practices
|
|
137
|
+
|
|
138
|
+
### Device Organization
|
|
139
|
+
1. Group related devices together in the configuration
|
|
140
|
+
2. Use consistent naming conventions:
|
|
141
|
+
- Lowercase with underscores for device keys
|
|
142
|
+
- Descriptive human-readable names
|
|
143
|
+
- Clear, consistent PV prefixes
|
|
144
|
+
3. Document special requirements or dependencies
|
|
145
|
+
|
|
146
|
+
### Deferred Loading
|
|
147
|
+
Use `_defer_loading = true` for devices that:
|
|
148
|
+
- Are not always available
|
|
149
|
+
- Have long initialization times
|
|
150
|
+
- Are only needed for specific operations
|
|
151
|
+
- May conflict with other devices
|
|
152
|
+
|
|
153
|
+
Use `_load_order` to control devices which:
|
|
154
|
+
- have dependencies on other devices
|
|
155
|
+
|
|
156
|
+
### Device Groups
|
|
157
|
+
Standard group names include:
|
|
158
|
+
- `motors`: All motor devices
|
|
159
|
+
- `detectors`: All detector devices
|
|
160
|
+
- `shutters`: Beam and safety shutters
|
|
161
|
+
- `gauges`: Vacuum gauges
|
|
162
|
+
- `manipulators`: Sample manipulation devices
|
|
163
|
+
- `mirrors`: Beamline optics
|
|
164
|
+
- `slits`: Beam-defining slits
|
|
165
|
+
|
|
166
|
+
### Device Roles
|
|
167
|
+
Common roles include:
|
|
168
|
+
- `beam_current`: Storage ring current measurement
|
|
169
|
+
- `beam_status`: Beam availability status
|
|
170
|
+
- `default_shutter`: Primary photon shutter
|
|
171
|
+
- `energy`: Monochromator or energy setting device
|
|
172
|
+
- `intensity_detector`: Primary intensity measurement
|
|
173
|
+
- `primary_sampleholder`: Main sample manipulation stage
|
|
174
|
+
- `reference_sampleholder`: Reference sample stage
|
|
175
|
+
- `slits`: Primary beam-defining slits
|
|
176
|
+
|
|
177
|
+
### Redis Configuration
|
|
178
|
+
1. Use separate configurations for metadata and info
|
|
179
|
+
2. Choose meaningful prefixes to avoid conflicts
|
|
180
|
+
3. Document required Redis setup and connectivity
|
|
181
|
+
|
|
182
|
+
## Configuration Validation
|
|
183
|
+
Before deploying a new configuration:
|
|
184
|
+
1. Verify all required fields are present
|
|
185
|
+
2. Check PV connectivity
|
|
186
|
+
3. Test device initialization
|
|
187
|
+
4. Validate group and role assignments
|
|
188
|
+
5. Ensure Redis connectivity
|
|
189
|
+
6. Test deferred loading behavior
|
|
190
|
+
|
|
191
|
+
## Common Issues and Solutions
|
|
192
|
+
|
|
193
|
+
### Device Loading Failures
|
|
194
|
+
- Verify PV prefix is correct
|
|
195
|
+
- Check EPICS IOC is running
|
|
196
|
+
- Ensure network connectivity
|
|
197
|
+
- Verify required dependencies are installed
|
|
198
|
+
|
|
199
|
+
### Redis Connectivity
|
|
200
|
+
- Check Redis server is running
|
|
201
|
+
- Verify port and host settings
|
|
202
|
+
- Ensure network allows Redis connections
|
|
203
|
+
- Check database permissions
|
|
204
|
+
|
|
205
|
+
### Group and Role Conflicts
|
|
206
|
+
- Verify no duplicate role assignments
|
|
207
|
+
- Check group membership logic
|
|
208
|
+
- Validate device compatibility
|
|
209
|
+
- Test interaction between grouped devices
|
|
210
|
+
```
|