sweep_design.config.base_config
Module Contents
Classes
The configuration class. |
- class sweep_design.config.base_config.Config[source]
The configuration class.
The methods used to calculate the various parameters are provided in the configuration file. Also the file contain an other parameters.
—
get_array_axis_from_array_method:
Method to create new instance of ArrayAxis from some array of numbers.
- Parameters
x (ArrayLike) – input array_like of numbers.
round_dx (bool, optional) – if True then round sample. Defaults to True.
- Returns
new ArrayAxis.
- Return type
—
interpolate_extrapolate_method:
The method by which interpolation and extrapolation are performed. The method returns a function that takes a new x sequence and return a new y sequence.
Method derived from default function: sweep_design.defaults.methods.interpolate_extrapolate
- Parameters
x (X) – numbers array of axis. Samples can be not equal.
y (Y) – Representation interpolated extrapolated functions as array.
bounds_error (bool, optional) – if False then do not raise error if new array behind of bound old array. Defaults to False.
fill_value (float, optional) – default fill value if other not expected. Defaults to 0.0.
- Returns
- Callable that get first new array of x and return
interpolate-extrapolate result.
- Return type
Callable[[X], Y]
—
math_operation_method:
Method for math operation Method derived from default function: sweep_design.defaults.math_operation
- Parameters
y1 (np.ndarray) – first sequence y.
y2 (Union[np.ndarray, Number]) – second sequence y or other number name_operation (MathOperation): which mathematical operation (+, -, *, / and etc.)
- Raises
TypeFuncError – if operation can not be executed.
- Returns
result of math operation.
- Return type
Y
—
integrate_one_method:
Method for calculating the integral of a sequence on a segment. Method derived from default function: sweep_design.defaults.methods.one_integrate
- Parameters
relation (Relation) – from will be calculated integral.
- Returns
result of integration.
- Return type
float
—
integrate_method:
The method by which the integration array is performed. Integration across the entire function. Get the expected integrated array function. Method derived from default function: sweep_design.defaults.methods.integrate
- Parameters
relation (Relation) – integrated function.
- Returns
result of integration of function.
- Return type
Tuple[XAxis, Y]
—
integrate_function_method:
The method by which the integration function is performed. Integration across the entire function. Get the expected integrated array function. Method derived from default function: sweep_design.defaults.methods.integrate_function
- Parameters
function (Callable[[x], y]) – function is describing changes frequency from time.
x (np.ndarray) – time array.
- Returns
result of integration function.
- Return type
—
differentiate_method:
The method by which differentiation is performed. Method derived from default function: sweep_design.defaults.methods.differentiate
- Parameters
relation (Relation) – function which will be differentiated.
- Returns
result of differentiation.
- Return type
Tuple[XAxis, Y]
—
correlate_method:
The method by which the correlation is performed. Method derived from default function: sweep_design.defaults.methods.correlate
- Parameters
- Returns
result of correlation.
- Return type
Tuple[XAxis, np.ndarray]
—
convolve_method:
The method by which the convolution is performed. Method derived from default function: sweep_design.defaults.methods.convolve
- Parameters
- Returns
result of convolution.
- Return type
Tuple[XAxis, np.ndarray]
—
get_common_x:
A method by which to find the common sequence of numbers along the x-axis, obtained from two other sequences along the x-axis. Method derived from default function: sweep_design.defaults.methods.get_common_x
- Parameters
x1 (XAxis) – first axis.
x2 (XAxis) – second axis.
- Returns
return common axis.
- Return type
XAxis
—
spectrum2signal_method:
Method for converting a spectrum into a signal. (Using Fourier transform) Method derived from default function: sweep_design.defaults.methods.spectrum2signal
- Parameters
relation (Relation) – spectrum of signal.
time_start (float, optional) – default fft convert to 0. time. Maybe you want another start of time. Defaults to None.
- Returns
result transformation spectrogram to signal.
- Return type
Tuple[TimeAxis, np.ndarray]
—
signal2spectrum_method: Method for converting a signal into a spectrum. (Using Fourier transform) Method derived from default function: sweep_design.defaults.methods.signal2spectrum
- Parameters
relation (Relation) – signal from which get spectrum.
is_start_zero (bool, optional) – Consider array started from zero time. Defaults to False.
- Returns
- result transformation signal to
spectrum.
- Return type
Tuple[FrequencyAxis, np.ndarray]
—
The above methods can be overridden with your own here, or you can import the class Config somewhere and override it there. (They must be written according to the rules corresponding to the input and output parameters)
- get_array_axis_from_array_method
- interpolate_extrapolate_method
- math_operation
- integrate_one_method
- integrate_method
- integrate_function_method
- differentiate_method
- correlate_method
- convolve_method
- get_common_x
- spectrum2signal_method
- signal2spectrum_method