PyDDM.ddm_analysis_and_fitting.fit_report
PyDDM.ddm_analysis_and_fitting.fit_report¶
-
fit_report
(fit_results, PDF_save=True, forced_qs=None, pdf_save_dir='./', forced_qs_for_tau2=None, q_indices=[10, 20, 30, 40], use_new_tau=True, fit_report_name=None, show=True)¶ Creates a set of plots based on fit results
Creates plots (saved in a single PDF file if PDF_save is True (the default)) based on the DDM fit results. Plots of the DDM matrix or the ISF are shown versus lag time along with the theoretical model calculated with the best fit parameters. Also shown are the decay time (tau) vs wavevector (q) plots, the amplitude vs the wavevector, and the background vs the wavevector. Depending on the fit model used, the second decay time, fraction of dynamics with the first decay time, the non-ergodicity parameter, and the Schulz number may also be plotted.
By fitting the tau vs q plot to a power law, one can get parameters describing the type of dynamics. These quantities are stored as attributes to the fit_results xarray Dataset which is returned.
- Parameters
fit_results (xarray Dataset) – Results of the DDM fitting to either the DDM matrix or the ISF.
PDF_save (bool, optional) – Saves plots to a PDF file. The default is True.
forced_qs (list or None, optional) – Does power law fitting over this range of q. The default is None. If not None, must be list-like with two numbers indicating the index of the lower and upper q.
pdf_save_dir (str, optional) – Location to save the PDF. The default is “./” (the current working directory).
forced_qs_for_tau2 (list or None, optional) – Like forced_qs but for the second decay time
q_indices (list, optional) – List of q indices to show when plotting the DDM matrix or ISF vs lag time along with the theoretical model. The default is [10,20,30,40].
use_new_tau (bool, optional) – If True, calculates a more representative decay time based on the value of tau and the stretching exponent. The default is True.
fit_report_name (str, optional) – String appended to the filename of the PDF generated. The default is None. If None, the file will be named ‘ddm_fit_report.pdf’ in the directory specified by the parameter pdf_save_dir. If not None, then it will be named ‘ddm_fit_report_{fit_report_name}.pdf’
show (bool, optional) – Plots will appear if True. The default is True.
- Returns
fit_results – Results of DDM fitting with attributes possibly changed
- Return type
xarray Dataset