Controller class for communicating with an Oriel Cornerstone 260 monochromator.
Oriel Cornerstone 260
A library allowing easy control over an Oriel Cornerstone 260 monochromator with an RS-232C port.
python -m pip install oriel-cornerstone-260
NOTE: For newer models with a USB connection, see the USB Connection section at the bottom of this page.
Represents a monochromator.
- Monochromator( port, timeout = 5 ): Creates a new monochromator for the device at the specificed port, with the provided communication timeout.
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 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.
- 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
- shuttered: Whether the shutter is closed or open.
- outport: The output port.
namedtuple with properties
statement which represents the command, and
A basic example for using a Monochromator.
from oriel_cornerstone_260 import Monochromator # create device mono = Monochromator( 'COM9' ) # print monochromator info print( mono.info ) # go to 600 nm mono.goto( 600 )
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.
The USB Newport/Oriel Cornerstone 260 works differently, and can not utilize this package. It is Windows only and requires two proprietary .NET .DLLs from Newport. The Python interface is through the package pythonnet. As of late 2020, these are 32 bit DLL's that require a 32-bit (not AMD64) version of python.
import clr clr.AddReference( 'Cornerstone' ) import CornerstoneDll mono = CornerstoneDll.Cornerstone( True ) if not mono.connect(): raise IOError( 'Monochromator not found' )
mono object will control the monochromator using methods documented in the Cornerstone 260 manual.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size oriel_cornerstone_260-0.0.6-py3-none-any.whl (17.3 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size oriel-cornerstone-260-0.0.6.tar.gz (4.6 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for oriel_cornerstone_260-0.0.6-py3-none-any.whl
Hashes for oriel-cornerstone-260-0.0.6.tar.gz