analysis subpackage

analysis.experiments module

Analysis of test results.

Description to come, see: http://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html

Notes

This could actually be a class that extends DataFrame. In this case, the module level functions would become methods of the class. But for now, the following implementation will allow futher development.

Functions

  • mass_transfer – perform analysis on the experimental data.
  • preprocess – ready a DataFrame for analysis.
  • results_from_csv – get analysis results from a .csv file.
chamber.analysis.experiments.mass_transfer(dataframe, sigma=4e-08, steps=100, plot=False)[source]

Perform analysis of experiment.

Use the dataframe and uncertainty to perform an opening window analysis. This function finds all valid relative humidity targets for a given DataFrame. For each of these targets, the function determines where the RH occurs, generates windows up to max_half_length, performs analysis on each window, and returns the results.

Parameters:
  • dataframe (DataFrame) – Processed experimental data.
  • sigma (float) – Standard deviation of mass measurement. Defaults to 4e-8 accoriding to the spec sheet.
  • steps (int) – Steps to increase the half_length.
Returns:

Results of the analysis of the test. Attributes include: - a: y-intercept - sig_a: standard deviation of a - b: slope (mass-transfer) - b_sig: standard deviation of b - chi_2: chi-square metric - Q: goodness of fit score (survival function) - nu: degrees of freedom - RH: target relative humidity - SigRH: target relative humidity - spalding_mdpp: mass flux determinded by Spalding Model

Return type:

DataFrame

Examples

Todo

Examples.

chamber.analysis.experiments.preprocess(dataframe, param_list=['PressureSmooth', 'TeSmooth', 'DewPointSmooth'], purge=False)[source]

Readies a DataFrame for further analysis.

This function takes in a DataFrame and calls all of the module helper functions to produce a DataFrame that is ready for analysis.

The following steps are included in ‘preprocess’:

‘_zero_time’ ‘_format_temp’ ‘_format_dew_point’ ‘_format_pressure’ ‘_add_avg_te’ ‘_add_smooth_avg_te’ ‘_add_smooth_dew_point’ ‘_add_smooth_pressure’ ‘_add_rh’

See respective docstrings for more details.

Parameters:
  • dataframe (DataFrame) – A DataFrame of experimental data to be preprocessed.
  • param_list (list(str)) – List of parameters to use to calculate the relative humidity using the CoolProp API, see _get_coolprop_rh docstring for more detail. Defaults to: [‘PressureSmooth’, ‘TeSmooth’, ‘DewPointSmooth’].
  • purge (bool) – If True the original raw data is removed from the returned DataFrame. If False the raw data remains in the ‘DataFrame’. Defaults to False.
Returns:

The preprocessed data.

Return type:

DataFrame

Examples

Todo

Examples.

chamber.analysis.experiments.rh_targets_df(dataframe, res_df)[source]

Build the RHTargets table and run Spalding analysis.

analysis.chi2 module

Module for performing chi-squared linear regression.

Functions

  • chi2 – perfroms a chi-squared linear regression.
chamber.analysis.chi2.add_noise(y, amp)[source]

Use amp to add noise to _y attribute.

Todo

add_noise docstring or make function private.

chamber.analysis.chi2.add_steps(y, resolution)[source]

Use bins to digitize y in to specified resolution.

Todo

add_steps docstring or make function private.

chamber.analysis.chi2.chi2(x, y, sigma, plot=False)[source]

Use all of the helper function above to determine chi2 stats.

Todo

chi2 docstring.