HORIBA C++ SDK
Library for HORIBA devices
Loading...
Searching...
No Matches
horiba::devices::single_devices::ChargeCoupledDevice Class Referencefinal

Represents a CCD camera. More...

#include <ccd.h>

Inheritance diagram for horiba::devices::single_devices::ChargeCoupledDevice:

Public Types

enum class  AcquisitionFormat : int { SPECTRA = 0 , IMAGE , CROP , FAST_KINETICS }
 
enum class  XAxisConversionType : int { NONE = 0 , FROM_CCD_FIRMWARE , FROM_ICL_SETTINGS_INI }
 CCD X axis converstion type. More...
 
enum class  CleanCountMode : int {
  NEVER = 0 , FIRST_ONLY = 1 , BETWEEN_ONLY = 2 , EACH = 3 ,
  MODE_UNKNOWN = 238
}
 
enum class  TimerResolution : int { THOUSAND_MICROSECONDS = 0 , ONE_MICROSECOND }
 

Public Member Functions

 ChargeCoupledDevice (int id, std::shared_ptr< communication::Communicator > communicator)
 
 ~ChargeCoupledDevice () override=default
 
void open () noexcept(false) override
 Opens the device.
 
void close () noexcept(false) override
 Closes the device.
 
bool is_open () noexcept(false)
 Checks if the connection to the CCD device is open.
 
void restart () noexcept(false)
 Restarts the CCD.
 
nlohmann::json get_configuration ()
 Returns the configuration of the CCD.
 
int get_gain_token () noexcept(false)
 Returns the gain token of the CCD.
 
void set_gain (int gain_token) noexcept(false)
 Sets the gain of the CCD.
 
int get_speed_token () noexcept(false)
 Returns the speed of the CCD.
 
void set_speed (int speed_token) noexcept(false)
 Sets the speed of the CCD.
 
int get_parallel_speed_token () noexcept(false)
 Returns the parallel speed of the CCD.
 
void set_parallel_speed (int parallel_speed_token) noexcept(false)
 Sets the parallel speed of the CCD.
 
std::vector< int > get_fit_parameters () noexcept(false)
 Returns the fit parameters of the CCD.
 
ChargeCoupledDevice::TimerResolution get_timer_resolution () noexcept(false)
 Returns the timer resolution of the CCD.
 
void set_timer_resolution (ChargeCoupledDevice::TimerResolution timer_resolution) noexcept(false)
 Sets the timer resolution of the CCD.
 
void set_acquisition_format (int number_of_rois, AcquisitionFormat acquisition_format) noexcept(false)
 Sets the number of ROIs (Regions of Interest) or areas and the acquisition format.
 
XAxisConversionType get_x_axis_conversion_type () noexcept(false)
 Gets the conversion type of the x axis.
 
void set_x_axis_conversion_type (XAxisConversionType conversion_type) noexcept(false)
 Sets the x-axis pixel conversion type to be used when retrieving the acquisition data with thee.
 
int get_acquisition_count () noexcept(false)
 Gets the number of acquisitions to be performed.
 
void set_acquisition_count (int count) noexcept(false)
 Sets the number of acquisitions to be performed. The acquisition count is used to perform multiple acquisitions in a row.
 
std::pair< int, ChargeCoupledDevice::CleanCountModeget_clean_count () noexcept(false)
 Gets the number of cleans to be performed prior to measurement.
 
void set_clean_count (int count, ChargeCoupledDevice::CleanCountMode mode) noexcept(false)
 Sets the clean count mode of the CCD and the corresponding mode.
 
int get_acquisition_data_size () noexcept(false)
 Returns the size of the data from the CCD.
 
double get_temperature () noexcept(false)
 Returns the chip temperature of the CCD.
 
std::pair< int, int > get_chip_size () noexcept(false)
 Gets the chip resolution of the CCD.
 
int get_exposure_time () noexcept(false)
 Returns the exposure time in milliseconds.
 
void set_exposure_time (int exposure_time_ms) noexcept(false)
 Sets the exposure time in milliseconds.
 
