aim2dat.fct.discretization
¶
Module to create grids to discretize a function.
Module Contents¶
Classes¶
Class to create an axis to discretize a 1d function i.e. a 2d plot |
|
Class to create a grid to discretize a 1d function i.e. a 2d plot. |
Functions¶
|
Limit an array to a given minimum and maximum value. |
- class aim2dat.fct.discretization.DiscretizedAxis(axis_type, **kwargs)[source]¶
Class to create an axis to discretize a 1d function i.e. a 2d plot in a grid. Different methods for the discretization are available.
Overview
¶ x –> y or y –> x.
Axis array. Contains the discrete values.
Specify whether this axis should be used as x or y axis in a grid.
Discretize the specified range.
Check whether the axis is empty.
Tuple specifying the dimensions of the axis (like numpy).
¶ discretize_axis
(**kwargs)Perform the discretization of the specified range.
Change the axis_type: x –> y or y –> x.
- property T : DiscretizedAxis¶
x –> y or y –> x.
- property axis : numpy.array¶
Axis array. Contains the discrete values.
- Returns:¶
np.array – The discretized range.
- property axis_type : str¶
Specify whether this axis should be used as x or y axis in a grid.
- property discretization_method : collections.abc.Callable¶
Discretize the specified range. Can be chosen via a string, accepting the methods specified in _available_discretization_methods or by passing a callable function.
- Returns:¶
Callable – Method to discretize the axis.
- property is_empty : bool¶
Check whether the axis is empty.
- Returns:¶
bool – Whether the axis is empty.
- property shape : tuple¶
Tuple specifying the dimensions of the axis (like numpy).
- Returns:¶
tuple – The shape of the axis.
- discretize_axis(**kwargs) DiscretizedAxis [source]¶
Perform the discretization of the specified range.
- Returns:¶
DiscretizedAxis
- transpose() DiscretizedAxis [source]¶
Change the axis_type: x –> y or y –> x.
- Returns:¶
DiscretizedAxis – Transposed axis.
- class aim2dat.fct.discretization.DiscretizedGrid(**kwargs)[source]¶
Class to create a grid to discretize a 1d function i.e. a 2d plot.
Use the plot_grid method to visualize the created grid.
Overview
¶ Return the internal grid as a list of lists.
Check whether the axis is empty.
¶ Create the internal grid which is based on a list of lists.
Plot the grid.
- property grid : list¶
Return the internal grid as a list of lists.
- Returns:¶
type – list: List of lists representing the x-values and discretized y-values.
- property is_empty : bool¶
Check whether the axis is empty.
- Returns:¶
bool – Whether the axis is empty.
- create_grid() DiscretizedGrid [source]¶
Create the internal grid which is based on a list of lists. Each list contains the energy-value (x) as the first argument and the DOS-values (y) as a list in the second argument.
- Returns:¶
DiscretizedGrid – Discretized grid.