Example #1
0
    def __init__(self, sliced_tab, orbital_tab, max_orbitals=-1):
        self.sliced_tab = sliced_tab
        self.orbital_tab = orbital_tab
        if max_orbitals != -1:
            self.model = LMFitModel(sliced_tab.get_data(),
                                    orbital_tab.get_orbitals()[:max_orbitals])
        else:
            self.model = LMFitModel(sliced_tab.get_data(),
                                    orbital_tab.get_orbitals())

        # Setup GUI
        super(LMFitTab, self).__init__()
        self.setupUi(self)

        self._setup()
        self._connect()

        self.refresh_all()
Example #2
0
    def __init__(self, sliced_data, orbitals):

        self.model = LMFitModel(sliced_data, orbitals)

        # Setup GUI
        super(LMFitTab, self).__init__()
        self.setupUi(self)

        self._setup()
        self._connect()

        self.refresh_sliced_plot()
        self.refresh_selected_plot()
        kmap = self.refresh_sum_plot()
        self.refresh_residual_plot(weight_sum_data=kmap)
Example #3
0
    def __init__(self, lmfit_tab, results, settings):
        
        self.results = results
        self.lmfit_tab = lmfit_tab
        self.current_result = self.results[0]
        self.settings = settings
        self.model = LMFitModel(*self.lmfit_tab.get_data())
        self.model.set_settings(settings)

        # Setup GUI
        super(LMFitResultTab, self).__init__()
        self.setupUi(self)

        self._setup()
        self._connect()

        self.refresh_all()
Example #4
0
    def __init__(self, data, results, settings):

        self.results = results
        self.current_result = self.results[0]

        self.model = LMFitModel(*data)
        self.model.set_settings(settings)

        # Setup GUI
        super(LMFitResultTab, self).__init__()
        self.setupUi(self)

        self._setup()
        self._connect()

        self.refresh_sliced_plot()
        self.refresh_selected_plot()
        kmap = self.refresh_sum_plot()
        self.refresh_residual_plot(weight_sum_data=kmap)
Example #5
0
data_path = Path(__file__).parent / Path('../data/')

# Load experimental data as SlicedData object
exp_data = SlicedData.init_from_hdf5(data_path / 'example5_6584.hdf5')

# Load orbitals for fitting as OrbitalData objects
orbital_paths = [
    'PTCDA_C.cube', 'PTCDA_D.cube', 'PTCDA_E.cube', 'PTCDA_F.cube'
]
orbitals = [
    OrbitalData.init_from_file(data_path / path, ID)
    for ID, path in enumerate(orbital_paths)
]

# Initialize fit as LMFitModel object
lmfit = LMFitModel(exp_data, orbitals)

# Set common range and delta-k-grid for exp. and sim. kmaps
range_, dk = [-3.0, 3.0], 0.04
lmfit.set_axis_by_step_size(range_, dk)
lmfit.set_polarization('toroid', 'p')
lmfit.set_background_equation('c')

# Set parameters not intended for fitting to desired value
lmfit.edit_parameter('E_kin', value=27.2, vary=False)
lmfit.edit_parameter('alpha', value=40, vary=False)

# Activate fitting for background ('c') and all orbital weights
lmfit.edit_parameter('c', value=250, vary=True)  # constant background
for i in [0, 1, 2, 3]:
    lmfit.edit_parameter('w_' + str(i), vary=True)
Example #6
0
    def setUp(self):

        self.lmfit = LMFitModel(TestLMFitModel.sliced_data,
                                TestLMFitModel.orbitals)
        self.crosshair = CrosshairAnnulusModel()
Example #7
0
    def test_settings(self):

        lmfit_new = LMFitModel(TestLMFitModel.sliced_data,
                               TestLMFitModel.orbitals)

        lmfit_new.set_settings(self.lmfit.get_settings())