monochromator module

class monochromator.Monochromator(com)[source]

Bases: object

Implements Monochromator for Princeton Instruments HRS-300.

Note: HRS-300 has manual filter wheel controls on the device. Users should periodically query the current monochromator filter wheel position.

checkFilter()[source]

Function to read position of monochromators filter wheel.

Returns:

current monochromator’s filter position

Return type:

int

Raises:

LoggerError – Raises error if monochromator is not connected or Exception handling

checkGrating()[source]

Function to update monochromator grating position from GUI defaults.

Parameters:

wavelength (float, required) – Current wavelength position of monochromator

Returns:

Current grating position

Return type:

int

Raises:

LoggerError – Raises error if monochromator not connected or Exception handling

chooseFilter(filterNo)[source]

Function to send filter selection command to filter wheel.

Parameters:

filterNo (float, required) – Filter position

Return type:

None

Raises:

LoggerError – Raises error if monochromator not connected or Exception handling

chooseGrating(gratingNo)[source]

Function to send grating command to monochromator.

Parameters:

gratingNo (float, required) – Monochromator grating number

Return type:

None

Raises:

LoggerError – Raises error if monochromator not connected or Exception handling

chooseScanSpeed(speed)[source]

Function to send scan speed command to monochromator.

Parameters:

speed (float, required) – monochromator grating scan speed

Return type:

None

Raises:

LoggerError – Raises error if monochromator not connected or Exception handling

chooseWavelength(wavelength)[source]

Function to send wavelength command to monochromator.

Parameters:

wavelength (float, required) – target wavelength

Return type:

None

Raises:

LoggerError – Raises error if monochromator not connected or Exception handling

connect()[source]

Function to establish connection to monochromator.

Returns:

True if connection successful, False otherwise

Return type:

bool

Raises:

LoggingError – Raises Loggingerror for Exception handling

initializeFilter(filterDiff)[source]

Function to initialize filter wheel.

Parameters:

filterDiff (int, required) – Difference between filter position and initialization position

Return type:

None

Raises:

LoggerError: – Raises error if monochromator not connected or Exception handling

waitForOK()[source]

Function to wait for acceptance signal from monochromator.

Returns:

True if connection successful, False otherwise

Return type:

bool

Raises:

LoggingError – Raises error if monochromator connection failed or Exception handling

Notes

After 10 unsuccessfull readouts, the function interrupts itself.