bicarlsen / oriel-cornerstone-260

Python library for controlling an Oriel Cornerstone 260 monochromator.
GNU General Public License v3.0
0 stars 3 forks source link

Oriel Cornerstone 260

A library allowing easy control over an Oriel Cornerstone 260 monochromator with an RS-232C port.

Install with 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.

Monochromator

Represents a monochromator.

Methods

Low Level

Low level methods allows reading and writing to the device.

High Level

High level methods are convenience methods used for commonly needed functions.

Properties

Response

A namedtuple with properties statement which represents the command, and response.

Example

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 )

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.


USB Connection

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' )

The mono object will control the monochromator using methods documented in the Cornerstone 260 manual.