std::tuple< bool, int, int, int > get_trigger_input () noexcept(false)
 This command is used to get the current setting of the input trigger.
 
void set_trigger_input (bool enabled, int address, int event, int signal_type) noexcept(false)
 This command is used to enable or disable the trigger input.
 
std::tuple< bool, int, int, int > get_signal_output () noexcept(false)
 This command is used to get the current setting of the signal output.
 
void set_signal_output (bool enabled, int address, int event, int signal_type) noexcept(false)
 This command is used to enable or disable the signal output.
 
bool get_acquisition_ready () noexcept(false)
 Returns true if the CCD is ready to acquire.
 
void set_acquisition_start (bool open_shutter) noexcept(false)
 Starts an acquisition that has been set up according to the previously defined acquisition parameters.
 
void set_region_of_interest (int roi_index=1, int x_origin=0, int y_origin=0, int x_size=1024, int y_size=256, int x_bin=1, int y_bin=256) noexcept(false)
 Sets the region of interest (ROI) of the CCD.
 
std::any get_acquisition_data () noexcept(false)
 Returns the acquisition data of the CCD.
 
bool get_acquisition_busy () noexcept(false)
 Returns true if the CCD is busy with the acquisition.
 
void abort_acquisition () noexcept(false)
 Stops the acquisition of the CCD.
 
void set_center_wavelength (int monochromator_id, double wavelength) noexcept(false)
 Sets the center wavelength value to be used in the grating equation.
 
std::vector< double > range_mode_center_wavelenghts (int monochromator_id, double start_wavelength, double end_wavelength, double pixel_overlap) noexcept(false)
 Finds the center wavelength positions based on the input range and pixel overlap.
 
- Public Member Functions inherited from horiba::devices::single_devices::Device
 Device (int id, std::shared_ptr< communication::Communicator > communicator)
 
virtual ~Device ()=default
 
int device_id () const
 

Additional Inherited Members

- Protected Member Functions inherited from horiba::devices::single_devices::Device
communication::Response execute_command (const communication::Command &command)
 

Detailed Description

Represents a CCD camera.

This class should not be created directly by the end user. Instead a DeviceManager should be used to access the detected CCDs on the system.

The cells of the CCD can be binned and summed up.

Member Enumeration Documentation

◆ AcquisitionFormat

Enumerator
SPECTRA 
IMAGE  
CROP  
FAST_KINETICS  

◆ CleanCountMode

Enumerator
NEVER 
FIRST_ONLY 
BETWEEN_ONLY 
EACH 
MODE_UNKNOWN 238 

◆ TimerResolution

Enumerator
THOUSAND_MICROSECONDS 
ONE_MICROSECOND  

◆ XAxisConversionType

CCD X axis converstion type.

  • None (default)
  • CCD FIT parameters contained in the CCD firmware
  • Mono Wavelength parameters contained in the icl_settings.ini file
Enumerator
NONE 
FROM_CCD_FIRMWARE  
FROM_ICL_SETTINGS_INI  

Constructor & Destructor Documentation

◆ ChargeCoupledDevice()

horiba::devices::single_devices::ChargeCoupledDevice::ChargeCoupledDevice ( int id,
std::shared_ptr< communication::Communicator > communicator )

◆ ~ChargeCoupledDevice()

horiba::devices::single_devices::ChargeCoupledDevice::~ChargeCoupledDevice ( )
overridedefault

Member Function Documentation

◆ abort_acquisition()

void horiba::devices::single_devices::ChargeCoupledDevice::abort_acquisition ( )

Stops the acquisition of the CCD.

Exceptions
std::exceptionWhen an error occurs on the device side.

◆ close()

void horiba::devices::single_devices::ChargeCoupledDevice::close ( )
overridevirtual

Closes the device.

Exceptions
std::runtime_errorwhen an error occurred on the device side

Implements horiba::devices::single_devices::Device.

◆ get_acquisition_busy()

bool horiba::devices::single_devices::ChargeCoupledDevice::get_acquisition_busy ( )

Returns true if the CCD is busy with the acquisition.

Returns
bool True if the CCD is busy.
Exceptions
std::exceptionWhen an error occurs on the device side.

