---
description: |
    API documentation for modules: dopes, dopes.data_analysis, dopes.data_analysis.data_processing, dopes.data_analysis.diode, dopes.data_analysis.file_handling, dopes.data_analysis.mechanics, dopes.data_analysis.polytec, dopes.data_analysis.raman, dopes.data_analysis.semiconductor, dopes.data_analysis.transistor, dopes.equipment_control, dopes.equipment_control.cm110, dopes.equipment_control.dmm, dopes.equipment_control.equipment, dopes.equipment_control.hp4145, dopes.equipment_control.k2400, dopes.equipment_control.k2450, dopes.equipment_control.k4200, dopes.equipment_control.kal100, dopes.equipment_control.mecom, dopes.equipment_control.mecom.commands, dopes.equipment_control.mecom.exceptions, dopes.equipment_control.mecom.mecom, dopes.equipment_control.meerstetterTEC, dopes.equipment_control.oscilloscope, dopes.equipment_control.pm100d, dopes.equipment_control.sh242, dopes.equipment_control.signal_generator.

lang: en

classoption: oneside
geometry: margin=1in
papersize: a4

linkcolor: blue
links-as-notes: true
...


    
# Module `dopes` {#dopes}




    
## Sub-modules

* [dopes.data_analysis](#dopes.data_analysis)
* [dopes.equipment_control](#dopes.equipment_control)






    
# Module `dopes.data_analysis` {#dopes.data_analysis}




    
## Sub-modules

* [dopes.data_analysis.data_processing](#dopes.data_analysis.data_processing)
* [dopes.data_analysis.diode](#dopes.data_analysis.diode)
* [dopes.data_analysis.file_handling](#dopes.data_analysis.file_handling)
* [dopes.data_analysis.mechanics](#dopes.data_analysis.mechanics)
* [dopes.data_analysis.polytec](#dopes.data_analysis.polytec)
* [dopes.data_analysis.raman](#dopes.data_analysis.raman)
* [dopes.data_analysis.semiconductor](#dopes.data_analysis.semiconductor)
* [dopes.data_analysis.transistor](#dopes.data_analysis.transistor)






    
# Module `dopes.data_analysis.data_processing` {#dopes.data_analysis.data_processing}






    
## Functions


    
### Function `finite_difference` {#dopes.data_analysis.data_processing.finite_difference}




>     def finite_difference(
>         x,
>         h,
>         order,
>         accuracy=2,
>         kind='central'
>     )


Function to calculate the coefficient to calculate a finite difference for derivative calculation

args:
   
- x (array): the 1D array for which to calculate the finite difference. The size of the array should be higher than the size of the stencil given by 2 * |_ (order + 1) / 2 _| - 1 + 2 * |_ accuracy / 2_|
   
- h (scalar): the step size for an uniform grid spacing between each finite difference interval
   
- order (integer): the order of the derivation
   
- accuracy (integer): related to the number of points taken for the finite difference. see <https://en.wikipedia.org/wiki/Finite_difference_coefficient>
   
- kind (string): the type of finite difference calculated. For now, only "central" finite difference is implemented.

return:
   
- results (numpy array): an array with the results of the calculation of the finite difference
   
- x_results (numpy array): an array with the x value with the central value for each calculation of the finite difference

    
### Function `finite_difference_coeff` {#dopes.data_analysis.data_processing.finite_difference_coeff}




>     def finite_difference_coeff(
>         stencil,
>         order
>     )


Function to calculate the coefficient to calculate a finite difference for derivative calculation
<https://en.wikipedia.org/wiki/Finite_difference_coefficient>

args:
   
- stencil (list of integer): the node point for the calculation of each derivation point. The size of the stencil depends on the accuracy and the order of the derivation. For central difference, the length of the stencil is odd and symetric around 0.
   
- order (integer): the order of the derivation

return:
   
- coeff (numpy array): a column array of the coefficients to be used to calculate the finite difference

    
### Function `fit_gaussian` {#dopes.data_analysis.data_processing.fit_gaussian}




>     def fit_gaussian(
>         x,
>         y,
>         xmin=None,
>         xmax=None,
>         x0=0,
>         A=1,
>         W=1
>     )


Function to fit the data with a Lorentzian function 

args:
   
- x (array_like) : a 1D input array.
   
- y (array_like) : a 1D  input array with the same dimension of x.
   
- xmin (scalar) : a scalar or array of values to set the minimum value of the data range on which the Gaussian is calculated. 
   
- xmax (scalar) : a scalar or array of values to set the maximum value of the data range on which the Gaussian is calculated. .
   
- x0 (scalar) : the starting position of the Gaussian function for the fit
   
- A (scalar) : the starting amplitude of the Gaussian function for the fit
   
- W (scalar) : the starting full width at half maximum (FWHM) of the Gaussian function for the fit
return:
   
- a tuple (parameter_dictionary, data_gaussian) with the a dictionary containing the fitting parameters ("position", "amplitude" and "width") and the corresponding Gaussian function evaluated in x.

    
### Function `fit_lorentzian` {#dopes.data_analysis.data_processing.fit_lorentzian}




>     def fit_lorentzian(
>         x,
>         y,
>         xmin=None,
>         xmax=None,
>         x0=520.7,
>         A0=1,
>         W0=3
>     )


Function to fit the data with a Lorentzian function 

args:
   
- x (array_like) : a 1D input array.
   
- y (array_like) : a 1D  input array with the same dimension of x.
   
- xmin (scalar) : a scalar or array of values to set the minimum value of the data range on which the Lorentzian is calculated. 
   
- xmax (scalar) : a scalar or array of values to set the maximum value of the data range on which the Lorentzian is calculated. .
   
- x0 (scalar) : the starting position of the Lorentzian function for the fit
   
- A (scalar) : the starting amplitude of the Lorentzian function for the fit
   
- W (scalar) : the starting full width at half maximum (FWHM) of the Lorentzian function for the fit
return:
   
- a tuple (parameter_dictionary, data_lorentzian) with the a dictionary containing the fitting parameters ("position", "amplitude" and "width") and the corresponding Lorentzian function evaluated in x.

    
### Function `fit_lorentzian_2peaks` {#dopes.data_analysis.data_processing.fit_lorentzian_2peaks}




>     def fit_lorentzian_2peaks(
>         x,
>         y,
>         xmin=None,
>         xmax=None,
>         x0=(520, 520.7),
>         A0=(1, 1),
>         W0=(3, 3)
>     )


Function to fit the data with a Lorentzian function 

args:
   
- x (array_like) : a 1D input array.
   
- y (array_like) : a 1D  input array with the same dimension of x.
   
- xmin (scalar) : a scalar or array of values to set the minimum value of the data range on which the Lorentzian is calculated. 
   
- xmax (scalar) : a scalar or array of values to set the maximum value of the data range on which the Lorentzian is calculated. .
   
- x0 (tuple) : the two starting position of the double Lorentzian function for the fit
   
- A (tuple) : the two starting amplitude of the double Lorentzian function for the fit
   
- W (tuple) : the two starting full width at half maximum (FWHM) of the double Lorentzian function for the fit
return:
   
- a tuple (parameter_dictionary, data_lorentzian) with the a dictionary containing the fitting parameters ("position", "amplitude" and "width") and the corresponding double Lorentzian function evaluated in x.

    
### Function `gaussian` {#dopes.data_analysis.data_processing.gaussian}




>     def gaussian(
>         x,
>         x0,
>         A,
>         W
>     )


Faussian function 

args:
   
- x (array_like) : a 1D input array.
   
- x0 (scalar) : the position of the Gaussian function
   
- A (scalar) : the amplitude of the Lorentzian function
   
- W (scalar) : the full width at half maximum (FWHM) of the Lorentzian function
return:
   
- an array of the same dimension od x

    
### Function `interpolate` {#dopes.data_analysis.data_processing.interpolate}




>     def interpolate(
>         x,
>         y,
>         x_interp,
>         kind='cubic'
>     )


Function to interpolate an 1-D array

args:
   
- x (array_like) : a 1-D array of real values.
   
- y (array_like) : a 1-D array of real values of the same dimension of x.
   
- x_interp (array_like) : a 1-D array of real values of the any dimension but with all values include between the max and min value of x.
   
- kind (string or integer) : Specifies the kind of interpolation as a string specifying the order of the spline interpolator to use. The string has to be one of ælinearÆ, ænearestÆ, ænearest-upÆ, æzeroÆ, æslinearÆ, æquadraticÆ, æcubicÆ, æpreviousÆ, or ænextÆ. 
return:
   
- an array the same size as x_interp containing the interpolated result.

    
### Function `lorentzian` {#dopes.data_analysis.data_processing.lorentzian}




>     def lorentzian(
>         x,
>         x0,
>         A,
>         W
>     )


Lorentzian function 

args:
   
- x (array_like) : a 1D input array.
   
- x0 (scalar) : the position of the Lorentzian function
   
- A (scalar) : the amplitude of the Lorentzian function
   
- W (scalar) : the full width at half maximum (FWHM) of the Lorentzian function
return:
   
- an array of the same dimension as x

    
### Function `lorentzian2` {#dopes.data_analysis.data_processing.lorentzian2}




>     def lorentzian2(
>         x,
>         x0,
>         x01,
>         A,
>         A1,
>         W,
>         W1
>     )


Function with the sum of two Lorentzian 

args:
   
- x (array_like) : a 1D input array.
   
- x01 (scalar) : the position of the first Lorentzian function
   
- A1 (scalar) : the amplitude of the first Lorentzian function
   
- W1 (scalar) : the full width at half maximum (FWHM) of the first Lorentzian function
   
- x02 (scalar) : the position of the second Lorentzian function
   
- A2 (scalar) : the amplitude of the second Lorentzian function
   
- W2 (scalar) : the full width at half maximum (FWHM) of the second Lorentzian function
return:
   
- an array of the same dimension as x

    
### Function `moving_median` {#dopes.data_analysis.data_processing.moving_median}




>     def moving_median(
>         x,
>         window_length=3
>     )


Function to perform a median filter on a array

args:
   
- x (array_like) : the input array.
   
- window_length (scalar) : size of the median filter window.    
return:
   
- an array the same size as input containing the median filtered result.

    
### Function `remove_baseline` {#dopes.data_analysis.data_processing.remove_baseline}




>     def remove_baseline(
>         x,
>         y,
>         xmin_baseline,
>         xmax_baseline,
>         polyorder=2
>     )


Function to remove the baseline a 1-D array

args:
   
- x (array_like) : a 1D input array.
   
- y (array_like) : a 1D  input array with the same dimension of x.
   
- xmin_baseline (scalar or array) : a scalar or array of values to set the minimum value of the data ranges on which the baseline is calculated. Several windows can be specified by specifying an array of values
   
- xmax_baseline (scalar or array) : a scalar or array of values to set the maximum value of the data ranges on which the baseline is calculated. Several windows can be specified by specifying an array of values.
   
- polyorder (scalar) : the order of the polynome to calculate the baseline    
return:
   
- a tuple (corrected_data, baseline) with the corrected data and the baseline calculated.

    
### Function `smooth` {#dopes.data_analysis.data_processing.smooth}




>     def smooth(
>         x,
>         window_length=11,
>         polyorder=2
>     )


Function to smooth an array by applying a Savitzky-Golay filter

args:
   
- x (array_like) : the data to be filtered.
   
- window_length (scalar) : the length of the filter window.
   
- polyorder (scalar) : the order of the polynomial used to fit the samples. polyorder must be less than window_length.   
return:
   
- an array the same size as input containing the filtered result.




    
# Module `dopes.data_analysis.diode` {#dopes.data_analysis.diode}






    
## Functions


    
### Function `depletion_length` {#dopes.data_analysis.diode.depletion_length}




>     def depletion_length(
>         doping_in,
>         doping_out,
>         Vbias=0,
>         temp=300
>     )


Function to calculate the depletion length in a pn junction

args:
   
- doping_in (scalar): the doping in the region for which the depletion length has to be calculated
   
- doping_out (scalar): the doping in the adjacent region for which the depletion length has to be calculated
   
- Vbias (scalar): the bias voltage of the pn junction
   
- temp (scalar): the temperature
        
return:
   
- a scalar with the depletion length calculated in one region

    
### Function `ideal_diode` {#dopes.data_analysis.diode.ideal_diode}




>     def ideal_diode(
>         Vbias,
>         Is,
>         n=1,
>         temp=300
>     )


Function to calculate the current in an ideal diode 

args:
   
- Vbias (scalar or sequence): the bias voltage of the diode
   
- Is (scalar): the saturation current of the diode
   
- n (scalar): the ideality factor of the diode, 1 for radiative recombination, 2 for SRH recombination
   
- temp (scalar): the temperature
        
return:
   
- a scalar or sequence with same dimension as Vbias

    
### Function `j_radiative` {#dopes.data_analysis.diode.j_radiative}




>     def j_radiative(
>         Vbias,
>         mu_n,
>         mu_p,
>         tau_n,
>         tau_p,
>         ND,
>         NA,
>         ln,
>         lp,
>         temp=300
>     )


Function to calculate the radial contribution to the current density in a silicon pn junction

args:
   
- Vbias (scalar): the bias voltage of the pn junction
   
- mu_n (scalar): the mobility of the electrons
   
- mu_p (scalar): the mobility of the holes
   
- tau_n (scalar): the lifetime of the electrons
   
- tau_p (scalar): the lifetime of the holes
   
- ND (scalar): the donor doping concentration in the n region 
   
- NA (scalar): the acceptor doping concentraion in the p region 
   
- ln (scalar): the length of the cathode (n-doped region)
   
- lp (scalar): the length of the anode (p-doped region)
   
- temp (scalar): the temperature

return:
   
- a scalar with the radiative current density calculated

    
### Function `j_srh` {#dopes.data_analysis.diode.j_srh}




>     def j_srh(
>         Vbias,
>         ND,
>         NA,
>         tau=1e-07,
>         temp=300
>     )


Function to calculate the Shockley-Read-Hall contribution to the current density in a pn junction

args:
   
- Vbias (scalar): the bias voltage of the pn junction
   
- ND (scalar): the donor doping concentration in the n region 
   
- NA (scalar): the acceptor doping concentraion in the p region 
   
- tau (scalar): the global lifetime associated to the SRH mechanism
   
- temp (scalar): the temperature

return:
   
- a scalar with the SRH current density calculated

    
### Function `two_diodes` {#dopes.data_analysis.diode.two_diodes}




>     def two_diodes(
>         Vbias,
>         Is1,
>         Is2,
>         n1=1,
>         n2=2,
>         temp=300
>     )


Function to calculate the current for a two diodes model 

args:
   
- Vbias (scalar or sequence): the bias voltage of the diode
   
- Is1 (scalar): the saturation current of the first diode
   
- Is2 (scalar): the saturation current of the second diode
   
- n1 (scalar): the ideality factor of the first diode, 1 for radiative recombination, 2 for SRH recombination
   
- n1 (scalar): the ideality factor of the second diode, 1 for radiative recombination, 2 for SRH recombination
   
- temp (scalar): the temperature
        
return:
   
- a scalar or sequence with same dimension as Vbias

    
### Function `two_diodes_with_resistances` {#dopes.data_analysis.diode.two_diodes_with_resistances}




>     def two_diodes_with_resistances(
>         Vbias,
>         Is1,
>         Is2,
>         n1=1,
>         n2=2,
>         temp=300,
>         Rs=0,
>         Rsh=inf
>     )


Function to calculate the current for a two diodes model by taking into account the series and shunt resistances

args:
   
- Vbias (scalar or sequence): the bias voltage of the diode
   
- Is1 (scalar): the saturation current of the first diode
   
- Is2 (scalar): the saturation current of the second diode
   
- n1 (scalar): the ideality factor of the first diode, 1 for radiative recombination, 2 for SRH recombination
   
- n1 (scalar): the ideality factor of the second diode, 1 for radiative recombination, 2 for SRH recombination
   
- temp (scalar): the temperature
   
- Rs (scalar): the serie resistance 
   
- Rsh (scalar): the shunt resistance 
        
return:
   
- a scalar or sequence with same dimension as Vbias




    
# Module `dopes.data_analysis.file_handling` {#dopes.data_analysis.file_handling}






    
## Functions


    
### Function `read_file` {#dopes.data_analysis.file_handling.read_file}




>     def read_file(
>         file_path,
>         comments='#',
>         delimiter=',',
>         skip_header=0,
>         skip_footer=0,
>         max_rows=None,
>         usecols=None,
>         deletechars=" !#$%&'()*+, /:;<=>?@[\\]^{|}~"
>     )


Function to read data from a file

args:
   
- file_path (string) : file, filename, list, or generator to read.
   
- comments (char) : the character used to indicate the start of a comment.
   
- delimiter (char) : the string used to separate values.
   
- skip_header (integer or sequence) : the number of lines to skip at the beginning of the file.
   
- skip_footer (integer or sequence) : the number of lines to skip at the end of the file.
   
- max_rows (integer) : the maximum number of rows to read. Must not be used with skip_footer at the same time.
   
- usecols (sequence) : which columns to read, with 0 being the first. For example, usecols = (1, 4, 5) will extract the 2nd, 5th and 6th columns.
   
- deletechars (string) : a string combining invalid characters that must be deleted from the names.

return:
   
- data (numpy array): numpy array of the data read from the file

    
### Function `write_in_file` {#dopes.data_analysis.file_handling.write_in_file}




>     def write_in_file(
>         file_path,
>         data,
>         delimiter=',',
>         overwrite=False,
>         header=None,
>         date=True,
>         comment='#'
>     )


Function to write data in a file

args:
   
- file_path (string) : path for the data file, including the filename with its extension
   
- data (scalar, list or array) : the data to be written in the file
   
- delimiter (char) : the delimiter to separate the column of the data
   
- overwrite (boolean) : if True overwrite the existing file if any, if False, append the data to the existing file if any
   
- header (string) : header to be written before the data
   
- date (boolean) : date to be written at the beginning of the file
   
- comment (char) : char to be written before the header and date to indicate non-data lines




    
# Module `dopes.data_analysis.mechanics` {#dopes.data_analysis.mechanics}






    
## Functions


    
### Function `strain_from_stress` {#dopes.data_analysis.mechanics.strain_from_stress}




>     def strain_from_stress(
>         stress_tensor,
>         c11=165.77,
>         c12=63.93,
>         c44=79.62
>     )


Function to calculate the strain in silicon from a stress tensor 

args:
   
- stress_tensor (numpy array): the stress tensor for which the stress should be calculated. The voigt notation should be used with a 1 x 6 vector but the function can handle  3 x 3 matrix but only take the upper half in this case.
   
- c11, c12 and c44 (scalar): the coefficient of the compliance matrix in GPa
    
return:
   
- strain_tensor (numpy array): the strain tensor calculated of dimension 1 x 6 using the voigt notation

    
### Function `straintensor` {#dopes.data_analysis.mechanics.straintensor}




>     def straintensor(
>         strain_type,
>         strain_direction,
>         N=11,
>         emin=-0.05,
>         emax=0.05,
>         c11=165.77,
>         c12=63.93,
>         c44=79.62,
>         poisson=True
>     )


Function to calculate the strain tensor for various strain type and direction

args:
   
- strain_type (string): the type of strain. Choice between uniaxial ("uni"), biaxial ("bi"), shear ("shear") and hydrostatic ("hydro").
   
- strain_direction (string): the crystal direction and orientation of the strain. Choice between [001], [110] and [111]. For uniaxial strain, the principal strain is oriented along strain_direction while the principal stresses are perpendicular for biaxial strain.
   
- N (int): the number of strain tensor calculated linearly between emin and emax
   
- emin (scalar): the minimal value for the principal strain direction
   
- emax (scalar): the maximal value for the principal strain direction
   
- c11, c12 and c44 (scalar): the coefficient of the compliance matrix in GPa
   
- poisson (boolean): if True, take into account the poisson effect to calculate the strain tensor
    
return:
   
- strain_tensor (numpy array): array of dimensions ( 3 x 3 x N ) with the strain tensors calculated

    
### Function `straintensor_scalar` {#dopes.data_analysis.mechanics.straintensor_scalar}




>     def straintensor_scalar(
>         strain_type,
>         strain_direction,
>         eps=0,
>         c11=16.577,
>         c12=6.393,
>         c44=7.962,
>         poisson=True
>     )


Function to calculate the strain tensor for various strain type and direction

args:
   
- strain_type (string): the type of strain. Choice between uniaxial ("uni"), biaxial ("bi"), shear ("shear") and hydrostatic ("hydro").
   
- strain_direction (string): the crystal direction and orientation of the strain. Choice between [001], [110] and [111]. For uniaxial strain, the principal strain is oriented along strain_direction while the principal stresses are perpendicular for biaxial strain.
   
- eps (scalar): the value of strain in the principal strain direction
   
- c11, c12 and c44 (scalar): the coefficient of the compliance matrix in GPa
   
- poisson (boolean): if True, take into account the poisson effect to calculate the strain tensor
    
return:
   
- strain_tensor (numpy array): array of dimensions ( 3 x 3 ) with the strain tensor calculated

    
### Function `stress_from_strain` {#dopes.data_analysis.mechanics.stress_from_strain}




>     def stress_from_strain(
>         strain_tensor,
>         c11=165.77,
>         c12=63.93,
>         c44=79.62
>     )


Function to calculate the stress in silicon from a strain tensor 

args:
   
- strain_tensor (numpy array): the strain tensor for which the stress should be calculated. The voigt notation should be used with a 1 x 6 vector but the function can handle  3 x 3 matrix but only take the upper half in this case.
   
- c11, c12 and c44 (scalar): the coefficient of the compliance matrix in GPa
    
return:
   
- stress_tensor (numpy array): the stress tensor calculated of dimension 1 x 6 using the voigt notation

    
### Function `voigt_to_matrix` {#dopes.data_analysis.mechanics.voigt_to_matrix}




>     def voigt_to_matrix(
>         voigt_vector
>     )


Function to convert a vector in Voigt notation to a matrix 

args:
   
- voigt_vector (numpy array): 1D vector with 6 elements
    
return:
   
- matrix (numpy array): 2D matrix with 3 x 3 elements




    
# Module `dopes.data_analysis.polytec` {#dopes.data_analysis.polytec}






    
## Functions


    
### Function `find_max` {#dopes.data_analysis.polytec.find_max}




>     def find_max(
>         x,
>         y,
>         z,
>         kind='maximum',
>         height=None,
>         width=None
>     )


Function to find maximal values

args:
   
- x, y (array) : 1D array for the x and y position of the pixel 
   
- z (array) : 1D array with the values at position (x,y) and with the same dimension as x and y
   
- kind (string) : the method to determine the maximum. "maximum" only takes the max value of the z array while "peaks" is looking for the maximal peak. This last method is more robust with regards to outlier. The minimum height and width can be specified.
   
- height (None, scalar or 2-element sequence) : required height of peaks. Either a number, None, an array matching x or a 2-element sequence of the former. The first element is always interpreted as the minimal and the second, if supplied, as the maximal required height.
   
- width (None, scalar or 2-element sequence) : required width of peaks in samples. Either a number, None, an array matching x or a 2-element sequence of the former. The first element is always interpreted as the minimal and the second, if supplied, as the maximal required width.

return:
   
- x_max,y_max,z_max : three elements with the x, y position of the maximum value of the z array

    
### Function `medfilt_2D` {#dopes.data_analysis.polytec.medfilt_2D}




>     def medfilt_2D(
>         x,
>         y,
>         z,
>         kernel_size=9,
>         n_interp=None
>     )


Function to convert unstructured 1D data (three vectors) in 2D grid for which the z values have been filtered with a 2D median filter to remove the outliers

args:
   
- x, y (array) : 1D array for the x and y position of the pixel 
   
- z (array) : 1D array with with the values at position (x,y), and with the same dimension as x and y
   
- kernel_size (int) : size of the median filter window.    
   
- n_interp (int) : the number of points for the dimensions of the interpolation along x and y. if None, n_interp is set as the square root of the dimension of the z array
        
return:
   
- X,Y,Z : three meshgrids of the same dimension (n_interp x n_interp) with the x,y coordinates and the z values filtered. The X and Y grid are linearly spaced from the minimal and maximal valeus of x and y, respectively.

    
### Function `plot_1D_line_from_file` {#dopes.data_analysis.polytec.plot_1D_line_from_file}




>     def plot_1D_line_from_file(
>         file_path,
>         unit_mult=(1, 1),
>         use_lines=None,
>         ax=None,
>         color_list=None,
>         ls_list=None,
>         marker_list=None,
>         **plot_kwargs
>     )


Function to plot a line data from a file

args:
   
- file_path (string) : the file to read
   
- unit_mult (array) : array of three scalar to multiply the data of the x, y and z vector.
   
- use_lines (array) : list of lines to be plotted. Be careful that the number of column in the file is usually twice the number of lines (as each line has an x and z vector).
   
- ax (list of two Axes) : the axes of the subplot in which plotting the map and the color bar next to it
   
- color_list, ls_list, marker_list (array) : list of color, linestyle and marker to be used for the data lines found in the files. If the length of the list is smaller than the number of data lines, the last component is kept for the last data lines. 
   
- plot_kwargs : this method also takes any keyword argument for the Axes.plot() function
   
return:
    
- fig, ax, data : the figure with its axe and the data array read from the file. If ax is provided, only data is returned

    
### Function `plot_map` {#dopes.data_analysis.polytec.plot_map}




>     def plot_map(
>         x,
>         y,
>         z,
>         ax=None,
>         vmin=None,
>         vmax=None,
>         cmap='coolwarm',
>         medfilt=True,
>         kernel_size=9,
>         n_interp=None,
>         **contour_kwargs
>     )


Function to plot a 2D map from unstructured 1D data (three vectors)

args:
   
- x, y (array) : 1D array for the x and y position of the pixel 
   
- z (array) : 1D array with with the values at position (x,y), and with the same dimension as x and y
   
- ax (list of two Axes) : the axes of the subplot in which plotting the map and the color bar next to it
   
- vmin, vmax (scalar) : define the data range that the colormap covers. By default, the colormap covers the complete value range of the supplied data. If vmin or vmax are not given, the default color scaling is based on levels.
   
- cmap (str or Colormap) : the Colormap instance or registered colormap name used to map scalar data to colors.
   
- medfilt (boolean) : if True apply a median filter on the data by interpolating it on a n_interp x n_interp grid
   
- kernel_size (int) : size of the median filter window.    
   
- n_interp (int) : the number of points for the dimensions of the interpolation along x and y. if None, n_interp is set as the square root of the dimension of the z array
   
- contour_kwargs : this method also takes any keyword argument for the Axes.contourf() and axes.tricontourf()
   
return:
    
- fig, ax_map, ax_bar : the figure with the 2D map axe (ax_map) and the axe with the color bar (ax_bar)

    
### Function `plot_map_from_file` {#dopes.data_analysis.polytec.plot_map_from_file}




>     def plot_map_from_file(
>         file_path,
>         n_step=1,
>         unit_mult=(1, 1, 1),
>         ax=None,
>         vmin=None,
>         vmax=None,
>         cmap='coolwarm',
>         medfilt=True,
>         kernel_size=9,
>         n_interp=None,
>         **contour_kwargs
>     )


Function to plot a 2D map from a file of unstructured 1D data (three vectors x,y and z)

args:
   
- file_path (string) : the file to read
   
- n_step (int) : reduce the number of point to be plotted by taking one point each n_point index of the x, y ,z vectors
   
- unit_mult (array) : array of three scalar to multiply the data of the x, y and z vector.
   
- ax (list of two Axes) : the axes of the subplot in which plotting the map and the color bar next to it
   
- vmin, vmax (scalar) : define the data range that the colormap covers. By default, the colormap covers the complete value range of the supplied data. If vmin or vmax are not given, the default color scaling is based on levels.
   
- cmap (string or Colormap) : the Colormap instance or registered colormap name used to map scalar data to colors.
   
- medfilt (boolean) : if True apply a median filter on the data by interpolating it on a n_interp x n_interp grid
   
- kernel_size (int) : size of the median filter window.    
   
- n_interp (int) : the number of points for the dimensions of the interpolation along x and y. if None, n_interp is set as the square root of the dimension of the z array
   
- contour_kwargs : this method also takes any keyword argument for the Axes.contourf() and axes.tricontourf()
   
return:
    
- fig, ax_map, ax_bar : the figure with the 2D map axe (ax_map) and the axe with the color bar (ax_bar)

    
### Function `unstructured_to_regular` {#dopes.data_analysis.polytec.unstructured_to_regular}




>     def unstructured_to_regular(
>         x,
>         y,
>         z,
>         n_interp=None
>     )


Function to convert unstructured 1D data (three vectors) in 2D grid

args:
   
- x, y (array) : 1D array for the x and y position of the pixel 
   
- z (array) : 1D array with with the values at position (x,y), and with the same dimension as x and y
   
- n_interp (int) : the number of points for the dimensions of the interpolation along x and y. if None, n_interp is set as the square root of the dimension of the z array
        
return:
   
- X,Y,Z : three meshgrids of the same dimension (n_interp x n_interp) with the x,y coordinates and the z values interpolated. The X and Y grid are linearly spaced from the minimal and maximal valeus of x and y, respectively.




    
# Module `dopes.data_analysis.raman` {#dopes.data_analysis.raman}






    
## Functions


    
### Function `find_peaks` {#dopes.data_analysis.raman.find_peaks}




>     def find_peaks(
>         x,
>         y,
>         height=None,
>         threshold=None,
>         distance=None,
>         width=None
>     )


Function to find peaks in the Raman spectrum. Be careful that the method is not a fit put a peak detection.

args:
   
- x (array) : an array 
   
- y (array) : the signal with peaks with the same dimension as x
   
- height (None, scalar or 2-element sequence) : required height of peaks. Either a number, None, an array matching x or a 2-element sequence of the former. The first element is always interpreted as the minimal and the second, if supplied, as the maximal required height.
   
- threshold (None, scalar or 2-element sequence) : required threshold of peaks, the vertical distance to its neighboring samples. Either a number, None, an array matching x or a 2-element sequence of the former. The first element is always interpreted as the minimal and the second, if supplied, as the maximal required threshold.
   
- distance (scalar) : Required minimal horizontal distance in samples between neighbouring peaks. The distance should be higher than the step between two adjacents points from x. Smaller peaks are removed first until the condition is fulfilled for all remaining peaks.
   
- width (None, scalar or 2-element sequence) : required width of peaks in samples. Either a number, None, an array matching x or a 2-element sequence of the former. The first element is always interpreted as the minimal and the second, if supplied, as the maximal required width.

return:
   
- (positions, heights, widths) : an array of three elements with the positions, the heights and the widths of the peaks

    
### Function `find_peaks_from_file` {#dopes.data_analysis.raman.find_peaks_from_file}




>     def find_peaks_from_file(
>         file_path,
>         height=None,
>         threshold=None,
>         distance=None,
>         width=None
>     )


Function to find peaks in the Raman spectrum. Be careful that the method is not a fit put a peak detection.

args:
   
- x (array) : an array 
   
- y (array) : the signal with peaks with the same dimension as x
   
- height (None, scalar or 2-element sequence) : required height of peaks. Either a number, None, an array matching x or a 2-element sequence of the former. The first element is always interpreted as the minimal and the second, if supplied, as the maximal required height.
   
- threshold (None, scalar or 2-element sequence) : required threshold of peaks, the vertical distance to its neighboring samples. Either a number, None, an array matching x or a 2-element sequence of the former. The first element is always interpreted as the minimal and the second, if supplied, as the maximal required threshold.
   
- distance (scalar) : Required minimal horizontal distance in samples between neighbouring peaks. The distance should be higher than the step between two adjacents points from x. Smaller peaks are removed first until the condition is fulfilled for all remaining peaks.
   
- width (None, scalar or 2-element sequence) : required width of peaks in samples. Either a number, None, an array matching x or a 2-element sequence of the former. The first element is always interpreted as the minimal and the second, if supplied, as the maximal required width.

return:
   
- (positions, heights, widths) : an array of three elements with the positions, the heights and the widths of the peaks

    
### Function `phonon_deformation_silicon` {#dopes.data_analysis.raman.phonon_deformation_silicon}




>     def phonon_deformation_silicon(
>         strain_matrix,
>         p,
>         q,
>         r,
>         sort=False,
>         w0=None
>     )


Function to calculate the Raman shift from an arbitrary strain tensor using Phonon Deformation Potential (PDP) theory

args:
   
- strain_matrix (3x3 matrix) : the strain tensor
   
- p (scalar) : the first phonon deformation potential    
   
- q (scalar) : the second phonon deformation potential.    
   
- r (scalar) : the third phonon deformation potential  
   
- sort (boolean) : if true, sort the phonon modes from lowest to highest energy
   
- w0 (scalar) : reference energy at zero strain, 520.7 cm-1 for silicon
   
return:
   
- an array of three elements with the energy of the three phonon modes (LO, TO1, and TO2).

    
### Function `plot_from_file` {#dopes.data_analysis.raman.plot_from_file}




>     def plot_from_file(
>         file_path,
>         ax=None,
>         with_peaks=False,
>         with_peaks_label=False,
>         height=None,
>         threshold=None,
>         distance=None,
>         width=None,
>         **plot_kwargs
>     )


Function to plot the Raman spectrum with the peaks indicated

args:
   
- file_path (string) : the file to read
   
- ax (Axes) : the axes of the subplot in which plotting the Raman signal and peaks
   
- with_peaks (boolean) : if True, find the peaks in the spectrum and show them on the graph. Be careful that the method is not a fit put a peak detection.
   
- with_peaks_label (boolean) : if True, write the value of the peaks above each of them
   
- height (None, scalar or 2-element sequence) : required height of peaks. Either a number, None, an array matching x or a 2-element sequence of the former. The first element is always interpreted as the minimal and the second, if supplied, as the maximal required height.
   
- threshold (None, scalar or 2-element sequence) : required threshold of peaks, the vertical distance to its neighboring samples. Either a number, None, an array matching x or a 2-element sequence of the former. The first element is always interpreted as the minimal and the second, if supplied, as the maximal required threshold.
   
- distance (scalar) : Required minimal horizontal distance in samples between neighbouring peaks. The distance should be higher than the step between two adjacents points from x. Smaller peaks are removed first until the condition is fulfilled for all remaining peaks.
   
- width (None, scalar or 2-element sequence) : required width of peaks in samples. Either a number, None, an array matching x or a 2-element sequence of the former. The first element is always interpreted as the minimal and the second, if supplied, as the maximal required width.
   
- **plot_kwargs : this method also takes any keyword argument for the Axes.plot() function such as linewidth, linestyle, marker, markersize, color, markeredgecolor, zorder, alpha, label, clip_on, ...
    
return:
   
- fig, ax : the Figure and Axes object created if None is specified for ax

    
### Function `plot_from_multiple_files` {#dopes.data_analysis.raman.plot_from_multiple_files}




>     def plot_from_multiple_files(
>         file_paths,
>         with_peaks=False,
>         with_peaks_label=False,
>         height=None,
>         threshold=None,
>         distance=None,
>         width=None,
>         sharey=False,
>         ylabel=None,
>         **plot_kwargs
>     )


Function to plot the Raman spectrum with the peaks indicated

args:
   
- file_paths (list of string) : lis of the names for the files to read
   
- ax (Axes) : the axes of the subplot in which plotting the Raman signal and peaks
   
- with_peaks (boolean) : if True, find the peaks in the spectrum and show them on the graph. Be careful that the method is not a fit put a peak detection.
   
- with_peaks_label (boolean) : if True, write the value of the peaks above each of them
   
- height (None, scalar or 2-element sequence) : required height of peaks. Either a number, None, an array matching x or a 2-element sequence of the former. The first element is always interpreted as the minimal and the second, if supplied, as the maximal required height.
   
- threshold (None, scalar or 2-element sequence) : required threshold of peaks, the vertical distance to its neighboring samples. Either a number, None, an array matching x or a 2-element sequence of the former. The first element is always interpreted as the minimal and the second, if supplied, as the maximal required threshold.
   
- distance (scalar) : Required minimal horizontal distance in samples between neighbouring peaks. The distance should be higher than the step between two adjacents points from x. Smaller peaks are removed first until the condition is fulfilled for all remaining peaks.
   
- width (None, scalar or 2-element sequence) : required width of peaks in samples. Either a number, None, an array matching x or a 2-element sequence of the former. The first element is always interpreted as the minimal and the second, if supplied, as the maximal required width.
   
- **plot_kwargs : this method also takes any keyword argument for the Axes.plot() function such as linewidth, linestyle, marker, markersize, color, markeredgecolor, zorder, alpha, label, clip_on, ...
    
return:
   
- fig, ax : the Figure and a list with the axes object created

    
### Function `plot_with_peaks` {#dopes.data_analysis.raman.plot_with_peaks}




>     def plot_with_peaks(
>         x,
>         y,
>         ax=None,
>         height=None,
>         threshold=None,
>         distance=None,
>         width=None,
>         with_peaks_label=False,
>         **plot_kwargs
>     )


Function to plot the Raman spectrum with the peaks indicated.  Be careful that the method is not a fit put a peak detection.

args:
   
- x (array) : an array for the energy of the Raman spectrum
   
- y (array) : the Raman signal with peaks with the same dimension as x
   
- ax (Axes) : the axes of the subplot in which plotting the Raman signal and peaks
   
- height (None, scalar or 2-element sequence) : required height of peaks. Either a number, None, an array matching x or a 2-element sequence of the former. The first element is always interpreted as the minimal and the second, if supplied, as the maximal required height.
   
- threshold (None, scalar or 2-element sequence) : required threshold of peaks, the vertical distance to its neighboring samples. Either a number, None, an array matching x or a 2-element sequence of the former. The first element is always interpreted as the minimal and the second, if supplied, as the maximal required threshold.
   
- distance (scalar) : Required minimal horizontal distance in samples between neighbouring peaks. The distance should be higher than the step between two adjacents points from x. Smaller peaks are removed first until the condition is fulfilled for all remaining peaks.
   
- width (None, scalar or 2-element sequence) : required width of peaks in samples. Either a number, None, an array matching x or a 2-element sequence of the former. The first element is always interpreted as the minimal and the second, if supplied, as the maximal required width.
   
- with_peaks_label (boolean) : if True, write the value of the peaks above each of them
   
- **plot_kwargs : this method also takes any keyword argument for the Axes.plot() function such as linewidth, linestyle, marker, markersize, color, markeredgecolor, zorder, alpha, label, clip_on, ...
    
return:
   
- fig, ax : the Figure and Axes object created if None is specified for ax




    
# Module `dopes.data_analysis.semiconductor` {#dopes.data_analysis.semiconductor}






    
## Functions


    
### Function `intrinsic_concentration` {#dopes.data_analysis.semiconductor.intrinsic_concentration}




>     def intrinsic_concentration(
>         temp
>     )


Function to calculate the intrinsic concentration of silicon from K. Misiakos and Tsamakis, D., ôAccurate measurements of the silicon intrinsic carrier density from 78 to 340 Kö, Journal of Applied Physics, vol. 74, no. 5, p. 3293, 1993.

args:
   
- temp (scalar): the temperature 
    
return:
   
- ni (scalar): the intrinsic concentration in silicon

    
### Function `mobility_impurity` {#dopes.data_analysis.semiconductor.mobility_impurity}




>     def mobility_impurity(
>         mu_0,
>         carrier='n',
>         Ni=1000000000000000.0,
>         temp=300,
>         dopant='phosphorus'
>     )


Function to calculate the silicon mobility according to Masetti relation (1983)

args:
   
- carrier (string): "n" for electrons, "p" for holes
   
- temp (scalar): the temperature 
   
- Ni (scalar): the impurity cencentration in cm-3
   
- dopant (string): the type of n-type dopant. "phosphorus" or "arsenic"
    
return:
   
- mu_LI (scalar): the electron or hole mobility with the impurity scattering taken into account

    
### Function `piezo_ratio_temperature` {#dopes.data_analysis.semiconductor.piezo_ratio_temperature}




>     def piezo_ratio_temperature(
>         temp,
>         carrier='n'
>     )


Function to calculate the correcting ratio due to temperature variations for the piezoresistive coefficients. The data are taken from Kanda (1982) between 200 K and 400K.
The correction is refered to the 300K coefficients. The new piezoresistive coefficients can be calculated by piezo_coefficient(temp) = ratio * piezo_coefficient(300K)

args:
   
- temp (scalar or sequence): the temperatures for which the correting ratio has to be calculated
   
- carrier (string): "n" for electrons, "p" for holes
        
return:
   
- a scalar or sequence with the same dimension as temp with the correcting ratio

    
### Function `piezoresistivity_strain` {#dopes.data_analysis.semiconductor.piezoresistivity_strain}




>     def piezoresistivity_strain(
>         strain_tensor,
>         pi11,
>         pi12,
>         pi44
>     )


Function to calculate the relative change due to stress in silicon

args:
   
- stress_tensor (numpy array): the stress tensor for which the stress should be calculated. The voigt notation should be used with a 1 x 6 vector but the function can handle  3 x 3 matrix but only take the upper half in this case.
   
- pi11, pi12 and pi44 (scalar): piezoresistive coefficients used to calculate the variations in the relative resistivity. 
      Values from Smith (1954) are pi11 = -1022 TPa-1, pi12 = 534 TPa-1 and pi44 = -136 TPa-1 for the electrons,
      and pi11 = 66 TPa-1, pi12 = -11 TPa-1 and pi44 = 1381 TPa-1 for the holes.
        
return:
   
- an 1 x 6 tensor using the Voigt notation with the relative variation of the resistivity.

    
### Function `piezoresistivity_stress` {#dopes.data_analysis.semiconductor.piezoresistivity_stress}




>     def piezoresistivity_stress(
>         stress_tensor,
>         pi11,
>         pi12,
>         pi44
>     )


Function to calculate the relative change due to stress in silicon

args:
   
- stress_tensor (numpy array): the stress tensor for which the stress should be calculated. The voigt notation should be used with a 1 x 6 vector but the function can handle  3 x 3 matrix but only take the upper half in this case.
   
- pi11, pi12 and pi44 (scalar): piezoresistive coefficients used to calculate the variations in the relative resistivity. 
      Values from Smith (1954) are pi11 = -1022 TPa-1, pi12 = 534 TPa-1 and pi44 = -136 TPa-1 for the electrons,
      and pi11 = 66 TPa-1, pi12 = -11 TPa-1 and pi44 = 1381 TPa-1 for the holes.
        
return:
   
- an 1 x 6 tensor using the Voigt notation with the relative variation of the resistivity.

    
### Function `tau_srh` {#dopes.data_analysis.semiconductor.tau_srh}




>     def tau_srh(
>         Ni,
>         tau_0=5e-05,
>         Nc=5e+16,
>         A=1,
>         B=1,
>         C=0,
>         E=0
>     )


Function to calculate the SRH lifetime of silicon. The default parameters, similar for electron and hole, are those from D'Avanzo, D. C., Vanzi, M., Dutton, R. W.: One-Dimensional Semiconductor Device Analysis
(SEDAN). Report G-201-5, Stanford University, 1979.

args:
   
- Ni (scalar): the impurity density in the material 
   
- tau_0 (scalar): intial value for the lifetime 
   
- Nc (scalar): the critical impurity level 
   
- A, B, C and D (scalar): the coefficient for the model 
    
return:
   
- the SRH lifetime in silicon

    
### Function `tau_trap` {#dopes.data_analysis.semiconductor.tau_trap}




>     def tau_trap(
>         tau_n,
>         tau_p,
>         NA,
>         ND,
>         Etrap=0.56,
>         Eg=1.12,
>         temp=300
>     )


Function to calculate the lifetime of silicon due to a trap.

args:
   
- tau_n and tau_p (scalar): the life time of the electron and hole due to the trap density. 
      The lifetime can be calculated by tau_n = 1 / (sigma_n * v_th * Nt ) where sigma_n is the capture cross section, vth is the thermal velocity and Nt is the trap density. 
      Typical values for the thermal velocities are 2.3e7 and 1.65e7 cm/s for the electrons and holes, respectively. 
      Typical value for the capture cross section is 1e-15 cm▓ for a neutral defect. 
      Typical value for the trap density is 1e12 cm-3 for a neutral defect.  
   
- NA and ND (scalar): the acceptor and donor density of the pn junction 
   
- Etrap (scalar): the trap level referred to the maximum of the valence band 
   
- Eg (scalar): the bandgap of the material 
   
- temp (scalar): the temperature 
    
return:
   
- the trap lifetime




    
# Module `dopes.data_analysis.transistor` {#dopes.data_analysis.transistor}






    
## Functions


    
### Function `mos_transistor_current` {#dopes.data_analysis.transistor.mos_transistor_current}




>     def mos_transistor_current(
>         vg,
>         vd,
>         vs=0,
>         vth=0.8,
>         k=0.0001,
>         vea=50,
>         theta=0,
>         mos_type='nmos',
>         early=True
>     )


Function to calculate the current in a MOS transistor:
           
       - cutoff (vgs < vth) : ids = 0
           
       - triode (vgs
       - vth >= vds) : ids = k * ( (vgs-vth) * vds
       - vds**2/2) * (1+(vds)/vea)
           
       - saturation (vgs
       - vth < vds)  : ids = k/2 * ( (vgs-vth)**2) * (1+(vds)/vea)
       
with k = "mobility" * "oxide capacitance" * "width" / "length" where the oxide capacitance is given by the ratio between the permittivity and the oxide thickness, i.e., Cox = epsilon_r * epsilon_0 / t_ox
       The mobility degradation is taken into account by replacing k by k / (1 + theta * (vgs
       - vth)) in the current equation.
       
       args:
          
       - vg (scalar or sequence): gate voltage of the transistor. Maximum one parameter among vg, vd and vs can be a sequence.
          
       - vd (scala or sequence): drain voltage of the transistor. Maximum one parameter among vg, vd and vs can be a sequence.
          
       - vs (scalar or sequence): source voltage of the transistor. Maximum one parameter among vg, vd and vs can be a sequence.
          
       - vth (scalar): threshold voltage of the transistor
          
       - k (scalar): the gain factor of the transistor
          
       - vea (scalar) : early voltage of the transistor
          
       - theta (scalar) : mobility degradation factor
           
       return:
          
       - a scalar or sequence with the value of current calculated

    
### Function `threshold_voltage_extraction` {#dopes.data_analysis.transistor.threshold_voltage_extraction}




>     def threshold_voltage_extraction(
>         ids,
>         vgs,
>         accuracy=4
>     )


Function to find the threshold voltage of a transistor defined as the voltage where the transconductance gm is maximum, i.e., when the first derivative of the current is maximum or when the second derivative is zero.
The method is based on the second-derivative method from Wong HS, White MH, Krutsick TJ, Booth RV. "Modeling of transconductance degradation and extraction of threshold voltage in thin oxide MOSFETÆs." Solid-State Electron (1987).
The transistor should be put in linear region (VDS <= VGS-Vth), i.e., with low VDS bias.
The implementation is based on central finite difference to limit the impact of noise for the determination of the threshold voltage.
The numerical derivative is done on accuracy + 1 points, but accuracy should be even

args:
   
- ids (scalar): the source to drain current of the transistor (nmos or pmos)
   
- vgs (scalar): the voltage between the gate and the source of the transistor (nmos or pmos) 
   
- accuracy (integer): related to the number of points taken for the finite difference. For central finite difference, the number of points for a first order derivation is accuracy + 1 but accuracy should be even to guarantee a centered interval.
    
return:
   
- a tuple of two scalars with the threshold voltage found and the transconductance value found at this voltage




    
# Module `dopes.equipment_control` {#dopes.equipment_control}




    
## Sub-modules

* [dopes.equipment_control.cm110](#dopes.equipment_control.cm110)
* [dopes.equipment_control.dmm](#dopes.equipment_control.dmm)
* [dopes.equipment_control.equipment](#dopes.equipment_control.equipment)
* [dopes.equipment_control.hp4145](#dopes.equipment_control.hp4145)
* [dopes.equipment_control.k2400](#dopes.equipment_control.k2400)
* [dopes.equipment_control.k2450](#dopes.equipment_control.k2450)
* [dopes.equipment_control.k4200](#dopes.equipment_control.k4200)
* [dopes.equipment_control.kal100](#dopes.equipment_control.kal100)
* [dopes.equipment_control.mecom](#dopes.equipment_control.mecom)
* [dopes.equipment_control.meerstetterTEC](#dopes.equipment_control.meerstetterTEC)
* [dopes.equipment_control.oscilloscope](#dopes.equipment_control.oscilloscope)
* [dopes.equipment_control.pm100d](#dopes.equipment_control.pm100d)
* [dopes.equipment_control.sh242](#dopes.equipment_control.sh242)
* [dopes.equipment_control.signal_generator](#dopes.equipment_control.signal_generator)






    
# Module `dopes.equipment_control.cm110` {#dopes.equipment_control.cm110}







    
## Classes


    
### Class `cm110` {#dopes.equipment_control.cm110.cm110}




>     class cm110(
>         port
>     )


Class to control CM110 monochromator

Function called when an instance of the class is created

    args:
        
- port (string) : the computer port to which the equipment is connected


    
#### Ancestors (in MRO)

* [dopes.equipment_control.equipment.equipment](#dopes.equipment_control.equipment.equipment)



    
#### Class variables


    
##### Variable `company` {#dopes.equipment_control.cm110.cm110.company}






    
##### Variable `model` {#dopes.equipment_control.cm110.cm110.model}






    
##### Variable `url` {#dopes.equipment_control.cm110.cm110.url}









    
#### Methods


    
##### Method `close_connection` {#dopes.equipment_control.cm110.cm110.close_connection}




>     def close_connection(
>         self
>     )


Function to close the  serial connection with the equipment

    
##### Method `initialize` {#dopes.equipment_control.cm110.cm110.initialize}




>     def initialize(
>         self,
>         grating_number=1,
>         waiting_time=30
>     )


Function to initialize the CM110

    args:
        
- grating_number (int) : select the grating (Grating 1 : AG2400-00240-303 (2400 G/mm and 180 nm - 680 nm) and Grating 2 : AG1200-00750-303 (1200 G/mm and 480 nm - 1500 nm))
        
- waiting_time (int) : waiting time in seconds after changing the grating and reset to the initial position

    
##### Method `select_grating` {#dopes.equipment_control.cm110.cm110.select_grating}




>     def select_grating(
>         self,
>         grating_number,
>         waiting_time=30
>     )


Function to select the gratin
       
- grating_number (int) : select the grating (Grating 1 : AG2400-00240-303 (2400 G/mm and 180 nm - 680 nm) and Grating 2 : AG1200-00750-303 (1200 G/mm and 480 nm - 1500 nm))
       
- waiting_time (int) : waiting time in seconds after changing the grating and reset to the initial position

    
##### Method `set_wavelength` {#dopes.equipment_control.cm110.cm110.set_wavelength}




>     def set_wavelength(
>         self,
>         wavelength,
>         waiting_time=5
>     )


Function to set the wavelength of the monochromator

    args:
       
- wavelength (scalar) : targeted wavelength in nm
       
- waiting_time : waiting time in seconds to let the grating of the monochromator reach the targeted wavelength



    
# Module `dopes.equipment_control.dmm` {#dopes.equipment_control.dmm}







    
## Classes


    
### Class `dmm` {#dopes.equipment_control.dmm.dmm}




>     class dmm(
>         address,
>         rm=None,
>         timeout=10000.0
>     )


Class to control digital multimeter

Function called when an instance of the class is created

    args:
       
- address (string) : the address of the equipment to be connected
       
- rm (pyvisa object) : the pyvisa resource manager used to set the communication with the equipment
       
- timeout (scalar) : the timeout set for the communication with the equipment


    
#### Ancestors (in MRO)

* [dopes.equipment_control.equipment.equipment](#dopes.equipment_control.equipment.equipment)



    
#### Class variables


    
##### Variable `company` {#dopes.equipment_control.dmm.dmm.company}






    
##### Variable `model` {#dopes.equipment_control.dmm.dmm.model}






    
##### Variable `url` {#dopes.equipment_control.dmm.dmm.url}









    
#### Methods


    
##### Method `initialize` {#dopes.equipment_control.dmm.dmm.initialize}




>     def initialize(
>         self,
>         mode,
>         autozero=True,
>         nplc=1,
>         timeout=10000.0,
>         digits=6,
>         continuous_trigger=False,
>         disp_enable=True,
>         k2000=False
>     )


Function to initialize the K2400 SMU  with the desired settings

    args:
       
- mode (string) : measurement mode of the multimeter ("current", "voltage", "resistance" or "4 wires")
       
- autozero (boolean) : if true, enable autozero of the SMU
       
- nplc (scalar) : set NPLC to set the integration time for the measurement. For a NPLC of 1, the integration period would be 1/50 (for 50Hz line power) which is 20 msec
       
- digits (int) : display resolution in number of bits
       
- continuous_trigger (boolean) : if true, the display of the equipment does not freeze after a measurement. When disabled, the instrument operates at a higher speed
       
- disp_enable (boolean) : if true, enable the front panel display circuitry. When disabled, the instrument operates at a higher speed
       
- k2000 (boolean) : if true send instruction formatted for k2000 multimeter, otherwise send instruction for more recent multimeter such as DMM6500 and DMM7510

    
##### Method `read_single` {#dopes.equipment_control.dmm.dmm.read_single}




>     def read_single(
>         self
>     )


Function to read a single measurement data. The output is turn off at the end of the measurement only if continuous_trigger and output_state have been initialized as false and off

    return:
       
- data (float) : float with the value of the measurement



    
# Module `dopes.equipment_control.equipment` {#dopes.equipment_control.equipment}






    
## Functions


    
### Function `available_connections` {#dopes.equipment_control.equipment.available_connections}




>     def available_connections(
>         rm=None
>     )


Function that return the list of resource connected to the computer

    
### Function `resource_manager` {#dopes.equipment_control.equipment.resource_manager}




>     def resource_manager()


Function that return a pyvisa resource manager to deal with resources connected to the computer

    
### Function `write_in_file` {#dopes.equipment_control.equipment.write_in_file}




>     def write_in_file(
>         file_path,
>         data,
>         delimiter=',',
>         overwrite=False,
>         header=None,
>         date=True,
>         comment='#'
>     )


Function to write data in a file

args:
   
- file_path (string) : path for the data file, including the filename with its extension
   
- data (scalar, list or array) : the data to be written in the file
   
- delimiter (char) : the delimiter to separate the column of the data
   
- overwrite (boolean) : if True overwrite the existing file if any, if False, append the data to the existing file if any
   
- header (string) : header to be written before the data
   
- date (boolean) : date to be written at the beginning of the file
   
- comment (char) : char to be written before the header and date to indicate non-data lines


    
## Classes


    
### Class `equipment` {#dopes.equipment_control.equipment.equipment}




>     class equipment(
>         address,
>         rm=None,
>         timeout=10000.0
>     )


Parent class for all the equipment classes.

Function called when an instance of the class is created

    args:
       
- address (string) : the address of the equipment to be connected
       
- rm (pyvisa object) : the pyvisa resource manager used to set the communication with the equipment
       
- timeout (scalar) : the timeout set for the communication with the equipment



    
#### Descendants

* [dopes.equipment_control.cm110.cm110](#dopes.equipment_control.cm110.cm110)
* [dopes.equipment_control.dmm.dmm](#dopes.equipment_control.dmm.dmm)
* [dopes.equipment_control.hp4145.hp4145](#dopes.equipment_control.hp4145.hp4145)
* [dopes.equipment_control.k2400.k2400](#dopes.equipment_control.k2400.k2400)
* [dopes.equipment_control.k2450.k2450](#dopes.equipment_control.k2450.k2450)
* [dopes.equipment_control.k4200.k4200](#dopes.equipment_control.k4200.k4200)
* [dopes.equipment_control.kal100.kal100](#dopes.equipment_control.kal100.kal100)
* [dopes.equipment_control.oscilloscope.oscilloscope](#dopes.equipment_control.oscilloscope.oscilloscope)
* [dopes.equipment_control.pm100d.pm100d](#dopes.equipment_control.pm100d.pm100d)
* [dopes.equipment_control.sh242.sh242](#dopes.equipment_control.sh242.sh242)
* [dopes.equipment_control.signal_generator.signal_generator](#dopes.equipment_control.signal_generator.signal_generator)





    
#### Methods


    
##### Method `close_connection` {#dopes.equipment_control.equipment.equipment.close_connection}




>     def close_connection(
>         self
>     )


Function to close the connection with an equipment

    
##### Method `set_connection_parameter` {#dopes.equipment_control.equipment.equipment.set_connection_parameter}




>     def set_connection_parameter(
>         self,
>         key,
>         value
>     )


Function to change a parameter of the communication with the equipment

    args:
       
- key (string) : the parameter to be modifier 
       
- value (scalar) : the value for the parameter

    
##### Method `set_connection_parameter_dic` {#dopes.equipment_control.equipment.equipment.set_connection_parameter_dic}




>     def set_connection_parameter_dic(
>         self,
>         connection_parameter
>     )


Function to change a parameter of the communication with the equipment

    args:
       
- connection_parameter (dictionary) = dictionary with key and value to be sent to function set_connection_parameter(key,value)



    
# Module `dopes.equipment_control.hp4145` {#dopes.equipment_control.hp4145}







    
## Classes


    
### Class `hp4145` {#dopes.equipment_control.hp4145.hp4145}




>     class hp4145(
>         address,
>         rm=None,
>         timeout=10000.0
>     )


Class to control HP4145 semiconductor analyzer

Function called when an instance of the class is created

    args:
       
- address (string) : the address of the equipment to be connected
       
- rm (pyvisa object) : the pyvisa resource manager used to set the communication with the equipment
       
- timeout (scalar) : the timeout set for the communication with the equipment


    
#### Ancestors (in MRO)

* [dopes.equipment_control.equipment.equipment](#dopes.equipment_control.equipment.equipment)



    
#### Class variables


    
##### Variable `company` {#dopes.equipment_control.hp4145.hp4145.company}






    
##### Variable `model` {#dopes.equipment_control.hp4145.hp4145.model}






    
##### Variable `url` {#dopes.equipment_control.hp4145.hp4145.url}









    
#### Methods


    
##### Method `initialize` {#dopes.equipment_control.hp4145.hp4145.initialize}




>     def initialize(
>         self,
>         smu_type={'SMU1': 'voltage', 'SMU2': 'voltage', 'SMU3': 'common', 'SMU4': 'common'},
>         smu_used={'SMU1': 'on', 'SMU2': 'on', 'SMU3': 'on', 'SMU4': 'on'},
>         smu_master=1,
>         smu_bias={'SMU1': 0, 'SMU2': 0, 'SMU3': 0, 'SMU4': 0},
>         smu_compliance={'SMU1': 1e-06, 'SMU2': 1e-06, 'SMU3': 1e-06, 'SMU4': 1e-06},
>         sweep_param={'start': 0, 'stop': 0, 'step': 0},
>         sweep_type='linear',
>         integration_mode='S',
>         delay_time=0,
>         hold_time=0
>     )


Function to initialize the HP4145 equipment with the desired settings

    args:
       
- smu_type (dictionary) : dictionary indicated for each SMU ("SMU1","SMU2","SMU3" and "SMU4") the bias type ("voltage", "current" or "common")
       
- smu_used (dictionary) : dictionary indicated for each SMU ("SMU1","SMU2","SMU3" and "SMU4") if active or not ("on" or "off")
       
- smu_master (int) : integer to indicate which SMU performs the sweep
       
- smu_bias (dictionary) : dictionary indicated for each SMU ("SMU1","SMU2","SMU3" and "SMU4") the bias point (scalar)
       
- smu_compliance (dictionary) : dictionary indicated for each SMU ("SMU1","SMU2","SMU3" and "SMU4") the compliance (scalar)
       
- sweep_param (dictionary) : dictionary indicated the starting bias ("start"), the stoping bias ("stop") and step ("step") of the sweep
       
- sweep_type (string) : string to indicate linear ("linear") sweep or logarithmic ("log") sweep
       
- integration_mode (string) : set the integration time parameter ("S" for short, "M" for medium and "L" for long)
       
- delay_time (scalar) : the time to wait between when the output voltage is set and when the measurement is made in a sweep
       
- hold_time (scalar) : hold time that delays the start of a sweep

    
##### Method `launch_measurements` {#dopes.equipment_control.hp4145.hp4145.launch_measurements}




>     def launch_measurements(
>         self
>     )


Function to launch the measurement and return the data (in array shape) and the header (string) depending on the measurement configuration

    return:
       
- data (array) : array with the measurement data
       
- header (string) : string with the description of the data column "Vx" or "Ix" for voltage or current measured from SMUx.



    
# Module `dopes.equipment_control.k2400` {#dopes.equipment_control.k2400}







    
## Classes


    
### Class `k2400` {#dopes.equipment_control.k2400.k2400}




>     class k2400(
>         address,
>         rm=None,
>         timeout=10000.0
>     )


Class to control K2400 SMU

Function called when an instance of the class is created

    args:
       
- address (string) : the address of the equipment to be connected
       
- rm (pyvisa object) : the pyvisa resource manager used to set the communication with the equipment
       
- timeout (scalar) : the timeout set for the communication with the equipment


    
#### Ancestors (in MRO)

* [dopes.equipment_control.equipment.equipment](#dopes.equipment_control.equipment.equipment)



    
#### Class variables


    
##### Variable `company` {#dopes.equipment_control.k2400.k2400.company}






    
##### Variable `model` {#dopes.equipment_control.k2400.k2400.model}






    
##### Variable `url` {#dopes.equipment_control.k2400.k2400.url}









    
#### Methods


    
##### Method `initialize` {#dopes.equipment_control.k2400.k2400.initialize}




>     def initialize(
>         self,
>         source_mode,
>         measurement_mode,
>         compliance,
>         autozero=True,
>         nplc=1,
>         digits=6,
>         continuous_trigger=False,
>         disp_enable=True
>     )


Function to initialize the K2400 SMU  with the desired settings

    args:
       
- source_mode (string) : source mode of the SMU ("current" or "voltage")
       
- measurement_mode (string) : measurement mode of the SMU ("current", "voltage" or "resistance")
       
- compliance (scalar) : compliance of the source
       
- autozero (boolean) : if true, enable autozero of the SMU
       
- nplc (scalar) : set NPLC to set the integration time for the measurement. For a NPLC of 1, the integration period would be 1/50 (for 50Hz line power) which is 20 msec
       
- digits (int) : display resolution in number of bits
       
- continuous_trigger (boolean) : if true, the display of the equipment does not freeze after a measurement. When disabled, the instrument operates at a higher speed
       
- disp_enable (boolean) : if true, enable the front panel display circuitry. When disabled, the instrument operates at a higher speed

    
##### Method `read_buffer` {#dopes.equipment_control.k2400.k2400.read_buffer}




>     def read_buffer(
>         self
>     )


Function to read the measurement buffer

    return:
       
- data (list) : list of floats of the measurements taken by the instruments.

    
##### Method `read_single` {#dopes.equipment_control.k2400.k2400.read_single}




>     def read_single(
>         self
>     )


Function to read a single measurement data. The output is turn off at the end of the measurement only if continuous_trigger and output_state have been initialized as false and off

    return:
       
- data (float) : float with the value of the measurement

    
##### Method `set_buffer_list` {#dopes.equipment_control.k2400.k2400.set_buffer_list}




>     def set_buffer_list(
>         self,
>         bias_list
>     )


Function to set the buffer measurements in list mode

    args:
       
- bias_list (1D array) : the list of bias points for the measurements. The maximal size of the list is 2500

    
##### Method `set_buffer_sweep` {#dopes.equipment_control.k2400.k2400.set_buffer_sweep}




>     def set_buffer_sweep(
>         self,
>         start,
>         stop,
>         buffer_point
>     )


Function to set the buffer measurements in (linear) sweep mode

    args:
       
- start (scalar) : the starting value for the voltage or current sweep
       
- stop (scalar) : the ending value for the voltage or current sweep
       
- buffer_point (integer) : the number of points for the sweep.

    
##### Method `set_output` {#dopes.equipment_control.k2400.k2400.set_output}




>     def set_output(
>         self,
>         output_state='ON'
>     )


Function to set the state of the outpute 

    args:
       
- output_state (string) : "ON" and "OFF" to turn the output on or off

    
##### Method `set_source` {#dopes.equipment_control.k2400.k2400.set_source}




>     def set_source(
>         self,
>         value
>     )


Function to set the source bias

    args:
       
- value (scalar) : value of the bias point

    
##### Method `start_buffer` {#dopes.equipment_control.k2400.k2400.start_buffer}




>     def start_buffer(
>         self,
>         wait=1
>     )


Function to start the measurements using the internal buffer of the equipment. 

    args:
       
- wait (scalar) : the small waiting time that could be set to avoid synchronisation issue.



    
# Module `dopes.equipment_control.k2450` {#dopes.equipment_control.k2450}







    
## Classes


    
### Class `k2450` {#dopes.equipment_control.k2450.k2450}




>     class k2450(
>         address,
>         rm=None,
>         timeout=10000.0
>     )


Class to control k2450 SMU

Function called when an instance of the class is created

    args:
       
- address (string) : the address of the equipment to be connected
       
- rm (pyvisa object) : the pyvisa resource manager used to set the communication with the equipment
       
- timeout (scalar) : the timeout set for the communication with the equipment


    
#### Ancestors (in MRO)

* [dopes.equipment_control.equipment.equipment](#dopes.equipment_control.equipment.equipment)



    
#### Class variables


    
##### Variable `company` {#dopes.equipment_control.k2450.k2450.company}






    
##### Variable `model` {#dopes.equipment_control.k2450.k2450.model}






    
##### Variable `url` {#dopes.equipment_control.k2450.k2450.url}









    
#### Methods


    
##### Method `initialize` {#dopes.equipment_control.k2450.k2450.initialize}




>     def initialize(
>         self,
>         source_mode,
>         measurement_mode,
>         compliance,
>         autozero=True,
>         nplc=1,
>         digits=6,
>         continuous_trigger=False,
>         disp_enable=True
>     )


Function to initialize the K2400 SMU  with the desired settings

    args:
       
- source_mode (string) : source mode of the SMU ("current" or "voltage")
       
- measurement_mode (string) : measurement mode of the SMU ("current", "voltage" or "resistance")
       
- compliance (scalar) : compliance of the source
       
- autozero (boolean) : if true, enable autozero of the SMU
       
- nplc (scalar) : set NPLC to set the integration time for the measurement. For a NPLC of 1, the integration period would be 1/50 (for 50Hz line power) which is 20 msec
       
- digits (int) : display resolution in number of bits
       
- continuous_trigger (boolean) : if true, the display of the equipment does not freeze after a measurement. When disabled, the instrument operates at a higher speed
       
- disp_enable (boolean) : if true, enable the front panel display circuitry. When disabled, the instrument operates at a higher speed

    
##### Method `read_single` {#dopes.equipment_control.k2450.k2450.read_single}




>     def read_single(
>         self
>     )


Function to read a single measurement data. The output is turn off at the end of the measurement only if continuous_trigger and output_state have been initialized as false and off

    return:
       
- data (float) : float with the value of the measurement

    
##### Method `set_output` {#dopes.equipment_control.k2450.k2450.set_output}




>     def set_output(
>         self,
>         output_state='ON'
>     )


Function to set the state of the outpute 

    args:
       
- output_state (string) : "ON" and "OFF" to turn the output on or off

    
##### Method `set_source` {#dopes.equipment_control.k2450.k2450.set_source}




>     def set_source(
>         self,
>         value
>     )


Function to set the source bias

    args:
       
- value (scalar) : value of the bias point



    
# Module `dopes.equipment_control.k4200` {#dopes.equipment_control.k4200}







    
## Classes


    
### Class `k4200` {#dopes.equipment_control.k4200.k4200}




>     class k4200(
>         address,
>         rm=None,
>         timeout=10000.0
>     )


Class to control K4200 semiconductor analyzer

Function called when an instance of the class is created

    args:
       
- address (string) : the address of the equipment to be connected
       
- rm (pyvisa object) : the pyvisa resource manager used to set the communication with the equipment
       
- timeout (scalar) : the timeout set for the communication with the equipment


    
#### Ancestors (in MRO)

* [dopes.equipment_control.equipment.equipment](#dopes.equipment_control.equipment.equipment)



    
#### Class variables


    
##### Variable `company` {#dopes.equipment_control.k4200.k4200.company}






    
##### Variable `model` {#dopes.equipment_control.k4200.k4200.model}






    
##### Variable `url` {#dopes.equipment_control.k4200.k4200.url}









    
#### Methods


    
##### Method `initialize` {#dopes.equipment_control.k4200.k4200.initialize}




>     def initialize(
>         self,
>         smu_type={'SMU1': 'voltage', 'SMU2': 'voltage', 'SMU3': 'common', 'SMU4': 'common'},
>         smu_used={'SMU1': 'on', 'SMU2': 'on', 'SMU3': 'on', 'SMU4': 'on'},
>         smu_master=1,
>         smu_bias={'SMU1': 0, 'SMU2': 0, 'SMU3': 0, 'SMU4': 0},
>         smu_compliance={'SMU1': 1e-06, 'SMU2': 1e-06, 'SMU3': 1e-06, 'SMU4': 1e-06},
>         sweep_param={'start': 0, 'stop': 0, 'step': 0},
>         sweep_type='linear',
>         integration_mode='S',
>         delay_time=0,
>         hold_time=0
>     )


Function to initialize the K4200 equipment with the desired settings

    args:
       
- smu_type (dictionary) : dictionary indicated for each SMU ("SMU1","SMU2","SMU3" and "SMU4") the bias type ("voltage", "current" or "common")
       
- smu_used (dictionary) : dictionary indicated for each SMU ("SMU1","SMU2","SMU3" and "SMU4") if active or not ("on" or "off")
       
- smu_master (int) : integer to indicate which SMU performs the sweep
       
- smu_bias (dictionary) : dictionary indicated for each SMU ("SMU1","SMU2","SMU3" and "SMU4") the bias point (scalar)
       
- smu_compliance (dictionary) : dictionary indicated for each SMU ("SMU1","SMU2","SMU3" and "SMU4") the compliance (scalar)
       
- sweep_param (dictionary) : dictionary indicated the starting bias ("start"), the stoping bias ("stop") and step ("step") of the sweep
       
- sweep_type (string) : string to indicate linear ("linear") sweep or logarithmic ("log") sweep
       
- integration_mode (string) : set the integration time parameter ("S" for short, "M" for medium and "L" for long)
       
- delay_time (scalar) : the time to wait between when the output voltage is set and when the measurement is made in a sweep
       
- hold_time (scalar) : hold time that delays the start of a sweep

    
##### Method `launch_measurements` {#dopes.equipment_control.k4200.k4200.launch_measurements}




>     def launch_measurements(
>         self
>     )


Function that launch the measurement and return the data (in array shape) and the header (string) depending on the measurement configuration

    return:
       
- data (array) : array with the measurement data
       
- header (string) : string with the description of the data column "Vx" or "Ix" for voltage or current measured from SMUx.



    
# Module `dopes.equipment_control.kal100` {#dopes.equipment_control.kal100}







    
## Classes


    
### Class `kal100` {#dopes.equipment_control.kal100.kal100}




>     class kal100(
>         port
>     )


Class to control KAL100 pressure system

Function called when an instance of the class is created

    args:
       
- port (string) : the computer port to which the equipment is connected


    
#### Ancestors (in MRO)

* [dopes.equipment_control.equipment.equipment](#dopes.equipment_control.equipment.equipment)



    
#### Class variables


    
##### Variable `company` {#dopes.equipment_control.kal100.kal100.company}






    
##### Variable `model` {#dopes.equipment_control.kal100.kal100.model}






    
##### Variable `url` {#dopes.equipment_control.kal100.kal100.url}









    
#### Methods


    
##### Method `close_connection` {#dopes.equipment_control.kal100.kal100.close_connection}




>     def close_connection(
>         self
>     )


Function to close the  serial connection with the equipment

    
##### Method `initialize` {#dopes.equipment_control.kal100.kal100.initialize}




>     def initialize(
>         self,
>         units='kPa',
>         percentage=100,
>         mode_operation='MS',
>         mode_input='positive',
>         zero_adjust=True
>     )


Function to initialize the KAL100

    args:
       
- units (string) : "Pa", "kPa" or "hPa"
       
- percentage (int) : pressure fixed at "percentage" of the targeted value
       
- mode_operation (string) :  mode test ("MT"), mode zeroing ("MZ"), mode target value ("MS"), mode pressure measurement ("MP")
       
- mode_input (string) : Positive P-input ("positive"), Negative P-input ("negative"), Differential pressure measurement  ("differential")

    
##### Method `set_pressure` {#dopes.equipment_control.kal100.kal100.set_pressure}




>     def set_pressure(
>         self,
>         pressure
>     )


Function to set pressure level of the KAL100

    args:
       
- pressure (scalar) : targeted pressure



    
# Module `dopes.equipment_control.mecom` {#dopes.equipment_control.mecom}

The package consists of 3 files.

commands.py contains a dictionary parameters which can be get/set
exceptions.py defines the error thrown by this pockage
mecom.py contains the communication logic


    
## Sub-modules

* [dopes.equipment_control.mecom.commands](#dopes.equipment_control.mecom.commands)
* [dopes.equipment_control.mecom.exceptions](#dopes.equipment_control.mecom.exceptions)
* [dopes.equipment_control.mecom.mecom](#dopes.equipment_control.mecom.mecom)






    
# Module `dopes.equipment_control.mecom.commands` {#dopes.equipment_control.mecom.commands}

Definitions of command and error codes as stated in the MeCom protocol specification.
Documents can be found at <https://www.meerstetter.ch/customer-center/downloads/category/35-latest-communication-protocols>







    
# Module `dopes.equipment_control.mecom.exceptions` {#dopes.equipment_control.mecom.exceptions}

This file contains some custom expceptions.





    
## Classes


    
### Class `ResponseException` {#dopes.equipment_control.mecom.exceptions.ResponseException}




>     class ResponseException(
>         *args,
>         **kwargs
>     )


Common base class for all non-exit exceptions.


    
#### Ancestors (in MRO)

* [builtins.Exception](#builtins.Exception)
* [builtins.BaseException](#builtins.BaseException)


    
#### Descendants

* [dopes.equipment_control.mecom.exceptions.ResponseTimeout](#dopes.equipment_control.mecom.exceptions.ResponseTimeout)
* [dopes.equipment_control.mecom.exceptions.WrongResponseSequence](#dopes.equipment_control.mecom.exceptions.WrongResponseSequence)





    
### Class `ResponseTimeout` {#dopes.equipment_control.mecom.exceptions.ResponseTimeout}




>     class ResponseTimeout(
>         *args,
>         **kwargs
>     )


Common base class for all non-exit exceptions.


    
#### Ancestors (in MRO)

* [dopes.equipment_control.mecom.exceptions.ResponseException](#dopes.equipment_control.mecom.exceptions.ResponseException)
* [builtins.Exception](#builtins.Exception)
* [builtins.BaseException](#builtins.BaseException)






    
### Class `UnknownMeComType` {#dopes.equipment_control.mecom.exceptions.UnknownMeComType}




>     class UnknownMeComType(
>         *args,
>         **kwargs
>     )


Common base class for all non-exit exceptions.


    
#### Ancestors (in MRO)

* [builtins.Exception](#builtins.Exception)
* [builtins.BaseException](#builtins.BaseException)






    
### Class `UnknownParameter` {#dopes.equipment_control.mecom.exceptions.UnknownParameter}




>     class UnknownParameter(
>         *args,
>         **kwargs
>     )


Common base class for all non-exit exceptions.


    
#### Ancestors (in MRO)

* [builtins.Exception](#builtins.Exception)
* [builtins.BaseException](#builtins.BaseException)






    
### Class `WrongChecksum` {#dopes.equipment_control.mecom.exceptions.WrongChecksum}




>     class WrongChecksum(
>         *args,
>         **kwargs
>     )


Common base class for all non-exit exceptions.


    
#### Ancestors (in MRO)

* [builtins.Exception](#builtins.Exception)
* [builtins.BaseException](#builtins.BaseException)






    
### Class `WrongResponseSequence` {#dopes.equipment_control.mecom.exceptions.WrongResponseSequence}




>     class WrongResponseSequence(
>         *args,
>         **kwargs
>     )


Common base class for all non-exit exceptions.


    
#### Ancestors (in MRO)

* [dopes.equipment_control.mecom.exceptions.ResponseException](#dopes.equipment_control.mecom.exceptions.ResponseException)
* [builtins.Exception](#builtins.Exception)
* [builtins.BaseException](#builtins.BaseException)








    
# Module `dopes.equipment_control.mecom.mecom` {#dopes.equipment_control.mecom.mecom}

"
The magic happens in this file.





    
## Classes


    
### Class `ACK` {#dopes.equipment_control.mecom.mecom.ACK}




>     class ACK


ACK command sent by the device.


    
#### Ancestors (in MRO)

* [dopes.equipment_control.mecom.mecom.MeFrame](#dopes.equipment_control.mecom.mecom.MeFrame)






    
#### Methods


    
##### Method `decompose` {#dopes.equipment_control.mecom.mecom.ACK.decompose}




>     def decompose(
>         self,
>         frame_bytes
>     )


Takes bytes as input and builds the instance.
:param frame_bytes: bytes
:return:

    
### Class `DeviceError` {#dopes.equipment_control.mecom.mecom.DeviceError}




>     class DeviceError


Queries failing return a device error, implemented as repsonse by this class.

Read error codes from command.py and parse into a list of Error() instances.


    
#### Ancestors (in MRO)

* [dopes.equipment_control.mecom.mecom.MeFrame](#dopes.equipment_control.mecom.mecom.MeFrame)






    
#### Methods


    
##### Method `compose` {#dopes.equipment_control.mecom.mecom.DeviceError.compose}




>     def compose(
>         self,
>         part=False
>     )


Device errors have a different but simple structure.
:param part: bool
:return:

    
##### Method `decompose` {#dopes.equipment_control.mecom.mecom.DeviceError.decompose}




>     def decompose(
>         self,
>         frame_bytes
>     )


Again, different but consistent structure.
:param frame_bytes: bytes
:return:

    
##### Method `error` {#dopes.equipment_control.mecom.mecom.DeviceError.error}




>     def error(
>         self
>     )


Returns error code, description and symbol as [str,].
:return: [str, str, str]

    
### Class `Error` {#dopes.equipment_control.mecom.mecom.Error}




>     class Error(
>         error_dict
>     )


"
Every error dict from commands.py is parsed into a Error instance.

Takes a dict e.g. {"code": 1, "symbol": "EER_CMD_NOT_AVAILABLE", "description": "Command not available"} which
defines a error specified by the protocol.
:param error_dict: dict







    
#### Methods


    
##### Method `as_list` {#dopes.equipment_control.mecom.mecom.Error.as_list}




>     def as_list(
>         self
>     )


Returns a list representation of this object.
:return: list

    
### Class `IF` {#dopes.equipment_control.mecom.mecom.IF}




>     class IF(
>         address=0,
>         parameter_instance=1
>     )


Implementing device info query.

Create a query to set a parameter value.
:param address: int
:param parameter_instance: int


    
#### Ancestors (in MRO)

* [dopes.equipment_control.mecom.mecom.Query](#dopes.equipment_control.mecom.mecom.Query)
* [dopes.equipment_control.mecom.mecom.MeFrame](#dopes.equipment_control.mecom.mecom.MeFrame)






    
### Class `IFResponse` {#dopes.equipment_control.mecom.mecom.IFResponse}




>     class IFResponse


ACK command sent by the device.


    
#### Ancestors (in MRO)

* [dopes.equipment_control.mecom.mecom.MeFrame](#dopes.equipment_control.mecom.mecom.MeFrame)






    
#### Methods


    
##### Method `crc` {#dopes.equipment_control.mecom.mecom.IFResponse.crc}




>     def crc(
>         self,
>         in_crc=None
>     )


ACK has the same checksum as the VS command.
:param in_crc: int
:return:

    
##### Method `decompose` {#dopes.equipment_control.mecom.mecom.IFResponse.decompose}




>     def decompose(
>         self,
>         frame_bytes
>     )


Takes bytes as input and builds the instance.
:param frame_bytes: bytes
:return:

    
### Class `MeCom` {#dopes.equipment_control.mecom.mecom.MeCom}




>     class MeCom(
>         serialport='/dev/ttyUSB0',
>         timeout=1,
>         baudrate=57600,
>         metype='TEC'
>     )


Deprecated. Use MeComSerial instead.

Initialize communication with serial port.
:param serialport: str: Linux example: '/dev/ttyUSB0', Windows example: 'COM1'
:param timeout: int
:param metype: str: either 'TEC', 'LDD-112x', 'LDD-130x' or 'LDD-1321'


    
#### Ancestors (in MRO)

* [dopes.equipment_control.mecom.mecom.MeComSerial](#dopes.equipment_control.mecom.mecom.MeComSerial)
* [dopes.equipment_control.mecom.mecom.MeComCommon](#dopes.equipment_control.mecom.mecom.MeComCommon)






    
### Class `MeComCommon` {#dopes.equipment_control.mecom.mecom.MeComCommon}




>     class MeComCommon(
>         metype='TEC'
>     )


Shared communication class

Initialize communication with serial port.
:param serialport: str
:param timeout: int
:param metype: str: either 'TEC', 'LDD-112x', 'LDD-130x' or 'LDD-1321'



    
#### Descendants

* [dopes.equipment_control.mecom.mecom.MeComSerial](#dopes.equipment_control.mecom.mecom.MeComSerial)
* [dopes.equipment_control.mecom.mecom.MeComTcp](#dopes.equipment_control.mecom.mecom.MeComTcp)


    
#### Class variables


    
##### Variable `SEQUENCE_COUNTER` {#dopes.equipment_control.mecom.mecom.MeComCommon.SEQUENCE_COUNTER}









    
#### Methods


    
##### Method `disable_autosave` {#dopes.equipment_control.mecom.mecom.MeComCommon.disable_autosave}




>     def disable_autosave(
>         self,
>         *,
>         value=1,
>         parameter_name='Save Data to Flash',
>         parameter_id=None,
>         **kwargs
>     )




    
##### Method `enable_autosave` {#dopes.equipment_control.mecom.mecom.MeComCommon.enable_autosave}




>     def enable_autosave(
>         self,
>         *,
>         value=0,
>         parameter_name='Save Data to Flash',
>         parameter_id=None,
>         **kwargs
>     )




    
##### Method `get_parameter` {#dopes.equipment_control.mecom.mecom.MeComCommon.get_parameter}




>     def get_parameter(
>         self,
>         parameter_name=None,
>         parameter_id=None,
>         *args,
>         **kwargs
>     )


Get the value of a parameter given by name or id.
Returns a list of success and value.
:param parameter_name:
:param parameter_id:
:param args:
:param kwargs:
:return: int or float

    
##### Method `get_parameter_raw` {#dopes.equipment_control.mecom.mecom.MeComCommon.get_parameter_raw}




>     def get_parameter_raw(
>         self,
>         parameter_id,
>         parameter_format,
>         *args,
>         **kwargs
>     )


Get the value of a parameter given by its id and format specifier.
note: use get_parameter() if you only want to use known commands
Returns a list of success and value.
:param parameter:
:param args:
:param kwargs:
:return: int or float

    
##### Method `identify` {#dopes.equipment_control.mecom.mecom.MeComCommon.identify}




>     def identify(
>         self,
>         *,
>         parameter_name='Device Address',
>         parameter_id=None,
>         **kwargs
>     )




    
##### Method `info` {#dopes.equipment_control.mecom.mecom.MeComCommon.info}




>     def info(
>         self,
>         *args,
>         **kwargs
>     )


Resets the device after an error has occured

    
##### Method `reset_device` {#dopes.equipment_control.mecom.mecom.MeComCommon.reset_device}




>     def reset_device(
>         self,
>         *args,
>         **kwargs
>     )


Resets the device after an error has occured

    
##### Method `set_parameter` {#dopes.equipment_control.mecom.mecom.MeComCommon.set_parameter}




>     def set_parameter(
>         self,
>         value,
>         parameter_name=None,
>         parameter_id=None,
>         *args,
>         **kwargs
>     )


Set the new value of a parameter given by name or id.
Returns success.
:param value:
:param parameter_name:
:param parameter_id:
:param args:
:param kwargs:
:return: bool

    
##### Method `set_parameter_raw` {#dopes.equipment_control.mecom.mecom.MeComCommon.set_parameter_raw}




>     def set_parameter_raw(
>         self,
>         value,
>         parameter_id,
>         parameter_format,
>         *args,
>         **kwargs
>     )


Set the new value of a parameter given by its id and format specifier.
note: use set_parameter() if you only want to use known commands
Returns success.
:param value:
:param parameter:
:param args:
:param kwargs:
:return: bool

    
##### Method `status` {#dopes.equipment_control.mecom.mecom.MeComCommon.status}




>     def status(
>         self,
>         *args,
>         **kwargs
>     )


Get the device status.
Returns success and status as readable str.
:param args:
:param kwargs:
:return: [bool, str]

    
##### Method `trigger_save_to_flash` {#dopes.equipment_control.mecom.mecom.MeComCommon.trigger_save_to_flash}




>     def trigger_save_to_flash(
>         self,
>         *args,
>         **kwargs
>     )


Writes all parameter values to the flash of the device.
Note: This function only works on:
 - TEC Controllers using a firmware >= v6.00
 - LDD-130x devices with a firmware >= v2.00
 - LDD-1321 devices on any firmware
for devices not listed here, refer to the device documentation
and check whether the new explicit flash saving mechanism
is used on your device

    
##### Method `write_to_flash` {#dopes.equipment_control.mecom.mecom.MeComCommon.write_to_flash}




>     def write_to_flash(
>         self,
>         *args,
>         **kwargs
>     )


Write parameters to flash.
Note: This function only works on:
 - TEC Controllers using a firmware < v6.00
 - LDD-130x devices with a firmware < v2.00
 - LDD-112x devices on any firmware
for devices not listed here, refer to the device documentation
and check whether the old automatic flash saving mechanism
is used on your device
:param args:
:param kwargs:
:return: bool

    
### Class `MeComSerial` {#dopes.equipment_control.mecom.mecom.MeComSerial}




>     class MeComSerial(
>         serialport='/dev/ttyUSB0',
>         timeout=1,
>         baudrate=57600,
>         metype='TEC'
>     )


Main class (Serial). Import this one:
from qao.devices.mecom import MeComSerial

For a usage example see __main__

Initialize communication with serial port.
:param serialport: str: Linux example: '/dev/ttyUSB0', Windows example: 'COM1'
:param timeout: int
:param metype: str: either 'TEC', 'LDD-112x', 'LDD-130x' or 'LDD-1321'


    
#### Ancestors (in MRO)

* [dopes.equipment_control.mecom.mecom.MeComCommon](#dopes.equipment_control.mecom.mecom.MeComCommon)


    
#### Descendants

* [dopes.equipment_control.mecom.mecom.MeCom](#dopes.equipment_control.mecom.mecom.MeCom)


    
#### Class variables


    
##### Variable `SEQUENCE_COUNTER` {#dopes.equipment_control.mecom.mecom.MeComSerial.SEQUENCE_COUNTER}









    
#### Methods


    
##### Method `stop` {#dopes.equipment_control.mecom.mecom.MeComSerial.stop}




>     def stop(
>         self
>     )




    
### Class `MeComTcp` {#dopes.equipment_control.mecom.mecom.MeComTcp}




>     class MeComTcp(
>         ipaddress,
>         ipport=50000,
>         metype='TEC'
>     )


Main class (TCP). Import this one:
from qao.devices.mecom import MeComTCP

For a usage example see __main__

Initialize communication with TCP connection.
:param ipaddress: str
:param ipport: int
:param timeout: int
:param metype: str: either 'TEC', 'LDD-112x', 'LDD-130x' or 'LDD-1321'


    
#### Ancestors (in MRO)

* [dopes.equipment_control.mecom.mecom.MeComCommon](#dopes.equipment_control.mecom.mecom.MeComCommon)



    
#### Class variables


    
##### Variable `SEQUENCE_COUNTER` {#dopes.equipment_control.mecom.mecom.MeComTcp.SEQUENCE_COUNTER}









    
#### Methods


    
##### Method `stop` {#dopes.equipment_control.mecom.mecom.MeComTcp.stop}




>     def stop(
>         self
>     )




    
### Class `MeFrame` {#dopes.equipment_control.mecom.mecom.MeFrame}




>     class MeFrame


Basis structure of a MeCom frame as defined in the specs.



    
#### Descendants

* [dopes.equipment_control.mecom.mecom.ACK](#dopes.equipment_control.mecom.mecom.ACK)
* [dopes.equipment_control.mecom.mecom.DeviceError](#dopes.equipment_control.mecom.mecom.DeviceError)
* [dopes.equipment_control.mecom.mecom.IFResponse](#dopes.equipment_control.mecom.mecom.IFResponse)
* [dopes.equipment_control.mecom.mecom.Query](#dopes.equipment_control.mecom.mecom.Query)
* [dopes.equipment_control.mecom.mecom.VRResponse](#dopes.equipment_control.mecom.mecom.VRResponse)





    
#### Methods


    
##### Method `CalcCRC_CCITT` {#dopes.equipment_control.mecom.mecom.MeFrame.CalcCRC_CCITT}




>     def CalcCRC_CCITT(
>         self,
>         input_data
>     )


Calculates the CRC-CCITT checksum of the given data

    
##### Method `compose` {#dopes.equipment_control.mecom.mecom.MeFrame.compose}




>     def compose(
>         self,
>         part=False
>     )


Returns the frame as bytes, the return-value can be directly send via serial.
:param part: bool
:return: bytes

    
##### Method `crc` {#dopes.equipment_control.mecom.mecom.MeFrame.crc}




>     def crc(
>         self,
>         in_crc=None
>     )


Calculates the checksum of a given frame, if a checksum is given as parameter, the two are compared.
:param in_crc:
:return: int

    
##### Method `set_sequence` {#dopes.equipment_control.mecom.mecom.MeFrame.set_sequence}




>     def set_sequence(
>         self,
>         sequence
>     )




    
### Class `Parameter` {#dopes.equipment_control.mecom.mecom.Parameter}




>     class Parameter(
>         parameter_dict
>     )


"
Every parameter dict from commands.py is parsed into a Parameter instance.

Takes a dict e.g. {"id": 104, "name": "Device Status", "format": "INT32"} and creates an object which can be
passed to a Query().
:param parameter_dict: dict







    
### Class `ParameterList` {#dopes.equipment_control.mecom.mecom.ParameterList}




>     class ParameterList(
>         metype='TEC'
>     )


Contains a list of Parameter() for either TEC controller (metype = 'TEC'),
LDD-112x (metype = 'LDD-112x'), LDD-130x (metype = 'LDD-130x') or LDD-1321 (metype = 'LDD-1321').
Provides searching via id or name.
The deprecated metype = 'LDD' is equal to passing metype = 'LDD-112x'.
:param error_dict: dict

Reads the parameter dicts from commands.py.







    
#### Methods


    
##### Method `get_by_id` {#dopes.equipment_control.mecom.mecom.ParameterList.get_by_id}




>     def get_by_id(
>         self,
>         id
>     )


Returns a Parameter() identified by it's id.
:param id: int
:return: Parameter()

    
##### Method `get_by_name` {#dopes.equipment_control.mecom.mecom.ParameterList.get_by_name}




>     def get_by_name(
>         self,
>         name
>     )


Returns a Parameter() identified by it's name.
:param name: str
:return: Parameter()

    
### Class `Query` {#dopes.equipment_control.mecom.mecom.Query}




>     class Query(
>         parameter=None,
>         address=0,
>         parameter_instance=1
>     )


Basic structure of a query to get or set a parameter. Has the attribute RESPONSE which contains the answer received
by the device. The response is set via set_response

To be initialized with a target device address (default=broadcast), the channel, teh sequence number and a
Parameter() instance of the corresponding parameter.
:param parameter: Parameter
:param sequence: int
:param address: int
:param parameter_instance: int


    
#### Ancestors (in MRO)

* [dopes.equipment_control.mecom.mecom.MeFrame](#dopes.equipment_control.mecom.mecom.MeFrame)


    
#### Descendants

* [dopes.equipment_control.mecom.mecom.IF](#dopes.equipment_control.mecom.mecom.IF)
* [dopes.equipment_control.mecom.mecom.RS](#dopes.equipment_control.mecom.mecom.RS)
* [dopes.equipment_control.mecom.mecom.SP](#dopes.equipment_control.mecom.mecom.SP)
* [dopes.equipment_control.mecom.mecom.VR](#dopes.equipment_control.mecom.mecom.VR)
* [dopes.equipment_control.mecom.mecom.VS](#dopes.equipment_control.mecom.mecom.VS)





    
#### Methods


    
##### Method `set_response` {#dopes.equipment_control.mecom.mecom.Query.set_response}




>     def set_response(
>         self,
>         response_frame
>     )


Takes the bytes received from the device as input and creates the corresponding response instance.
:param response_frame: bytes
:return:

    
### Class `RS` {#dopes.equipment_control.mecom.mecom.RS}




>     class RS(
>         address=0
>     )


Implementing system reset.

Create a query to set a parameter value.
:param address: int
:param parameter_instance: int


    
#### Ancestors (in MRO)

* [dopes.equipment_control.mecom.mecom.Query](#dopes.equipment_control.mecom.mecom.Query)
* [dopes.equipment_control.mecom.mecom.MeFrame](#dopes.equipment_control.mecom.mecom.MeFrame)






    
### Class `SP` {#dopes.equipment_control.mecom.mecom.SP}




>     class SP(
>         address=0
>     )


Implementing query to save all parameter values to flash.

Create a query to set a parameter value.
:param address: int


    
#### Ancestors (in MRO)

* [dopes.equipment_control.mecom.mecom.Query](#dopes.equipment_control.mecom.mecom.Query)
* [dopes.equipment_control.mecom.mecom.MeFrame](#dopes.equipment_control.mecom.mecom.MeFrame)






    
### Class `VR` {#dopes.equipment_control.mecom.mecom.VR}




>     class VR(
>         parameter,
>         address=0,
>         parameter_instance=1
>     )


Implementing query to get a parameter from the device (?VR).

Create a query to get a parameter value.
:param parameter: Parameter
:param address: int
:param parameter_instance: int


    
#### Ancestors (in MRO)

* [dopes.equipment_control.mecom.mecom.Query](#dopes.equipment_control.mecom.mecom.Query)
* [dopes.equipment_control.mecom.mecom.MeFrame](#dopes.equipment_control.mecom.mecom.MeFrame)






    
### Class `VRResponse` {#dopes.equipment_control.mecom.mecom.VRResponse}




>     class VRResponse(
>         response_format
>     )


Frame for the device response to a VR() query.

The format of the response is given via VR.set_response()
:param response_format: str


    
#### Ancestors (in MRO)

* [dopes.equipment_control.mecom.mecom.MeFrame](#dopes.equipment_control.mecom.mecom.MeFrame)






    
#### Methods


    
##### Method `decompose` {#dopes.equipment_control.mecom.mecom.VRResponse.decompose}




>     def decompose(
>         self,
>         frame_bytes
>     )


Takes bytes as input and builds the instance.
:param frame_bytes: bytes
:return:

    
### Class `VS` {#dopes.equipment_control.mecom.mecom.VS}




>     class VS(
>         value,
>         parameter,
>         address=0,
>         parameter_instance=1
>     )


Implementing query to set a parameter from the device (VS).

Create a query to set a parameter value.
:param value: int or float
:param parameter: Parameter
:param address: int
:param parameter_instance: int


    
#### Ancestors (in MRO)

* [dopes.equipment_control.mecom.mecom.Query](#dopes.equipment_control.mecom.mecom.Query)
* [dopes.equipment_control.mecom.mecom.MeFrame](#dopes.equipment_control.mecom.mecom.MeFrame)








    
# Module `dopes.equipment_control.meerstetterTEC` {#dopes.equipment_control.meerstetterTEC}







    
## Classes


    
### Class `meerstetterTEC` {#dopes.equipment_control.meerstetterTEC.meerstetterTEC}




>     class meerstetterTEC(
>         port=None,
>         scan_timeout=30,
>         channel=1,
>         queries=['loop status', 'object temperature', 'target object temperature', 'output current', 'output voltage'],
>         *args,
>         **kwars
>     )


Controlling TEC devices via serial.







    
#### Methods


    
##### Method `close_connection` {#dopes.equipment_control.meerstetterTEC.meerstetterTEC.close_connection}




>     def close_connection(
>         self
>     )




    
##### Method `disable` {#dopes.equipment_control.meerstetterTEC.meerstetterTEC.disable}




>     def disable(
>         self
>     )




    
##### Method `enable` {#dopes.equipment_control.meerstetterTEC.meerstetterTEC.enable}




>     def enable(
>         self
>     )




    
##### Method `get_data` {#dopes.equipment_control.meerstetterTEC.meerstetterTEC.get_data}




>     def get_data(
>         self
>     )




    
##### Method `initialize` {#dopes.equipment_control.meerstetterTEC.meerstetterTEC.initialize}




>     def initialize(
>         self
>     )




    
##### Method `session` {#dopes.equipment_control.meerstetterTEC.meerstetterTEC.session}




>     def session(
>         self
>     )




    
##### Method `set_temp` {#dopes.equipment_control.meerstetterTEC.meerstetterTEC.set_temp}




>     def set_temp(
>         self,
>         value,
>         wait_for_stabilization=False,
>         waiting_time=0.1,
>         stabilization_tolerance=0.1,
>         stabilization_number=10
>     )


Set object temperature of channel to desired value.
:param value: float
:param channel: int
:return:



    
# Module `dopes.equipment_control.oscilloscope` {#dopes.equipment_control.oscilloscope}







    
## Classes


    
### Class `oscilloscope` {#dopes.equipment_control.oscilloscope.oscilloscope}




>     class oscilloscope(
>         address,
>         rm=None,
>         timeout=10000.0
>     )


Class to control tektronix oscilloscope

Function called when an instance of the class is created

    args:
       
- address (string) : the address of the equipment to be connected
       
- rm (pyvisa object) : the pyvisa resource manager used to set the communication with the equipment
       
- timeout (scalar) : the timeout set for the communication with the equipment


    
#### Ancestors (in MRO)

* [dopes.equipment_control.equipment.equipment](#dopes.equipment_control.equipment.equipment)



    
#### Class variables


    
##### Variable `company` {#dopes.equipment_control.oscilloscope.oscilloscope.company}






    
##### Variable `model` {#dopes.equipment_control.oscilloscope.oscilloscope.model}






    
##### Variable `url` {#dopes.equipment_control.oscilloscope.oscilloscope.url}









    
#### Methods


    
##### Method `acquire_all_channels` {#dopes.equipment_control.oscilloscope.oscilloscope.acquire_all_channels}




>     def acquire_all_channels(
>         self,
>         force_trig=False
>     )


Function to acquire the data of all active channels from the Tektronix oscilloscope 
    
    args:
        
- force_trig (boolean) : if True, force the trigger to acquire the data. If False, an other trigger mechanism has to be used or manual triggering has to be done.
    return:
       
- scaled_time, scaled_wave (numpy array) : time and waveform data vectors

    
##### Method `acquire_channels_with_measurement` {#dopes.equipment_control.oscilloscope.oscilloscope.acquire_channels_with_measurement}




>     def acquire_channels_with_measurement(
>         self,
>         meas_list,
>         force_trig=False
>     )


Function to acquire the data of all active channels from the Tektronix oscilloscope along a list of measurements
    
    args:
        
- meas_list (list of string) : the list of measurements that have to be done. Possible measurements are "FREQUENCY", "AMPLITUDE", "MIN", "MAX", "MEAN", "RMS", "PHASE", "PK2Pk"
        
- force_trig (boolean) : if True, force the trigger to acquire the data. If False, an other trigger mechanism has to be used or manual triggering has to be done.
    return:
       
- scaled_time, scaled_wave (numpy array) : time and waveform data vectors
       
- measurement (dictionnary) : dictionnary with the value of the measurements. The first key of the dictionnary is the channel (ex. "CH1") while the second key is the measurement name from meas_list. For example, measurement["CH1"]["AMPLITUDE"] gives the amplitude calculated from the channel 1 signal

    
##### Method `acquire_single_channel` {#dopes.equipment_control.oscilloscope.oscilloscope.acquire_single_channel}




>     def acquire_single_channel(
>         self,
>         channel='CH1',
>         force_trig=False
>     )


Function to acquire the data of a single channel from the Tektronix oscilloscope 
    
    args:
        
- channel (string) : the channel from which the data has to be taken
        
- force_trig (boolean) : if True, force the trigger to acquire the data. If False, an other trigger mechanism has to be used or manual triggering has to be done.
    return:
       
- scaled_time, scaled_wave (numpy array) : time and waveform data vectors

    
##### Method `acquire_single_channel_with_measurement` {#dopes.equipment_control.oscilloscope.oscilloscope.acquire_single_channel_with_measurement}




>     def acquire_single_channel_with_measurement(
>         self,
>         meas_list,
>         channel='CH1',
>         force_trig=False
>     )


Function to acquire the data of a single channel from the Tektronix oscilloscope along a list of measurements
    
    args:
        
- meas_list (list of string) : the list of measurements that have to be done. Possible measurements are "FREQUENCY", "AMPLITUDE", "MIN", "MAX", "MEAN", "RMS", "PHASE", "PK2Pk"
        
- channel (string) : the channel on which the measurement has to be done
        
- force_trig (boolean) : if True, force the trigger to acquire the data. If False, an other trigger mechanism has to be used or manual triggering has to be done.
    return:
       
- scaled_time, scaled_wave (numpy array) : time and waveform data vectors
       
- measurement (dictionnary) : dictionnary with the value of the measurements. The keys of the dictionnary are meas_list

    
##### Method `acquire_wave` {#dopes.equipment_control.oscilloscope.oscilloscope.acquire_wave}




>     def acquire_wave(
>         self
>     )


Intermediate function to acquire the data from the Tektronix oscilloscope

    return:
       
- scaled_time, scaled_wave (numpy array) : time and waveform data vectors

    
##### Method `force_trig` {#dopes.equipment_control.oscilloscope.oscilloscope.force_trig}




>     def force_trig(
>         self
>     )


Function to force the triggering of the oscilloscope

    
##### Method `get_measurement` {#dopes.equipment_control.oscilloscope.oscilloscope.get_measurement}




>     def get_measurement(
>         self,
>         channel,
>         meas_type
>     )


Function to get the measurement from a previous acquisition  
    
    args:
        
- channel (string) : the channel on which the measurement has to be done
        
- meas_type (string) : the measurement that has to be done. Possible measurements are "FREQUENCY", "AMPLITUDE", "MIN", "MAX", "MEAN", "RMS", "PHASE", "PK2Pk"

    return:
       
- meas (scalar) : the value of the measurement taken

    
##### Method `get_measurement_list` {#dopes.equipment_control.oscilloscope.oscilloscope.get_measurement_list}




>     def get_measurement_list(
>         self,
>         channel,
>         meas_list
>     )


Function to get a list of measurements from a previous acquisition  
    
    args:
        
- channel (string) : the channel on which the measurement has to be done
        
- meas_list (list of string) : the list of measurements that have to be done. Possible measurements are "FREQUENCY", "AMPLITUDE", "MIN", "MAX", "MEAN", "RMS", "PHASE", "PK2Pk"

    return:
       
- meas_dic (dictionnary) : dictionnary with the value of the measurements. The keys of the dictionnary are meas_list

    
##### Method `initialize` {#dopes.equipment_control.oscilloscope.oscilloscope.initialize}




>     def initialize(
>         self,
>         channel_used={'CH1': 'ON', 'CH2': 'OFF', 'CH3': 'OFF', 'CH4': 'OFF'},
>         autoset=True,
>         continuous=True,
>         num_sequence=1,
>         average=False,
>         num_average=10,
>         data_bytes=1,
>         command_delay=0.02,
>         query_delay=0.1,
>         sync_delay=0.2
>     )


Function to initialize the Tektronix oscilloscope  with the desired settings

    args:
       
- channel_used (dictionnary) : dictionnary for which the key are the name of the channel ("CH1","CH2","CH3","CH4") and the value is "ON" or "OFF" to activate or desactivate the channel
       
- autoset (boolean) : if True, the oscilloscope performs an autoset during the initialization
       
- continuous (boolean) : if True, the oscilloscope continue running after taken an acquisition
       
- num_sequence (integer) : the number of sequence the oscilloscope will take for each acquisition. This is not an averaging.
       
- average (boolean) : if True, the oscilloscope will take several signal to perform an averaging
       
- num_average (integer) : the number of acquisitions to make the averaging

    
##### Method `set_channel_properties` {#dopes.equipment_control.oscilloscope.oscilloscope.set_channel_properties}




>     def set_channel_properties(
>         self,
>         channel,
>         scale,
>         offset=0,
>         coupling='DC',
>         bandwidth='FULL',
>         termination=1000000.0
>     )


Function to set the properties of a channel of the oscilloscope 
    
    args:
        
- channel (string) : the channel from which the data has to be taken
        
- scale (scalar) : the dimension of one vertical divistion in Volts. The full scale is made of 10 divisions
        
- offset (scalar) : the offset in volt of the vertical position of the signal
        
- coupling (string) : the coupling of the channel. Choice between "AC" to remove the DC component or "DC" to keep it
        
- bandwidth (scalar or string) : the selectable low-pass bandwidth limit filter of the specified channel. "FULL" disables any optional bandwidth limiting. The specified channel operates at its maximum bandwidth.
        
- termination (scalar) : The vertical termination for the specified analog channel. Choice between 50 or 1e6 Ohms.

    
##### Method `set_edge_trigger` {#dopes.equipment_control.oscilloscope.oscilloscope.set_edge_trigger}




>     def set_edge_trigger(
>         self,
>         channel='CH1',
>         level=0
>     )


Function to set a rising edge trigger 
    
    args:
        
- channel (string) : specify the channel for the triggering mechanism
        
- level (scalar) : the voltage level of trigger

    
##### Method `set_horizontal_properties` {#dopes.equipment_control.oscilloscope.oscilloscope.set_horizontal_properties}




>     def set_horizontal_properties(
>         self,
>         record_length,
>         sample_rate
>     )


Function to set the horizontal (time axis) properties of the oscilloscope 
    
    args:
        
- record_length (integer) : specify the number of points for the acquisition
        
- sample_rate (scalar) : specify the sampling rate in samples/s for the acquisition. The total time window can then be calculated as record_length/sampling_rate

    
##### Method `set_state` {#dopes.equipment_control.oscilloscope.oscilloscope.set_state}




>     def set_state(
>         self,
>         state='ON'
>     )


Function to set the acquisition state 
    
    args:
        
- state (string) : When state is set to "ON" or "RUN", a new acquisition will be started. When state is set to "OFF" or "STOP", the acquisition is stopped.
        If the last acquisition was a single acquisition sequence, a new single sequence acquisition will be started. If the last acquisition was continuous, a new continuous acquisition will be started.
        If "RUN" is issued in the middle of completing a single sequence acquisition (for example, averaging or enveloping), the acquisition sequence is restarted, 
        and any accumulated data is discarded. Also, the instrument resets the number of acquisitions. If the "RUN" argument is issued while in continuous mode, a reset occurs and acquired data continues to acquire.



    
# Module `dopes.equipment_control.pm100d` {#dopes.equipment_control.pm100d}







    
## Classes


    
### Class `pm100d` {#dopes.equipment_control.pm100d.pm100d}




>     class pm100d(
>         address,
>         rm=None,
>         timeout=10000.0
>     )


Class to control PM100D powermeter controller

Function called when an instance of the class is created

    args:
       
- address (string) : the address of the equipment to be connected
       
- rm (pyvisa object) : the pyvisa resource manager used to set the communication with the equipment
       
- timeout (scalar) : the timeout set for the communication with the equipment


    
#### Ancestors (in MRO)

* [dopes.equipment_control.equipment.equipment](#dopes.equipment_control.equipment.equipment)



    
#### Class variables


    
##### Variable `company` {#dopes.equipment_control.pm100d.pm100d.company}






    
##### Variable `model` {#dopes.equipment_control.pm100d.pm100d.model}






    
##### Variable `url` {#dopes.equipment_control.pm100d.pm100d.url}









    
#### Methods


    
##### Method `initialize` {#dopes.equipment_control.pm100d.pm100d.initialize}




>     def initialize(
>         self,
>         zero_calibration=True
>     )


Function to initialize the PM100D powermeter controller

    
##### Method `read_power` {#dopes.equipment_control.pm100d.pm100d.read_power}




>     def read_power(
>         self,
>         wavelength,
>         average_number=10
>     )


Function to read the power from the powermeter 

   args:
      
- wavelength (integer): the wavelength parameter in nanometers to calculate the power from the photocurrent
      
- average_number (integer): the number of acquisition to do an averaging 
      
   return:
       
- a scalar with the power in Watts read by the powermeter



    
# Module `dopes.equipment_control.sh242` {#dopes.equipment_control.sh242}







    
## Classes


    
### Class `sh242` {#dopes.equipment_control.sh242.sh242}




>     class sh242(
>         address,
>         rm=None,
>         timeout=10000.0
>     )


Class to control SH242 climatic chamber

Function called when an instance of the class is created

    args:
       
- address (string) : the address of the equipment to be connected
       
- rm (pyvisa object) : the pyvisa resource manager used to set the communication with the equipment
       
- timeout (scalar) : the timeout set for the communication with the equipment


    
#### Ancestors (in MRO)

* [dopes.equipment_control.equipment.equipment](#dopes.equipment_control.equipment.equipment)



    
#### Class variables


    
##### Variable `company` {#dopes.equipment_control.sh242.sh242.company}






    
##### Variable `model` {#dopes.equipment_control.sh242.sh242.model}






    
##### Variable `url` {#dopes.equipment_control.sh242.sh242.url}









    
#### Methods


    
##### Method `initialize` {#dopes.equipment_control.sh242.sh242.initialize}




>     def initialize(
>         self,
>         temperature=True,
>         humidity=False,
>         temperature_dic={'upper': 125, 'lower': -45, 'set': 20},
>         humidity_dic={'upper': 100, 'lower': 0, 'set': 55}
>     )


Function to initialize the SH242

    args:
       
- temperature (boolean) : if True, activate the temperature control
       
- humidity (boolean) : if True, activate the humidity control
       
- temperature_dic (dictionary) : dictionnary with the upper ("upper") and lower ("lower") alarm and the initial set point ("set") for the temperature
       
- humidity_dic (dictionary) : dictionnary with the upper ("upper") and lower ("lower") alarm and the initial set point ("set") for the humidity

    
##### Method `read_humidity` {#dopes.equipment_control.sh242.sh242.read_humidity}




>     def read_humidity(
>         self
>     )


Function to read the humidity of the climatic chamber

    return:
       
- humidity (scalar) : humidity of the chamber

    
##### Method `read_temperature` {#dopes.equipment_control.sh242.sh242.read_temperature}




>     def read_temperature(
>         self
>     )


Function to read the temperature of the climatic chamber

    return:
       
- temperature (scalar) : temperature of the chamber

    
##### Method `set_humidity` {#dopes.equipment_control.sh242.sh242.set_humidity}




>     def set_humidity(
>         self,
>         humidity,
>         waiting_time=0,
>         wait_for_stabilization=False,
>         stabilization_tolerance=0.5,
>         stabilization_number=1
>     )


Function to set the humidity of the climatic chamber

    return:
       
- humidity (scalar) : targeted humidity of the chamber
       
- waiting_time (scalar) : time in seconds to wait before after changing the humidity target. If a waiting for the stabilization is required, the waiting time happens before.
       
- wait_for_stabilization (boolean) : if True, the function wait that the chamber has stabilized within "stabilization_tolerance" over "stabilization_number" cycles of 5 seconds
       
- stabilization_tolerance (scalar) : the tolerance in % to consider the humidity of the chamber close enough to the targeted humidity
       
- stabilization_number (int) : number of cycles to be checked to consider the humidity as stabilized

    
##### Method `set_temperature` {#dopes.equipment_control.sh242.sh242.set_temperature}




>     def set_temperature(
>         self,
>         temperature,
>         waiting_time=0,
>         wait_for_stabilization=False,
>         stabilization_tolerance=0.1,
>         stabilization_number=10
>     )


Function to set the temperature of the climatic chamber

    return:
       
- temperature (scalar) : targeted temperature of the chamber
       
- waiting_time (scalar) : time in seconds to wait before after changing the temperature target. If a waiting for the stabilization is required, the waiting time happens before.
       
- wait_for_stabilization (boolean) : if True, the function wait that the chamber has stabilized within "stabilization_tolerance" over "stabilization_number" cycles of 5 seconds
       
- stabilization_tolerance (scalar) : the tolerance in ░C to consider the temperature of the chamber close enough to the targeted temperature
       
- stabilization_number (int) : number of cycles to be checked to consider the temperature as stabilized



    
# Module `dopes.equipment_control.signal_generator` {#dopes.equipment_control.signal_generator}







    
## Classes


    
### Class `signal_generator` {#dopes.equipment_control.signal_generator.signal_generator}




>     class signal_generator(
>         address,
>         rm=None,
>         timeout=10000.0
>     )


Class to control Agilent 33120, Agilent 33250A and Tektronix AFG2021 signal generator

Function called when an instance of the class is created

    args:
       
- address (string) : the address of the equipment to be connected
       
- rm (pyvisa object) : the pyvisa resource manager used to set the communication with the equipment
       
- timeout (scalar) : the timeout set for the communication with the equipment


    
#### Ancestors (in MRO)

* [dopes.equipment_control.equipment.equipment](#dopes.equipment_control.equipment.equipment)



    
#### Class variables


    
##### Variable `company` {#dopes.equipment_control.signal_generator.signal_generator.company}






    
##### Variable `model` {#dopes.equipment_control.signal_generator.signal_generator.model}






    
##### Variable `url` {#dopes.equipment_control.signal_generator.signal_generator.url}









    
#### Methods


    
##### Method `initialize` {#dopes.equipment_control.signal_generator.signal_generator.initialize}




>     def initialize(
>         self,
>         waveform='sin',
>         freq=1000.0,
>         amp=1,
>         offset=0,
>         phase=0,
>         output='off'
>     )


Function to initialize the signal generator  
    
    args:
        
- waveform (string) : the type of waveform. Choise between sinus ("sin" or "sinusoid"), square ("squ" or "square") or ramp ("ramp")
        
- freq (scalar) : the frequency of the waveform
        
- amp (scalar) : the amplitude of the waveform
        
- offset (scalar) : the DC offset of the waveform
        
- phase (integer) : the intial phase in degree of the waveform
        
- output (string) : string to control the output state at the end of the initialization ("on" or "off")

    
##### Method `set_amplitude` {#dopes.equipment_control.signal_generator.signal_generator.set_amplitude}




>     def set_amplitude(
>         self,
>         amp
>     )


Function to change the amplitude of the signal generator  
    
    args:
        
- amp (scalar) : the amplitude of the waveform

    
##### Method `set_frequency` {#dopes.equipment_control.signal_generator.signal_generator.set_frequency}




>     def set_frequency(
>         self,
>         freq
>     )


Function to change the frequency of the signal generator  
    
    args:
        
- freq (scalar) : the frequency of the waveform

    
##### Method `set_offset` {#dopes.equipment_control.signal_generator.signal_generator.set_offset}




>     def set_offset(
>         self,
>         offset
>     )


Function to change the offset of the signal generator  
    
    args:
        
- offset (scalar) : the DC offset of the waveform

    
##### Method `set_output` {#dopes.equipment_control.signal_generator.signal_generator.set_output}




>     def set_output(
>         self,
>         state
>     )


Function to change the output state of the signal generator  
    
    args:
        
- output (string) : string to control the output state at the end of the initialization ("on" or "off")

    
##### Method `set_phase` {#dopes.equipment_control.signal_generator.signal_generator.set_phase}




>     def set_phase(
>         self,
>         phase
>     )


Function to change the initial phase of the signal generator  
    
    args:
        
- phase (integer) : the intial phase in degree of the waveform

    
##### Method `set_waveform` {#dopes.equipment_control.signal_generator.signal_generator.set_waveform}




>     def set_waveform(
>         self,
>         waveform
>     )


Function to change the waveform of the signal generator  
    
    args:
        
- waveform (string) : the type of waveform. Choise between sinus ("sin" or "sinusoid"), square ("squ" or "square") or ramp ("ramp")


-----
Generated by *pdoc* 0.11.6 (<https://pdoc3.github.io>).
