Controller class for communicating with an Oriel Cornerstone 260 monochromator.
Project description
Oriel Cornerstone 260
A library allowing easy control over Oriel Cornerstone 260 monochromators.
Install with
python -m pip install oriel-cornerstone-260
Monochromator
Represents a monochromator.
- Monochromator( port, timeout = 5 ): Creates a new monochromator for the device at the specificed port, with the provided communication timeout.
Methods
Low Level
Low level methods allows reading and writing to the device.
-
connect(): Connects to the device.
-
disconnect(): Disconnects from the device.
-
write( msg ): Writes a message to the device. Termination characters are added.
-
read(): Reads a single response from the device.
-
command( cmd, *args ): Sends a command to the device with the given arguments. Returns the command.
-
query( msg ): Queries the device. Returns a Response object.
High Level
High level methods are convenience methods used for commonly needed functions.
-
goto( wavelength ): Goes to the given wavelength.
-
abort(): Starts the given channel.
-
set_grating( grating ): Sets the grating to the given number.
-
shutter( close = True ): Open or close the shutter.
-
set_outport( port ): Sets the output port.
-
slit_width( slit, width = None ): Gets or sets the slit width.
Properties
- _com:
Serial
connection frompyserial
. - connected: Whether the device is connected or not.
- port: Device port.
- term_chars: Termination characters used for reading and writing. [Default: '\r\n']
- info: Device info.
- position: Wavelength position.
- grating: Current grating and its properties. Returns a dictionary with
number
,lines
, andlabel
. - shuttered: Whether the shutter is closed or open.
- outport: The output port.
Response
A namedtuple
with properties statement
which represents the command, and response
.
Example
A basic example for using a Monochromator.
from oriel_cornerstone_260.monochromator import Monochromator
# create device
mono = Monochromator( 'COM9' )
# print monochromator info
print( mono.info )
# go to 600 nm
mono.goto( 600 )
Note
A Monochromator is a ultimately a Serial
object from pyserial
, so you can call any functions on a Monochromator that you would on a Serial object.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for oriel-cornerstone-260-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 525b95a63b0f2a72b8b928f30d56a40a53e6cf78e5e2770da52b9657e1c9d3bc |
|
MD5 | 2bdbbb6eefbcf22268a6d0d46d32ae89 |
|
BLAKE2b-256 | b13e06f2e8440ad3691f44c95c688b2cbf1481bf4292cbfb8738eb9e53bccd95 |
Hashes for oriel_cornerstone_260-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64f4c88ff811746c8d9b5b6843dfa119815b8919775e07a602e933cea9b1bb63 |
|
MD5 | 18f2746d10d44b43d051d586116d58ee |
|
BLAKE2b-256 | fe6711a02014392dcde43dee5ed6a906d4cd5e8f6f4814d3f2d0903c05140239 |