◆ get_acquisition_count()

int horiba::devices::single_devices::ChargeCoupledDevice::get_acquisition_count ( )

Gets the number of acquisitions to be performed.

The acquisition count is used to perform multiple acquisitions in a row.

Returns
int The acquisition count.
Exceptions
std::exceptionWhen an error occurs on the device side.

◆ get_acquisition_data()

std::any horiba::devices::single_devices::ChargeCoupledDevice::get_acquisition_data ( )

Returns the acquisition data of the CCD.

The acquisition data is a dictionary with the following keys:

  • acqIndex: Acquisition number
  • roi:
    • roiIndex: Region of Interest number
    • xOrigin: ROI’s X Origin
    • yOrigin: ROI’s Y Origin
    • xSize: ROI’s X Size
    • ySize: ROI’s Y Size
    • xBinning: ROI’s X Bin
    • yBinning: ROI’s Y Bin
    • xData: X data
    • yData: Y data
  • Timestamp: This is a timestamp that relates to the time when the all the programmed acquisitions have completed. The data from all programmed acquisitions are retrieve from the CCD after all acquisitions have completed, therefore the same timestamp is used for all acquisitions.
Returns
std::any Acquisition data.
Exceptions
std::exceptionWhen an error occurs on the device side.

◆ get_acquisition_data_size()

int horiba::devices::single_devices::ChargeCoupledDevice::get_acquisition_data_size ( )

Returns the size of the data from the CCD.

Todo
Check the unit of the size
Returns
int Size of the data.
Exceptions
std::exceptionWhen an error occurs on the device side.

◆ get_acquisition_ready()

bool horiba::devices::single_devices::ChargeCoupledDevice::get_acquisition_ready ( )

Returns true if the CCD is ready to acquire.

Returns
bool True if the CCD is ready to acquire.
Exceptions
std::exceptionWhen an error occurs on the device side.

◆ get_chip_size()

std::pair< int, int > horiba::devices::single_devices::ChargeCoupledDevice::get_chip_size ( )

Gets the chip resolution of the CCD.

Returns
std::pair<int, int> Chip resolution (width, height).
Exceptions
std::exceptionWhen an error occurs on the device side.

◆ get_clean_count()

std::pair< int, ChargeCoupledDevice::CleanCountMode > horiba::devices::single_devices::ChargeCoupledDevice::get_clean_count ( )

Gets the number of cleans to be performed prior to measurement.

Returns
std::pair<int, ChargeCoupledDevice::CleanCountMode> Clean count information.
Exceptions
std::exceptionWhen an error occurs on the device side.

◆ get_configuration()

nlohmann::json horiba::devices::single_devices::ChargeCoupledDevice::get_configuration ( )

Returns the configuration of the CCD.

Returns
Configuration of the CCD
Exceptions
std::runtime_errorwhen an error occurred on the device side

◆ get_exposure_time()

int horiba::devices::single_devices::ChargeCoupledDevice::get_exposure_time ( )

Returns the exposure time in milliseconds.

Returns
int Exposure time in milliseconds.
Exceptions
std::exceptionWhen an error occurs on the device side.

◆ get_fit_parameters()

std::vector< int > horiba::devices::single_devices::ChargeCoupledDevice::get_fit_parameters ( )

Returns the fit parameters of the CCD.

Todo
Check the units and details of the fit parameters
Returns
Fit parameters as a vector of integers
Exceptions
std::runtime_errorwhen an error occurred on the device side

◆ get_gain_token()

int horiba::devices::single_devices::ChargeCoupledDevice::get_gain_token ( )

Returns the gain token of the CCD.

Note: The CCD can have different sensors installed, which can have different gain values. This is why only the token to the gain is returned. You need to first check what gain values are available for the CCD using the get_configuration function.

Returns
Gain of the CCD
Exceptions
std::runtime_errorwhen an error occurred on the device side

◆ get_parallel_speed_token()

int horiba::devices::single_devices::ChargeCoupledDevice::get_parallel_speed_token ( )

Returns the parallel speed of the CCD.

