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.
- 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.
-
set_filter( filter ): Sets the filter to the given position.
-
filter_label(filter, label = None ): Gets or sets a filter's label.
-
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:
Serialconnection 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. - filter: Current filter position.
- 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 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.
Metadata
Release files for oriel-cornerstone-260 0.1.0.post1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| oriel-cornerstone-260-0.1.0.post1.tar.gz | 17.6 kB | Without provenance | Details for oriel-cornerstone-260-0.1.0.post1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| oriel_cornerstone_260-0.1.0.post1-py3-none-any.whl | Python 3 | none | any | Details for oriel_cornerstone_260-0.1.0.post1-py3-none-any.whl |
Total release size: 35.7 kB
Release files / oriel-cornerstone-260-0.1.0.post1.tar.gz
| Download URL | oriel-cornerstone-260-0.1.0.post1.tar.gz |
|---|---|
| Size | 17.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c94441feb253b52b0bde3f745f3c0112993c293abbf728301636df737d106848
|
|
BLAKE2b-256 checksum How to use checksums |
b5b2117d8095b821571f5094f0a7fb29a1f6c796c039962a4a8b3549f232fed7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.8
|
Release files / oriel_cornerstone_260-0.1.0.post1-py3-none-any.whl
| Download URL | oriel_cornerstone_260-0.1.0.post1-py3-none-any.whl |
|---|---|
| Size | 18.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6b524be54e82d129e70d2cdb3add06cd07429725eb6e762cedd95690c34fba15
|
|
BLAKE2b-256 checksum How to use checksums |
1b34086e1ec0c7f5524343c05aa9bc6c87133d6db1d1fad3a9ae762594563a8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.8
|
Security for oriel-cornerstone-260 0.1.0.post1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.