newportxps 0.2__tar.gz → 0.9__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.
- newportxps-0.9/.gitignore +16 -0
- newportxps-0.9/LICENSE +25 -0
- newportxps-0.9/PKG-INFO +123 -0
- newportxps-0.9/examples/stages_XPSC.ini +1799 -0
- newportxps-0.9/examples/stages_XPSD.ini +514 -0
- newportxps-0.9/examples/system_exA.ini +99 -0
- newportxps-0.9/examples/system_exB.ini +65 -0
- newportxps-0.9/examples/system_exC.ini +67 -0
- newportxps-0.9/examples/system_exD.ini +59 -0
- {newportxps-0.2 → newportxps-0.9}/newportxps/XPS_C8_drivers.py +310 -881
- newportxps-0.9/newportxps/__init__.py +3 -0
- newportxps-0.9/newportxps/debugtimer.py +107 -0
- {newportxps-0.2 → newportxps-0.9}/newportxps/ftp_wrapper.py +21 -19
- {newportxps-0.2 → newportxps-0.9}/newportxps/newportxps.py +458 -169
- newportxps-0.9/newportxps/utils.py +33 -0
- newportxps-0.9/newportxps/version.py +16 -0
- newportxps-0.9/newportxps.egg-info/PKG-INFO +123 -0
- {newportxps-0.2 → newportxps-0.9}/newportxps.egg-info/SOURCES.txt +11 -0
- {newportxps-0.2 → newportxps-0.9}/newportxps.egg-info/requires.txt +1 -0
- newportxps-0.9/pyproject.toml +55 -0
- newportxps-0.9/setup.py +6 -0
- newportxps-0.2/PKG-INFO +0 -10
- newportxps-0.2/newportxps/__init__.py +0 -1
- newportxps-0.2/newportxps/utils.py +0 -22
- newportxps-0.2/newportxps.egg-info/PKG-INFO +0 -10
- newportxps-0.2/setup.py +0 -13
- {newportxps-0.2 → newportxps-0.9}/README.md +0 -0
- {newportxps-0.2 → newportxps-0.9}/newportxps/debugtime.py +0 -0
- {newportxps-0.2 → newportxps-0.9}/newportxps.egg-info/dependency_links.txt +0 -0
- {newportxps-0.2 → newportxps-0.9}/newportxps.egg-info/top_level.txt +0 -0
- {newportxps-0.2 → newportxps-0.9}/setup.cfg +0 -0
newportxps-0.9/LICENSE
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
BSD 2-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018, Matthew Newville, The University of Chicago
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
17
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
18
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
19
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
20
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
21
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
22
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
23
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
24
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
25
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
newportxps-0.9/PKG-INFO
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: newportxps
|
|
3
|
+
Version: 0.9
|
|
4
|
+
Summary: Python interface to Newport XPS motion controllers
|
|
5
|
+
Author-email: Matthew Newville <newville@cars.uchicago.edu>
|
|
6
|
+
License: BSD License
|
|
7
|
+
Project-URL: Homepage, https://github.com/pyepics/newportxps/
|
|
8
|
+
Keywords: motion control,data collection
|
|
9
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Intended Audience :: Education
|
|
12
|
+
Classifier: Intended Audience :: Other Audience
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: Implementation :: Jython
|
|
24
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
25
|
+
Classifier: Topic :: Education
|
|
26
|
+
Classifier: Topic :: Scientific/Engineering
|
|
27
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
28
|
+
Classifier: Topic :: Software Development
|
|
29
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
30
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
31
|
+
Classifier: Topic :: Utilities
|
|
32
|
+
Requires-Python: >=3.8
|
|
33
|
+
Description-Content-Type: text/markdown
|
|
34
|
+
License-File: LICENSE
|
|
35
|
+
Requires-Dist: pysftp
|
|
36
|
+
Requires-Dist: numpy
|
|
37
|
+
|
|
38
|
+
# newportxps
|
|
39
|
+
|
|
40
|
+
This module provides code for using Newport XPS motor controllers from Python.
|
|
41
|
+
|
|
42
|
+
While Newport Corp. has provided a basic socket and ftp interface to the XPS
|
|
43
|
+
controller for a long time, this interface is very low-level. In addition,
|
|
44
|
+
there are some incompatibilities between the different generations of XPS
|
|
45
|
+
controllers (generations C, Q, D in that chronological order), and a lack of
|
|
46
|
+
support for Python 3 in the Newport-provided interface. The `newportxps`
|
|
47
|
+
module here aims to provide a simple, user-friendly interface for the Newport
|
|
48
|
+
XPS that works uniformly for all three generations of XPS and for both Python
|
|
49
|
+
2 and 3.
|
|
50
|
+
|
|
51
|
+
As an example, connecting to and reading the status of an XPS controller may
|
|
52
|
+
look like this:
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
>>> from newportxps import NewportXPS
|
|
56
|
+
>>> xps = NewportXPS('164.54.160.000', username='Administrator', password='Please.Let.Me.In')
|
|
57
|
+
>>> print(xps.status_report())
|
|
58
|
+
# XPS host: 164.54.160.000 (164.54.160.000)
|
|
59
|
+
# Firmware: XPS-D-N13006
|
|
60
|
+
# Current Time: Sun Sep 16 13:40:24 2018
|
|
61
|
+
# Last Reboot: Wed Sep 12 14:46:44 2018
|
|
62
|
+
# Trajectory Group: None
|
|
63
|
+
# Groups and Stages
|
|
64
|
+
DetectorZ (SingleAxisInUse), Status: Ready state from motion
|
|
65
|
+
DetectorZ.Pos (ILS@ILS150CC@XPS-DRV11)
|
|
66
|
+
Hardware Status: First driver powered on - ZM low level
|
|
67
|
+
Positioner Errors: OK
|
|
68
|
+
SampleX (SingleAxisInUse), Status: Ready state from motion
|
|
69
|
+
SampleX.Pos (UTS@UTS150PP@XPS-DRV11)
|
|
70
|
+
Hardware Status: First driver powered on - ZM high level
|
|
71
|
+
Positioner Errors: OK
|
|
72
|
+
SampleY (SingleAxisInUse), Status: Ready state from motion
|
|
73
|
+
SampleY.Pos (UTS@UTS150PP@XPS-DRV11)
|
|
74
|
+
Hardware Status: First driver powered on - ZM high level
|
|
75
|
+
Positioner Errors: OK
|
|
76
|
+
SampleZ (SingleAxisInUse), Status: Ready state from motion
|
|
77
|
+
SampleZ.Pos (UTS@UTS150PP@XPS-DRV11)
|
|
78
|
+
Hardware Status: First driver powered on - ZM low level
|
|
79
|
+
Positioner Errors: OK
|
|
80
|
+
|
|
81
|
+
>>> for gname, info in xps.groups.items():
|
|
82
|
+
... print(gname, info)
|
|
83
|
+
...
|
|
84
|
+
DetectorX {'category': 'SingleAxisInUse', 'positioners': ['Pos']}
|
|
85
|
+
SampleX {'category': 'SingleAxisInUse', 'positioners': ['Pos']}
|
|
86
|
+
SampleY {'category': 'SingleAxisInUse', 'positioners': ['Pos']}
|
|
87
|
+
SampleZ {'category': 'SingleAxisInUse', 'positioners': ['Pos']}
|
|
88
|
+
>>>
|
|
89
|
+
>>> for sname, info in xps.stages.items():
|
|
90
|
+
... print(sname, xps.get_stage_position(sname), info)
|
|
91
|
+
...
|
|
92
|
+
DetectorX.Pos 36.5 {'type': 'ILS@ILS150CC@XPS-DRV11', 'max_velo': 100, 'max_accel': 400, 'low_limit': -74, 'high_limit': 74}
|
|
93
|
+
SampleX.Pos 1.05 {'type': 'UTS@UTS150PP@XPS-DRV11', 'max_velo': 20, 'max_accel': 80, 'low_limit': -74, 'high_limit': 74}
|
|
94
|
+
SampleY.Pos 0.24 {'type': 'UTS@UTS150PP@XPS-DRV11', 'max_velo': 20, 'max_accel': 80, 'low_limit': -74, 'high_limit': 74}
|
|
95
|
+
SampleZ.Pos 2.5 {'type': 'UTS@UTS150PP@XPS-DRV11', 'max_velo': 20, 'max_accel': 80, 'low_limit': -74, 'high_limit': 74}
|
|
96
|
+
|
|
97
|
+
>>> xps.move_stage('SampleZ.Pos', 1.0)
|
|
98
|
+
|
|
99
|
+
>>> xps.home_group('DetectorX')
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
On creation and initialization of the NewportXPS, the Groups and status of the
|
|
105
|
+
controller are read in and Stages defined so that they can be queried or
|
|
106
|
+
moved.
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
The `NewportXPS` class has a number of methods to interact with the controller including:
|
|
110
|
+
|
|
111
|
+
* reboot controller
|
|
112
|
+
* get status, hardware errors, etc.
|
|
113
|
+
* save and upload new `system.ini` and `stages.ini` files.
|
|
114
|
+
* enable and disable Groups.
|
|
115
|
+
* initialize and home Stages and Groups of Stages.
|
|
116
|
+
* read Stage positions.
|
|
117
|
+
* move Stages and Groups to new positions.
|
|
118
|
+
* set Stage velocity.
|
|
119
|
+
* define simple linear trajectories (using PVT mode), both 'forward' and 'backward'.
|
|
120
|
+
* upload any PVT trajectory.
|
|
121
|
+
* arm PVT trajectory.
|
|
122
|
+
* run PVT trajectory.
|
|
123
|
+
* read and save Gathering file for a trajectory.
|