Note: The CCD can have different sensors installed, which can have different parallel speed values. Therefore you need to first check what parallel speed values are available for the CCD using the get_configuration function.

Returns
Parallel speed token
Exceptions
std::runtime_errorwhen an error occurred on the device side

◆ get_signal_output()

std::tuple< bool, int, int, int > horiba::devices::single_devices::ChargeCoupledDevice::get_signal_output ( )

This command is used to get the current setting of the signal output.

The address, event, and signalType parameters are used to define the signal based on the supported options of that particular CCD.

The supported signal options are retrieved using the get_configuration command, and begin with the “Signals” string contained in the configuration.

Returns
std::tuple<bool, int, int, int> The signal output settings. enabled (bool): Specifies if the signal is enabled (e.g. False = Disabled), address (int): Used to specify where the signal is located (e.g. 0 = Signal Output), Note: Value of -1 indicates that the signal output is disabled, event (int): Used to specify when the signal event should occur. (e.g. 3 = Shutter Open) Note: Value of -1 indicates that the signal output is disabled, signal type (int): how the signal will cause the event. (e.g. 0 = TTL Active High) Note: Value of -1 indicates that the signal output is disabled,
Exceptions
std::exceptionWhen an error occurs on the device side.

◆ get_speed_token()

int horiba::devices::single_devices::ChargeCoupledDevice::get_speed_token ( )

Returns the speed of the CCD.

Note: The CCD can have different sensors installed, which can have different speed values. Therefore you need to first check what speed values are available for the CCD using the get_configuration function.

Returns
Speed token
Exceptions
std::runtime_errorwhen an error occurred on the device side

◆ get_temperature()

double horiba::devices::single_devices::ChargeCoupledDevice::get_temperature ( )

Returns the chip temperature of the CCD.

Returns
double Chip temperature in degrees Celsius.
Exceptions
std::exceptionWhen an error occurs on the device side.

◆ get_timer_resolution()

ChargeCoupledDevice::TimerResolution horiba::devices::single_devices::ChargeCoupledDevice::get_timer_resolution ( )

Returns the timer resolution of the CCD.

Returns
Timer resolution
Exceptions
std::runtime_errorwhen an error occurred on the device side

◆ get_trigger_input()

std::tuple< bool, int, int, int > horiba::devices::single_devices::ChargeCoupledDevice::get_trigger_input ( )

This command is used to get the current setting of the input trigger.

The address, event, and signalType parameters are used to define the input trigger based on the supported options of that particular CCD.

The supported trigger options are retrieved using the get_configuration function, and begin with the “Triggers” string contained in the configuration.

Returns
std::tuple<bool, int, int, int> The input trigger settings. enabled (bool) Specifies if the signal is enabled (e.g. False = Disabled), address (int) used to specify where the trigger is located. (e.g. 0 = Trigger Input). Note: Value of -1 indicates that the input trigger is disabled, event (int) used to specify when the trigger event should occur. (e.g. 0 = Once - Start All) Note: Value of -1 indicates that the input trigger is disabled, signal type (int) used to specify how the signal will cause the input trigger. (e.g. 0 = TTL Falling Edge) Note: Value of -1 indicates that the input trigger is disabled,
Exceptions
std::exceptionWhen an error occurs on the device side.

◆ get_x_axis_conversion_type()

XAxisConversionType horiba::devices::single_devices::ChargeCoupledDevice::get_x_axis_conversion_type ( )

Gets the conversion type of the x axis.

Returns
Conversion Type of the x axis
Exceptions
std::runtime_errorwhen an error occurred on the device side

◆ is_open()

bool horiba::devices::single_devices::ChargeCoupledDevice::is_open ( )

Checks if the connection to the CCD device is open.

Returns
True if the connection is open, false otherwise.
Exceptions
std::runtime_errorwhen an error occurred on the device side

◆ open()

void horiba::devices::single_devices::ChargeCoupledDevice::open ( )
overridevirtual

Opens the device.

Exceptions
std::runtime_errorwhen an error occurred on the device side

Reimplemented from horiba::devices::single_devices::Device.

◆ range_mode_center_wavelenghts()

