sweep_design.uncalculated_sweep

Module Contents

Classes

UncalculatedSweep

The UncalculatedSweep class prepares for the calculation of the

ApriorUncalculatedSweep

ApriorUncalculatedSweep

class sweep_design.uncalculated_sweep.UncalculatedSweep(time: Union[sweep_design.axis.ArrayAxis, sweep_design.help_types.ArrayLike] = None, frequency_time: Union[sweep_design.defaults.sweep_methods.Ftatr, sweep_design.help_types.ArrayLike, sweep_design.defaults.sweep_methods.InterpolateArray] = None, amplitude_time: Union[sweep_design.defaults.sweep_methods.Ftatr, sweep_design.help_types.ArrayLike, sweep_design.defaults.sweep_methods.InterpolateArray] = None)[source]

The UncalculatedSweep class prepares for the calculation of the signal sweep (Sweep).

The get_info_from_ftat function is used to extract the frequency versus time and amplitude versus time functions from the passed frequency_time and amplitude_time parameters.

Analytic functions (frequency_time and amplitude_time) can be as array of numbers or as callable object(lambda function, common python functions and ect.) Example: frequency_time = lambda t: t*10+1, amplitude_time = lambda t: np.ones(t.size)

Raises
  • BadInputError – raise exception when calling instance without parameter

  • time or when time attribute is not created when instance initialized.

Initialize instance of UncalculatedSweep.

Parameters
  • time (ArrayLike, optional) – The ArrayAxis, or an ArrayLike object containing numbers(real or complex). Defaults to None.

  • frequency_time (Union[Ftatr, ArrayLike], optional) – This parameter, which describes changes in frequency over time, can be either an array_like, or an object from which an instance of the Relation class will be created, or an instance of the Relation class, or a callable object that returns a numeric sequence. If None, then the linear function f = t will be used. Defaults to None.

  • amplitude_time (Union[Ftatr, ArrayLike], optional) – This parameter, which describes changes in amplitude modulation over time, can be either an array_like, or an object from which an instance of the Relation class will be created, or an instance of the Relation class, or a callable object that returns a numeric sequence. If None, then the function will be assumed to be constant and equal to 1. Defaults to None.

__call__(time: Union[sweep_design.axis.ArrayAxis, sweep_design.help_types.ArrayLike] = None, tht0=0.0) sweep_design.sweep.Sweep[source]

Calling an instance with appropriate to calculate the sweep signal.

If time is not passed or equals None, then the time sequence created when the class instance was initialized will be used.

Parameters
  • time (Union[ArrayAxis, ArrayLike], optional) – The number sequence determines the time. Defaults to None.

  • tht0 (float, optional) – Zero phase. Defaults to 0.0.

Raises

BadInputError – raise exception when calling instance without parameter time when time attribute is not created when instance initialized.

Returns

an instance of the Sweep class - the calculated sweep signal.

Return type

Sweep

_func_tht(frequency_time: Callable[[numpy.ndarray], numpy.ndarray]) Callable[[sweep_design.axis.ArrayAxis], sweep_design.relation.Relation][source]

Functional representation of angular sweep.

_array_tht(frequency_time: numpy.ndarray) Callable[[sweep_design.axis.ArrayAxis], sweep_design.relation.Relation][source]

Angular sweep represented by a numerical sequence.

class sweep_design.uncalculated_sweep.ApriorUncalculatedSweep(time: Any = None, a_prior_data: Any = None, ftat_method: Optional[sweep_design.defaults.sweep_methods.CallFtatMethod] = None)[source]

Bases: UncalculatedSweep

ApriorUncalculatedSweep

Class for constructing a sweep signal from a priori data (from another signal or spectrum).

The calculation of the change in frequency with time (frequency_time) and the amplitude envelope with time (amplitude_time) will depend on the a priori data (aprior_data) and on the method (ftat_method) by which they will be calculated.

The extracted frequency over time (frequency_time) and the amplitude envelope over time (amplitude_time) will be send to the UncalculatedSweep constructor.

Configuring an instance to create a sweep from a aprior data.

Parameters
  • time (Any, optional) – The number sequence determines the time. Defaults to None.

  • a_prior_data (Any, optional) – Data from which will be extracted frequency and amplitude modulation. Defaults to None.

  • ftat_method (CallFtatMethod, optional) – If the conversion method (ftat_method) is not defined or None, then the method is taken from the SweepConfig class freq2time Method can be overridden if necessary (sweep_design.math_signals.config.SweepConfig.freq2time). Defaults to None.

__call__(time: Union[sweep_design.axis.ArrayAxis, sweep_design.help_types.ArrayLike] = None, tht0=0.0, is_normalize=True) sweep_design.sweep.Sweep[source]

Calculate the sweep and normalize it.

Parameters
  • time (Union[ArrayAxis, ArrayLike], optional) – The number sequence determines the time. Defaults to None.

  • tht0 (float, optional) – Zero phase. Defaults to 0.0.

  • is_normalize (bool, optional) – Use normalization a prior data for sweep signal. Defaults to True.

Returns

an instance of the Sweep class - the calculated sweep signal

from a prior data.

Return type

Sweep