Qcodes example with Shamrock SR750

[1]:
from qcodes_contrib_drivers.drivers.Shamrock.SR750 import Shamrock_SR750

Initialize the instrument

[2]:
shamrock = Shamrock_SR750("Shamrock")
Connected to: Shamrock None (serial:SR-2975, firmware:None) in 8.30s

Get the current spectrometer setup

We read the current grating number, its blaze and groove density, the current central wavelength and the slit width.

[3]:
print(shamrock.grating.label, ':', shamrock.grating.get(), shamrock.grating.unit)
print(shamrock.blaze.label, ':', shamrock.blaze.get(), shamrock.blaze.unit)
print(shamrock.groove_density.label, ':', shamrock.groove_density.get(), shamrock.groove_density.unit)
print(shamrock.wavelength.label, ':', shamrock.wavelength.get(), shamrock.wavelength.unit)
print(shamrock.slit.label, ':', shamrock.slit.get(), shamrock.slit.unit)
Grating : 1
Blaze : 650
Groove density : 600 l/mm
Wavelength : 600.0 nm
Slit : 200 μm

Change spectrometer setup

We select another grating, change the central wavelength and change the slit width. Afterwards, we repeat the parameter reading.

[4]:
shamrock.grating.set(2)
shamrock.wavelength.set(756)
shamrock.slit.set(100)
[5]:
print(shamrock.grating.label, ':', shamrock.grating.get(), shamrock.grating.unit)
print(shamrock.blaze.label, ':', shamrock.blaze.get(), shamrock.blaze.unit)
print(shamrock.groove_density.label, ':', shamrock.groove_density.get(), shamrock.groove_density.unit)
print(shamrock.wavelength.label, ':', shamrock.wavelength.get(), shamrock.wavelength.unit)
print(shamrock.slit.label, ':', shamrock.slit.get(), shamrock.slit.unit)
Grating : 2
Blaze : 675
Groove density : 1350 l/mm
Wavelength : 756.0 nm
Slit : 100 μm

Get spectrometer calibration

We read the spectrometer calibration, i.e. the wavelength for each pixel on the CCD.

[7]:
shamrock.calibration.get()[:10]
[7]:
[745.6130981445312,
 745.6336059570312,
 745.6541137695312,
 745.674560546875,
 745.695068359375,
 745.715576171875,
 745.736083984375,
 745.756591796875,
 745.777099609375,
 745.7975463867188]

Take a snapshot

We take a snapshot of the instrument to get an overview of the current settings.

[8]:
shamrock.print_readable_snapshot()
Shamrock:
        parameter     value
--------------------------------------------------------------------------------
IDN            :        {'vendor': 'Shamrock', 'serial': 'SR-2975'}
blaze          :        675
calibration    :        [745.6130981445312, 745.6336059570312, 745.6541137695312, 74...
grating        :        2
groove_density :        1350 (l/mm)
slit           :        100 (μm)
wavelength     :        756 (nm)

Close the instrument

[9]:
shamrock.close()