buzzutil

buzz.buzzutil

Functions

closestRMS(results, RMS1, RMS2[, radius, ...])

cum_sum_rms(ASD, fq)

Calculate the RMS from the ASD.

distance(x1, y1, x2, y2)

filtparam(results, param_name, high_low[, ...])

Filters the results in the results list by the param_name value being between the high_low values

listparams(results, paramname)

load_results(filename)

Loads the results from a pickle file

lyap_rms_cont(model, model_dict, outputs, ...)

Calculate the RMS noise of a state space model by solving the Lyapunov equation.

output_noises(model, model_dict, ...[, ...])

Traces noise from an OSEM to a target output.

save_results(results, filename)

Saves the results to a pickle file

Details

closestRMS(results, RMS1, RMS2, radius=None, RMS1_distance=None, RMS2_distance=None)[source]
cum_sum_rms(ASD, fq)[source]

Calculate the RMS from the ASD.

Parameters:
  • ASD (array) – Array of the ASD.

  • fq (array) – Array of the frequencies.

Returns:

RMS value.

Return type:

rms (array)

distance(x1, y1, x2, y2)[source]
filtparam(results, param_name, high_low, compare='between', tol=0.0)[source]

Filters the results in the results list by the param_name value being between the high_low values

Parameters:
  • results (list) – list of results dictionaries that include the param_name

  • param_name (str) – name of the parameter to filter by

  • high_low (list or float or int) – list of two values that are the high and low values to filter, or a single value that should be matched, or if compare is ‘outside’ then the value to be outside of, or if compare is ‘eq’ or ‘equal’ then the value or list of values the parameters need to be equal to.

  • compare (str, optional) – ‘between’ or ‘outside’ or ‘eq’ or ‘equal’ or ‘neq’ or ‘not equal’. Defaults to ‘between’.

  • tol (float, optional) – tolerance for the comparison. Defaults to 0.0.

Returns:

list of the results that are within the high_low values

Return type:

list

listparams(results, paramname)[source]
load_results(filename)[source]

Loads the results from a pickle file

Parameters:

filename (str) – filename to load the results from

Returns:

list of results dictionaries

Return type:

list

lyap_rms_cont(model, model_dict: dict, outputs: list, white_noises: list, pkg: str = 'scipy', balance_gain=False)[source]

Calculate the RMS noise of a state space model by solving the Lyapunov equation. Note the model must be continuous.

Parameters:
  • model (StateSpace) – The model to calculate the RMS noise of.

  • model_dict (dict) – The input and output dictionary of the model.

  • outputs (list | np.array) – list of outputs to calculate the RMS noise to.

  • white_noises (list | np.array) – list of white noise inputs.

  • pkg (str, optional) – The package to use to solve the Lyapunov equation. Defaults to ‘scipy’.

  • balance_gain (bool, optional) – Whether the system should be reduced using the controlUtil.balance_sys_gain function. Defaults to False.

Returns:

dictionary of RMS noise values. the keys of this dictionary are the outputs and the values are the RMS noise values.

Return type:

dict

output_noises(model, model_dict, target_outputs, F_Hz, white_noises, in_noises=None)[source]

Traces noise from an OSEM to a target output.

Parameters:
  • model (control.ss) – The model of the system to trace noise in.

  • model_dict (dict) – The dictionary of the model.

  • target_outputs (str) – The name of the output to trace noise to.

  • F_Hz (frequency_array) – Array of frequencies to trace noise to.

  • white_noises (dict, optional) – Dictionary of white noise signals to feed noise into.

  • in_noises (dict, optional) – Dictionary of input noise signals to feed noise into. Defaults to None.

Returns:

Dictionary of the noise. The Keys are the names of the noises and the values are dictionaries that with two keys: ‘fq’, which is a list of frequencies and ‘asd’, which is a list of the ASD at those frequencies.

Return type:

noise_dic (dict)

save_results(results, filename)[source]

Saves the results to a pickle file

Parameters:
  • results (list) – list of results dictionaries

  • filename (str) – filename to save the results to