std::vector< double > horiba::devices::single_devices::ChargeCoupledDevice::range_mode_center_wavelenghts ( int monochromator_id,
double start_wavelength,
double end_wavelength,
double pixel_overlap )

Finds the center wavelength positions based on the input range and pixel overlap.

The following commands are prerequisites and should be called prior to using this command:

Parameters
monochromator_idMonochromator ID that is used with this CCD
start_wavelengthStart wavelength
end_wavelengthEnd wavelength
pixel_overlapOverlap in pixels
Returns
std::vector<double> Center wavelengths
Exceptions
std::exceptionWhen an error occurs on the device side.

◆ restart()

void horiba::devices::single_devices::ChargeCoupledDevice::restart ( )

Restarts the CCD.

Note that this function only works if the camera has been opened before. The connection to the camera stays open after the restart.

Exceptions
std::runtime_errorwhen an error occurred on the device side

◆ set_acquisition_count()

void horiba::devices::single_devices::ChargeCoupledDevice::set_acquisition_count ( int count)

Sets the number of acquisitions to be performed. The acquisition count is used to perform multiple acquisitions in a row.

Parameters
countNumber of acquisitions to be performed.
Exceptions
std::exceptionWhen an error occurs on the device side.

◆ set_acquisition_format()

void horiba::devices::single_devices::ChargeCoupledDevice::set_acquisition_format ( int number_of_rois,
AcquisitionFormat acquisition_format )

Sets the number of ROIs (Regions of Interest) or areas and the acquisition format.

After using this command to set the number of ROIs and format, the ccd_setRoi command should be used to define each ROI.

Note: The Crop (2) and Fast Kinetics (3) acquisition formats are not supported by every CCD.

Parameters
number_of_roisNumber of regions of interest
acquisition_formatAcquisition format
Exceptions
std::runtime_errorwhen an error occurred on the device side

◆ set_acquisition_start()

void horiba::devices::single_devices::ChargeCoupledDevice::set_acquisition_start ( bool open_shutter)

Starts an acquisition that has been set up according to the previously defined acquisition parameters.

Note: To specify the acquisiton parameters please see set_region_of_interest, set_x_axis_conversion_type. If there are no acquisition parameters set at the time of acquisition it may result in no data being generated.

Parameters
open_shutterWhether the shutter of the camera should be open during the acquisition.
Exceptions
std::exceptionWhen an error occurs on the device side.

◆ set_center_wavelength()

void horiba::devices::single_devices::ChargeCoupledDevice::set_center_wavelength ( int monochromator_id,
double wavelength )

Sets the center wavelength value to be used in the grating equation.

Used when X axis conversion is XAxisConversionType::FROM_ICL_SETTINGS_INI

Parameters
monochromator_idMonochromator ID that is used with this CCD
wavelengthCenter wavelength value in nm
Exceptions
std::exceptionWhen an error occurs on the device side.

◆ set_clean_count()

void horiba::devices::single_devices::ChargeCoupledDevice::set_clean_count ( int count,
ChargeCoupledDevice::CleanCountMode mode )

Sets the clean count mode of the CCD and the corresponding mode.

Parameters
countNumber of acquisitions to be performed.
modeClean count mode
Exceptions
std::exceptionWhen an error occurs on the device side.

◆ set_exposure_time()

void horiba::devices::single_devices::ChargeCoupledDevice::set_exposure_time ( int exposure_time_ms)

Sets the exposure time in milliseconds.

Parameters
exposure_time_msExposure time in milliseconds.
Exceptions
std::exceptionWhen an error occurs on the device side.

◆ set_gain()

void horiba::devices::single_devices::ChargeCoupledDevice::set_gain ( int gain_token)

Sets the gain of the CCD.

Note: The CCD can have different sensors installed, which can have different gain values. Therefore you need to first check what gain values are available for the CCD using the get_configuration function.

Parameters
gain_tokenToken of the gain to set
Exceptions
std::runtime_errorwhen an error occurred on the device side

◆ set_parallel_speed()

void horiba::devices::single_devices::ChargeCoupledDevice::set_parallel_speed ( int parallel_speed_token)

