Fitting MF (or other) datasets

12/09/22

For the basic (default) case, using AF data, see the basic demo notebook and PEMtk fitting setup & batch run demo notebook. This notebook is based on the latter, but demonstrates additionally:

  • Switching the fit dataset to use MF data as a function of polarization (as opposed to AF data as a function of alignment/time in the earlier demo case).

  • Switching the backend to calculate MFPADs (see the backends notebook for more).

  • Running fits.

Note that the methods here should be general, allowing for fitting of MF or AF/LF data vs. alignment, time, energy or polarization geometry depending on the dataset.

Setup

Here we’ll use the demo script, as per the PEMtk fitting setup & batch run demo notebook, then replace some of the defaults later. Alternatively, the MF case could be setup from scratch following the basic demo notebook.

[1]:
# Import & set paths
import pemtk
from pemtk.fit.fitClass import pemtkFit

from pathlib import Path

# Path for demo script
demoPath = Path(pemtk.__file__).parent.parent/Path('demos','fitting')

# Run demo script to configure workspace
%run {demoPath/"setup_fit_demo.py"}
*** ePSproc installation not found, setting for local copy.
* Setting plotter defaults with epsproc.basicPlotters.setPlotters(). Run directly to modify, or change options in local env.
* Set Holoviews with bokeh.
C:\Users\femtolab\.conda\envs\ePSdev\lib\site-packages\xyzpy\plot\xyz_cmaps.py:6: MatplotlibDeprecationWarning:
The revcmap function was deprecated in Matplotlib 3.2 and will be removed two minor releases later. Use Colormap.reversed() instead.
  return LinearSegmentedColormap(name, cm.revcmap(cmap._segmentdata))
*** Setting up demo fitting workspace and main `data` class object...
For more details see https://pemtk.readthedocs.io/en/latest/fitting/PEMtk_fitting_basic_demo_030621-full.html
To use local source code, pass the parent path to this script at run time, e.g. "setup_fit_demo ~/github"


* Loading packages...