:py:mod:`simcats.support_functions` =================================== .. py:module:: simcats.support_functions .. autoapi-nested-parse:: SimCATS subpackage with support functions that are not assigned to any specific other subpackage. Package Contents ---------------- Classes ~~~~~~~ .. autoapisummary:: simcats.support_functions.ParameterSamplingInterface simcats.support_functions.NormalSamplingRange simcats.support_functions.LogNormalSamplingRange simcats.support_functions.UniformSamplingRange simcats.support_functions.ExponentialSamplingRange Functions ~~~~~~~~~ .. autoapisummary:: :nosignatures: simcats.support_functions.fermi_filter1d simcats.support_functions.fermi_dirac_derivative simcats.support_functions.cauchy_cdf simcats.support_functions.multi_cauchy_cdf simcats.support_functions.sigmoid_cdf simcats.support_functions.multi_sigmoid_cdf simcats.support_functions.glf simcats.support_functions.inverse_glf simcats.support_functions.multi_glf simcats.support_functions.reset_offset_mu_sens simcats.support_functions.signed_dist_points_line simcats.support_functions.line_line_intersection simcats.support_functions.line_circle_intersection simcats.support_functions.is_point_below_line simcats.support_functions.pixel_to_volt_1d simcats.support_functions.rotate_points simcats.support_functions.plot_csd Package Implementation Details ------------------------------ .. py:class:: ParameterSamplingInterface Bases: :py:obj:`abc.ABC` .. autoapi-inheritance-diagram:: simcats.support_functions.ParameterSamplingInterface :parts: 1 Interface for parameter sampling. This is used for example for the fluctuation of the strengths of distortions during the simulation of CSDs. .. py:method:: sample_parameter() :abstractmethod: This method is used to sample a parameter for example from a given range with a given distribution. :returns: Sampled parameter .. py:method:: last_sample() :abstractmethod: This method is used to get the last sampled parameter. Which can be used to check which parameter exactly was used to simulate the last CSD. :returns: Last sampled parameter .. py:class:: NormalSamplingRange(total_range, std, mean = None, sampling_range = None, rng = None) Bases: :py:obj:`ParameterSamplingInterface` .. autoapi-inheritance-diagram:: simcats.support_functions.NormalSamplingRange :parts: 1 Normal sampling range implementation of ParameterSamplingInterface. This class can be used to generate randomly normal sampled parameters within a given range. For example, for the distortions used in the simulation of CSDs. :param total_range: The total range in which the parameters can be sampled. This can be narrowed down randomly with the help of sampling_range. If the normal distribution generates a sample outside this range, a new sample is drawn until a sample inside the sampling_range/total_range was generated, leading to a truncated normal distribution. :type total_range: Tuple :param std: The standard deviation of the sampled elements, which is used in the normal distribution. :type std: float :param mean: The mean to be used for the normal distribution. If None, the center of the total range will be used. Defaults to None. :type mean: Optional[float] :param sampling_range: The maximum range in which the parameter is allowed to change during the simulation. The explicit range is set up during the initialization, narrowing down the supplied total_range. Default is None, which leads to no narrowing of the given total_range. :type sampling_range: Optional[float] :param rng: random number generator used for the sampling of random numbers. If None, the default generator of numpy (np.random.default_rng()) is used. Default is None. :type rng: np.random.Generator .. py:method:: sample_parameter() This method is used to sample a parameter for example from a given range with a given distribution. :returns: Sampled parameter .. py:method:: last_sample() This method is used to get the last sampled parameter. Which can be used to check which parameter exactly was used to simulate the last CSD. :returns: Last sampled parameter .. py:class:: LogNormalSamplingRange(total_range, sampling_range = None, rng = None, mean = 0, sigma = 1) Bases: :py:obj:`ParameterSamplingInterface` .. autoapi-inheritance-diagram:: simcats.support_functions.LogNormalSamplingRange :parts: 1 Logarithmic normal sampling range implementation of ParameterSamplingInterface. This class can be used to generate randomly log-normal sampled parameters within a given range. For example, for the distortions used in the simulation of CSDs. :param total_range: The total range in which the parameters can be sampled. This can be narrowed down randomly with the help of sampling_range. If the log-normal distribution generates a sample outside this range, a new sample is drawn until a sample inside the sampling_range/total_range was generated, leading toa truncated log-normal distribution. :type total_range: Tuple :param sampling_range: The maximum range in which the parameter is allowed to change during the simulation. The explicit range is set up during the initialization, narrowing down the supplied total_range. Default is None, which leads to no narrowing of the given total_range. :type sampling_range: Optional[float] :param rng: Random number generator used for the sampling of random numbers. If None, the default generator of numpy (np.random.default_rng()) is used. Default is None. :type rng: Optional[np.random.Generator] :param mean: Mean value of the underlying normal distribution. Default is 0. :type mean: float :param sigma: Standard deviation of the underlying normal distribution. Must be non-negative. Default is 1. :type sigma: float .. py:method:: sample_parameter() This method is used to sample a parameter for example from a given range with a given distribution. :returns: Sampled parameter .. py:method:: last_sample() This method is used to get the last sampled parameter. Which can be used to check which parameter exactly was used to simulate the last CSD. :returns: Last sampled parameter .. py:class:: UniformSamplingRange(total_range, sampling_range = None, rng = None) Bases: :py:obj:`ParameterSamplingInterface` .. autoapi-inheritance-diagram:: simcats.support_functions.UniformSamplingRange :parts: 1 Uniform sampling range implementation of ParameterSamplingInterface. This class can be used to generate randomly uniform sampled parameters within a given range. For example, for the distortions used in the simulation of CSDs. :param total_range: The total range in which the parameters can be sampled. This can be narrowed down randomly with the help of sampling_range. :type total_range: Tuple :param sampling_range: The maximum range in which the parameter is allowed to change during the simulation. The explicit range is set up during the initialization, narrowing down the supplied total_range. Default is None, which leads to no narrowing of the given total_range. :type sampling_range: Optional[float] :param rng: Random number generator used for the sampling of random numbers. If None, the default generator of numpy (np.random.default_rng()) is used. Default is None. :type rng: Optional[np.random.Generator] .. py:method:: sample_parameter() This method is used to sample a parameter for example from a given range with a given distribution. :returns: Sampled parameter .. py:method:: last_sample() This method is used to get the last sampled parameter. Which can be used to check which parameter exactly was used to simulate the last CSD. :returns: Last sampled parameter .. py:class:: ExponentialSamplingRange(total_range, scale, sampling_range = None, rng = None) Bases: :py:obj:`ParameterSamplingInterface` .. autoapi-inheritance-diagram:: simcats.support_functions.ExponentialSamplingRange :parts: 1 Exponential distribution sampling range implementation of ParameterSamplingInterface. This class can be used to generate randomly sampled parameters from an exponential distribution within a given range. The samples are calculated as follows: min(sampling_range) + exponential_distribution_sample * (max(sampling_range) - min(Sampling_range)) To select the correct scale factor (1 / λ), take the following into consideration: To have the p percent quantile at position q, the following must be valid: q = ln( 1 / (1-p) ) / λ with 1 / λ = scale So in general the scale is calculated as: scale = q / ln( 1 / (1-p) ) For example: If it is desired to have 90% of the values in 50% of the sampling range, we get: scale = 0.5 / ln( 1 / (1-0.9) ) = 0.21715 Further reading: https://en.wikipedia.org/wiki/Exponential_distribution#properties Used for example for the distortions during the simulation of CSDs. :param total_range: The total range in which the parameters can be sampled. This can be narrowed down randomly with the help of the parameter sampling_range. If the exponential distribution generates a sample outside this range, a new sample is drawn until a sample inside the sampling_range/total_range was generated, leading to a truncated exponential distribution. :type total_range: Tuple :param scale: The scale of the exponential distribution. See __init__ docstring for more detailed information. :type scale: float :param sampling_range: The maximum range in which the parameter is allowed to change during the simulation. The explicit range is set up during the initialization, narrowing down the supplied total_range. Default is None, which leads to no narrowing of the given total_range. :type sampling_range: Optional[float] :param rng: Random number generator used for the sampling of random numbers. If None, the default generator of numpy (np.random.default_rng()) is used. Default is None. :type rng: Optional[np.random.Generator] .. py:method:: sample_parameter() This method is used to sample a parameter for example from a given range with a given distribution. :returns: Sampled parameter .. py:method:: last_sample() This method is used to get the last sampled parameter. Which can be used to check which parameter exactly was used to simulate the last CSD. :returns: Last sampled parameter .. py:function:: fermi_filter1d(input, sigma, axis = -1, mode = 'reflect', cval = 0.0, radius = None) 1-D Fermi filter. :param input: The data that will be convolved :type input: np.ndarray :param sigma: The sigma for the Fermi-Dirac distribution :type sigma: float :param axis: The axis of input along which to calculate. Default is -1. :type axis: int :param mode: One of 'reflect', 'constant', 'nearest', 'mirror', or 'wrap'. The mode parameter determines how the input array is extended beyond its boundaries. Default is 'reflect'. Behavior for each valid value is as follows: - 'reflect' (d c b a | a b c d | d c b a): The input is extended by reflecting about the edge of the last pixel. This mode is also sometimes referred to as half-sample symmetric. - 'constant' (k k k k | a b c d | k k k k): The input is extended by filling all values beyond the edge with the same constant value, defined by the cval parameter. - 'nearest' (a a a a | a b c d | d d d d): The input is extended by replicating the last pixel. - 'mirror' (d c b | a b c d | c b a): The input is extended by reflecting about the center of the last pixel. This mode is also sometimes referred to as whole-sample symmetric. - 'wrap' (a b c d | a b c d | a b c d): The input is extended by wrapping around to the opposite edge. For consistency with the interpolation functions, the following mode names can also be used: - 'grid-mirror': This is a synonym for 'reflect'. - 'grid-constant': This is a synonym for 'constant'. - 'grid-wrap': This is a synonym for 'wrap'. :type mode: str :param cval: Value to fill past edges of input if mode is 'constant'. Default is 0.0. :type cval: float :param radius: The radius of the filter kernel. The kernel size will be 2*radius+1. If radius is None, a default radius = round(4.0 * sigma) will be used (similar to gaussian_kernel1d behavior). Default is None. :type radius: Union[None, int] :returns: Input data smoothed by the 1-D Fermi filter. :rtype: np.ndarray .. py:function:: fermi_dirac_derivative(x, x0, sigma) Evaluates the derivative of the Fermi–Dirac distribution. The distribution is defined by a center x0 and sigma, at given positions x. Allows creating a Fermi-Dirac filter kernel for the blurring of occupation transitions. :param x: The position of the points (in x-/voltage-space) for which the derivative will be evaluated :type x: np.ndarray :param x0: The center of the function :type x0: float :param sigma: Gamma-value of the distribution :type sigma: float :returns: Y-values for the supplied x-values :rtype: np.ndarray .. py:function:: cauchy_cdf(x, x0, gam) Evaluates a Cauchy Cumulative Distribution Function (CDF). The distribution is defined by x0 and gamma, at given positions x. :param x: The position of the points (in x-/voltage-space) for which the Cauchy CDF will be evaluated :type x: np.ndarray :param x0: The center of the function :type x0: float :param gam: Gamma-value of the distribution :type gam: float :returns: Y-values for the supplied x-values :rtype: np.ndarray .. py:function:: multi_cauchy_cdf(x, params) Evaluates a function based on multiple additive Cauchy Cumulative Distribution Functions (CDFs). Each CDF is defined by a x0 and gamma, at given positions x. :param x: The position of the points (in x-/voltage-space) for which the Cauchy CDF will be evaluated :type x: np.ndarray :param params: List of parameters for the Cauchy CDFs. For each CDF a floating point value defining the center and a floating point value defining gamma are expected. Example: [x0_0, gamma_0, x0_1, gamma_1, ...] :type params: list :returns: Y-values for the supplied x-values :rtype: np.ndarray .. py:function:: sigmoid_cdf(x, x0, gam) Evaluates a Cumulative Distribution Function (CDF) based on a Sigmoid. The distribution is defined by x0 and gamma, at given positions x. :param x: The position of the points (in x-/voltage-space) for which the sigmoid CDF will be evaluated :type x: np.ndarray :param x0: The center of the function :type x0: float :param gam: Gamma-value of the distribution :type gam: float :returns: Y-values for the supplied x-values :rtype: np.ndarray .. py:function:: multi_sigmoid_cdf(x, params) Evaluates a function based on multiple additive Sigmoid Cumulative Distribution Functions (CDFs). Each CDF is defined by a x0 and gamma, at given positions x. :param x: The position of the points (in x-/voltage-space) for which the sigmoid CDF will be evaluated :type x: np.ndarray :param params: List of parameters for the Sigmoid CDFs. For each CDF a floating point value defining the center and a floating point value defining gamma are expected. Example: [x0_0, gamma_0, x0_1, gamma_1, ...] :type params: list :returns: Y-values for the supplied x-values :rtype: np.ndarray .. py:function:: glf(potential, asymptote_left, asymptote_right, growth_rate, asymmetry, shape_factor, denominator_offset = 1, offset = 0) Function implementing the generalized logistic function. For further information see: https://en.wikipedia.org/wiki/Generalised_logistic_function :param potential: Originally called t. The potential is the variable of the GLF for which the value of the function should be calculated. :type potential: Union[float, np.ndarray] :param asymptote_left: Originally called A. This parameter is the left horizontal asymptote of the function. Any rational number can be used as the left asymptote. This parameter may take any rational number. :type asymptote_left: float :param asymptote_right: Originally called K. Specifies the right horizontal asymptote of the function when denominator_offset=1. If asymptote_left=0 and denominator_offset=1 then this parameter is also called the carrying capacity. This parameter may take any rational number. :type asymptote_right: float :param growth_rate: Originally called B. The growth rate of the function. The value must be a float and can be any rational number. Be careful with negative values, because the function is mirrored on a vertical straight line for these. This line passes through the point where the potential equals `offset`. :type growth_rate: float :param asymmetry: Originally called nu. This parameter introduces skew and affects symmetry. It also affects near which asymptote maximum growth occurs. The value of asymmetry must be a rational number greater than zero. - `asymmetry > 1`: the curve rises more gradually before the midpoint and more sharply after. - `asymmetry < 1`: the curve rises quickly early on and levels off more slowly. :type asymmetry: float :param shape_factor: Originally called Q. is related to the value Y(0) and adjusts the curve’s value at the y-intercept. Thereby it changes the shape of the function without changing the asymptotes. The shape factor can be any rational number. :type shape_factor: float :param denominator_offset: Originally called C. A constant added to the denominator inside the power. Controls the initial level of the denominator.This parameter must be a rational number. It typically takes a value of 1. Otherwise, the upper asymptote is asymptote_left + (asymptote_right-asymptote_left)/(denominator_offset^(1/asymmetry)). :type denominator_offset: float :param offset: Parameter that shifts the function starting from the zero point. If the offset is positive, the function is shifted to the right and if it is negative, it is shifted to the left. :type offset: float :returns: Value of the GLF at the given potential (originally time t) for a given set of parameters. The returned datatype is the same as the type of `potential`. :rtype: Union[float, np.ndarray] .. py:function:: inverse_glf(value, asymptote_left, asymptote_right, growth_rate, asymmetry, shape_factor, denominator_offset = 1, offset = 0) Inverse of the function `glf` which computes the inverse of a generalized logistic function for a set of parameters. :param value: The input value(s) for which to compute the inverse GLF. Can be a single float or a numpy array. :param asymptote_left: Originally called A. This parameter is the left horizontal asymptote of the function. Any rational number can be used as the left asymptote. This parameter may take any rational number. :type asymptote_left: float :param asymptote_right: Originally called K. Specifies the right horizontal asymptote of the function when denominator_offset=1. If asymptote_left=0 and denominator_offset=1 then this parameter is also called the carrying capacity. This parameter may take any rational number. :type asymptote_right: float :param growth_rate: Originally called B. The growth rate of the function. The value must be a float and can be any rational number. Be careful with negative values, because the function is mirrored on a vertical straight line for these. This line passes through the point where the potential equals `offset`. :type growth_rate: float :param asymmetry: Originally called nu. This parameter introduces skew and affects symmetry. It also affects near which asymptote maximum growth occurs. The value of asymmetry must be a rational number greater than zero. - `asymmetry > 1`: the curve rises more gradually before the midpoint and more sharply after. - `asymmetry < 1`: the curve rises quickly early on and levels off more slowly. :type asymmetry: float :param shape_factor: Originally called Q. is related to the value Y(0) and adjusts the curve’s value at the y-intercept. Thereby it changes the shape of the function without changing the asymptotes. The shape factor can be any rational number. :type shape_factor: float :param denominator_offset: Originally called C. A constant added to the denominator inside the power. Controls the initial level of the denominator.This parameter must be a rational number. It typically takes a value of 1. Otherwise, the upper asymptote is asymptote_left + (asymptote_right-asymptote_left)/(denominator_offset^(1/asymmetry)). :type denominator_offset: float :param offset: Parameter that shifts the function starting from the zero point. If the offset is positive, the function is shifted to the right and if it is negative, it is shifted to the left. :type offset: float :returns: Potential (originally time t) of the inverse GLF at the given value for a given set of parameters. The returned datatype is the same as the type of `value`. :rtype: Union[float, np.ndarray] .. py:function:: multi_glf(potential, *params) Function that combines several GLFs as a sum into one function. For further information see: https://en.wikipedia.org/wiki/Generalised_logistic_function Each GLF has the following parameters: - asymptote_left (float): Originally called A. This parameter is the left horizontal asymptote of the function. Any rational number can be used as the left asymptote. - asymptote_right (float): Originally called K. Specifies the right horizontal asymptote of the function when denominator_offset=1. If asymptote_left=0 and denominator_offset=1 then this parameter is also called the carrying capacity. This parameter may take any rational number. - growth_rate (float): Originally called B. The growth rate of the function. The value must be a float and can be any rational number. Be careful with negative values, because the function is mirrored on a vertical straight line for these. This line passes through the point where the potential equals `offset`. - asymmetry (float): Originally called nu. This parameter introduces skew and affects symmetry. It also affects near which asymptote maximum growth occurs. The value of asymmetry must be a rational number greater than zero. - If `asymmetry > 1`: the curve rises more gradually before the midpoint and more sharply after. - If `asymmetry < 1`: the curve rises quickly early on and levels off more slowly. - shape_factor (float): Originally called Q. is related to the value Y(0) and adjusts the curve’s value at the y-intercept. Thereby it changes the shape of the function without changing the asymptotes. The shape factor can be any rational number. - denominator_offset (float): Originally called C. A constant added to the denominator inside the power. Controls the initial level of the denominator.This parameter must be a rational number. It typically takes a value of 1. Otherwise, the upper asymptote is asymptote_left + (asymptote_right - asymptote_left) / (denominator_offset^(1 / asymmetry)). - offset (float): Potential offset, that shifts the function starting from the zero point. If the offset is positive, the function is shifted to the right and if it is negative, it is shifted to the left. The number of GLFs is specified by the number of parameters. To do this, the parameter count must be divisible by seven and a GLF is added for every seven other parameters. :param potential: Originally called t. The potential is the variable of the GLF for which the value of the function should be calculated. :type potential: Union[float, np.ndarray] :param \*params: Additional positional arguments representing the GLF parameters. The number of additional parameters must be divisible by seven and determines the number of GLFs that are used for the Multi-GLF. All parameters consist of sequential groups of seven floats that each represent a single GLF. All individual parameters are described above and are in the same order as they are described. :returns: Value of the GLF at the given potential (originally time t). :rtype: Union[float, np.ndarray] .. py:function:: reset_offset_mu_sens(dqd_sim, target_mu_sens, sweep_range_g1, sweep_range_g2) Helper function to reset the sensor offset mu sens before measuring a CSD. Can be used to reset the sensor to the steepest point before each CSD measurement. For example, this applies to configs generated by sample_random_variations_v3_config with the set_sensor_potential_offset_to_steepest_point option, which creates a configuration where the offset corresponds to the steepest point when no voltages are applied. **Warning**: This alters the provided Simulation object! Make sure to store the previous sensor offset if you want to re-use it later to reset the sensor to this point again. :param dqd_sim: SimCATS Simulation object, of which the offset_mu_sens should be adjusted, so that the sensor has the specified target_mu_sens at the initial sweep voltages. :type dqd_sim: Simulation :param target_mu_sens: The target mu sens to be reached at the initial sweep voltages. :param sweep_range_g1: Voltage sweep range of (plunger) gate 1 (second-/x-axis). Example: [min_V1, max_V1] :type sweep_range_g1: np.ndarray :param sweep_range_g2: Voltage sweep range of (plunger) gate 2 (first-/y-axis). Example: [min_V2, max_V2] :type sweep_range_g2: np.ndarray .. py:function:: signed_dist_points_line(points, line_points) Calculates the signed distance between points and a line defined by two points. :param points: The coordinates of the points for which the distance will be calculated, shape = (n, 2) :type points: np.ndarray :param line_points: The coordinates of two points defining the line, shape = (2, 2) :type line_points: np.ndarray :returns: The signed distances of the points to the line :rtype: np.ndarray .. py:function:: line_line_intersection(line1, line2) Method for calculating the intersection of two lines. Both lines can be specified either by a straight line equation (m*x+b) or by a single number if it is a vertical line. The single number gives the x coordinate of the vertical line. :param line1: A two element sequence when it's a straight line equation (m,b) or a single number when line1 is a vertical line. In this case, the number indicates the x coordinate of the vertical line. :type line1: Union[Sequence, np.ndarray, numbers.Real] :param line2: A two element sequence when it's a straight line equation (m,b) or a single number when line1 is a vertical line. In this case, the number indicates the x coordinate of the vertical line. :type line2: Union[Sequence, np.ndarray, numbers.Real] :returns: The x and y coordinates of the intersection of the two lines. If there is no intersection, an exception is thrown. .. py:function:: line_circle_intersection(line, circle_center, radius) Method for calculating the intersection of a line and a circle. :param line: The line with which the intersection points are to be calculated. This line can either be given as a tuple with the slope and y-intercept in the form (m,b) or as a float if it is a vertical line. :type line: Union(float,Tuple) :param circle_center: The center of the circle. The center is specified as a tuple (x-center, y-center). :type circle_center: Tuple :param radius: The radius of the circle. The radius is specified as float that can be any rational number greater than 0. :type radius: float :returns: This method returns a list of the intersection points of the line and a circle. The points are returned as a tuple with the form (x-coordinate,y-coordinate). The list of intersection points can contain zero to two tuples. Accordingly, an empty list is returned if the line and the circle have no intersection. :rtype: List[Tuple] .. py:function:: is_point_below_line(point, line) Method for evaluating whether a point is below a line. :param point: Point to be evaluated. :type point: Tuple[float, float] :param line (Union[Tuple[float: Either a straight line (m*x+b) given as a tuple (m,b) or as a single value if it is a horizontal line. This then specifies the height b of the line. :param float]: Either a straight line (m*x+b) given as a tuple (m,b) or as a single value if it is a horizontal line. This then specifies the height b of the line. :param float]: Either a straight line (m*x+b) given as a tuple (m,b) or as a single value if it is a horizontal line. This then specifies the height b of the line. :returns: True if the point is below the line, False otherwise. :rtype: bool .. py:function:: pixel_to_volt_1d(pixel, pixel_num, volt_limits) Method that maps a pixel index to a voltage value within specified voltage limits. This function linearly maps a pixel position within a span of `pixel_num` pixels to a corresponding voltage value. The voltage values of the pixel span change uniformly between the two values in `volt_limits`. :param pixel: The pixel index starting at 0. :type pixel: int :param pixel_num: Total number of pixels in the span. :type pixel_num: int :param volt_limits: A 1D array of shape (2,) containing the start and end voltage values. The start value is the first of the two values and the end value is the last one. :type volt_limits: np.ndarray :returns: The voltage value corresponding to the given pixel index. :rtype: np.ndarray .. py:function:: rotate_points(points, angle = np.pi / 4) Rotates a point (or multiple points) by the given angle. :param points: 2D-Numpy array with the coordinates of the points, shape = (n, 2), first column = x-coordinate, second column = y-coordinates. :type points: np.ndarray :param angle: The angle for the rotation. Default is np.pi/4. :type angle: float :returns: Numpy array with rotated coordinates, shape = (n, 2). :rtype: np.ndarray .. py:function:: plot_csd(csd, volt_limits_g1, volt_limits_g2, title = None, sensor_label = 'Sensor signal [a.u.]', gate_labels = None, voltage_unit = 'V', save_path = None, sort_volts = True, num_xticks = 5, num_yticks = 5) Plots a CSD. Can be used for 2D and 1D scans. :param csd: Numpy array containing the CSD. For 2D scans (csd.ndim == 2): First-/y-axis = (plunger) gate 2, second-/x-axis = (plunger) gate 1. Both voltages are expected to map to the axes taking into account the direction of the measurement represented in the volt_limits. :type csd: np.ndarray :param volt_limits_g1: Voltage limits of (plunger) gate 1 (second-/x-axis). Example: [start_V1, stop_V1] :type volt_limits_g1: np.ndarray :param volt_limits_g2: Voltage limits of (plunger) gate 2 (first-/y-axis). Example: [start_V2, stop_V2] :type volt_limits_g2: np.ndarray :param title: The title of the plot. Default is None. :type title: Optional[str] :param sensor_label: The label for the sensor value (2D scan: colorbar label, 1D scan: y-axis-label). Default is 'Sensor signal [a.u.]'. :type sensor_label: str :param gate_labels: The labels of the gates with voltages volt_limits_g1 respective volt_limits_g2. :type gate_labels: Optional[list] :param voltage_unit: The unit for the volt_limits. :type voltage_unit: str :param save_path: Filepath at which the plot will be saved. Default is None. :type save_path: Optional[str] :param sort_volts: Specifies if the plot should show the lowest voltages at the lowest index (and if required flip the image). For 1D data it is sorted by gate 1. Else the voltages will appear as defined by the volt_limits. Default is True. :type sort_volts: bool :param num_xticks: Specifies how many xticks are displayed. Default is 5. :type num_xticks: int :param num_yticks: Specifies how many yticks are displayed. Default is 5. :type num_yticks: int