Sets the parallel speed of the CCD.

Note: The CCD can have different sensors installed, which can have different parallel speed values. Therefore you need to first check what parallel speed values are available for the CCD using the get_configuration function.

Parameters
parallel_speed_tokenToken of the parallel speed to set
Exceptions
std::runtime_errorwhen an error occurred on the device side

◆ set_region_of_interest()

void horiba::devices::single_devices::ChargeCoupledDevice::set_region_of_interest ( int roi_index = 1,
int x_origin = 0,
int y_origin = 0,
int x_size = 1024,
int y_size = 256,
int x_bin = 1,
int y_bin = 256 )

Sets the region of interest (ROI) of the CCD.

Parameters
roi_indexIndex of the region of interest. Defaults to 1.
x_originX origin of the region of interest. Defaults to 0.
y_originY origin of the region of interest. Defaults to 0.
x_sizeX size of the region of interest. Defaults to 1024.
y_sizeY size of the region of interest. Defaults to 256.
x_binX bin of the region of interest. Defaults to 1.
y_binY bin of the region of interest. Defaults to 256.
Exceptions
std::exceptionWhen an error occurs on the device side.

◆ set_signal_output()

void horiba::devices::single_devices::ChargeCoupledDevice::set_signal_output ( bool enabled,
int address,
int event,
int signal_type )

This command is used to enable or disable the signal output.

When enabling the signal output, the address, event, and signalType parameters are used to define the signal based on the supported options of that particular CCD.

The supported signal options are retrieved using the ccd_getConfig command, and begin with the “Signals” string contained in the configuration.

Parameters
enabledEnable or disable the signal output. Note: When disabling the signal output, the address, event, and signal_type parameters are ignored.
addressUsed to specify where the signal is located (e.g. 0 = Signal Output)
eventUsed to specify when the signal event should occur. (e.g. 3 = Shutter Open)
signal_typeHow the signal will cause the event. (e.g. 0 = TTL Active High)
Exceptions
std::exceptionWhen an error occurs on the device side.

◆ set_speed()

void horiba::devices::single_devices::ChargeCoupledDevice::set_speed ( int speed_token)

Sets the speed of the CCD.

Note: The CCD can have different sensors installed, which can have different speed values. Therefore you need to first check what speed values are available for the CCD using the get_configuration function.

Parameters
speed_tokenToken of the speed to set
Exceptions
std::runtime_errorwhen an error occurred on the device side

◆ set_timer_resolution()

void horiba::devices::single_devices::ChargeCoupledDevice::set_timer_resolution ( ChargeCoupledDevice::TimerResolution timer_resolution)

Sets the timer resolution of the CCD.

Parameters
timer_resolutionTimer resolution
Exceptions
std::runtime_errorwhen an error occurred on the device side

◆ set_trigger_input()

void horiba::devices::single_devices::ChargeCoupledDevice::set_trigger_input ( bool enabled,
int address,
int event,
int signal_type )

This command is used to enable or disable the trigger input.

When enabling the trigger input, the address, event, and signalType parameters are used to define the input trigger based on the supported options of that particular CCD.

The supported trigger options are retrieved using the get_configuration function, and begin with the “Triggers” string contained in the configuration.

Parameters
enabledEnable or disable the trigger input. Note : When disabling the input trigger, the address, event, and signalType parameters are ignored.
addressUsed to specify where the trigger is located (e.g. 0 = Trigger Input)
eventUsed to specify when the trigger event should occur. (e.g .0 = Once - Start All)
signal_typeUsed to specify how the signal will cause the input trigger. (e.g .0 = TTL Falling Edge)
Exceptions
std::exceptionWhen an error occurs on the device side.

◆ set_x_axis_conversion_type()

void horiba::devices::single_devices::ChargeCoupledDevice::set_x_axis_conversion_type ( XAxisConversionType conversion_type)
noexcept

Sets the x-axis pixel conversion type to be used when retrieving the acquisition data with thee.

Parameters
conversion_typeSelected axis conversion type
Exceptions
std::runtime_errorwhen an error occurred on the device side

The documentation for this class was generated from the following file: