multi_edge_fit_models¶
MultiEdgeFit Functions
Based on VirtualBeamline by Mario Delgado Jaime
BackgroundThreeRegionModel
¶
Bases: Model
LMFit model for :func:background_three_region.
The spectrum energy and signal are independent variables; the slopes, transition
energies, and reference energy are fitted parameters. :meth:guess uses the
project's existing edge and slope estimators to initialize all six parameters.
Source code in mmg_toolbox/xas/multi_edge_fit_models.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | |
guess(data, x, **kwargs)
¶
Estimate all background parameters from energy and signal arrays.
Estimated parameters:
- ``m1``: linear fit to the pre-edge region, ending about 10 eV before the
estimated L3 edge.
- ``m2``: linear fit around the midpoint between L3 and L2; for elements other
than Cu, Co, and Ni, this is set equal to ``m1``.
- ``m3``: linear fit to the post-edge region, starting about 10 eV after L2.
- ``t1``: estimated L3 edge energy from the signal derivative extrema.
- ``t2``: estimated L2 edge energy, calculated from ``t1`` and the element's
spin-orbit splitting.
- ``e_ref``: the second energy sample, used as the background reference energy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
ndarray
|
the signal array (y-axis) |
required |
x
|
ndarray
|
the energy array (x-axis) |
required |
Returns:
| Type | Description |
|---|---|
Parameters
|
Parameters object |
Source code in mmg_toolbox/xas/multi_edge_fit_models.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | |
DoubleLEdgeModel
¶
Bases: Model
LMFit model for the combined L3/L2 edge-step function.
:meth:guess estimates the edge intensity and L3 energy from the supplied data,
uses the element's tabulated spin-orbit splitting, and initializes line-shape
parameters from the project's standard starting values.
Source code in mmg_toolbox/xas/multi_edge_fit_models.py
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | |
guess(data, x, **kwargs)
¶
Estimate starting values for the double L-edge parameters.
Estimated parameters:
- intensity_l3: estimated from the difference between the median upper and
lower signal tails, divided by the combined edge-height factor of 1.5.
- e0_l3: estimated from the midpoint of the largest and smallest signal
derivative locations, using the project's edge-energy estimator.
- spin_orbit_2p: read from the atomic-parameter table for the element
identified from the mean energy.
- gaussian_fraction: initialized to 0 (Lorentzian/arctangent line shape).
- width_l3: initialized to the project's standard L3 half-width of 0.3 eV.
- width_l2: initialized to the project's standard L2 half-width of 0.5 eV.
- l2_intensity_ratio: initialized to the function default of 0.5.
- l2_energy_factor: initialized to the function default of 1.5.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
ndarray
|
measured edge signal (y-axis) |
required |
x
|
ndarray
|
energy array (x-axis) |
required |
Returns:
| Type | Description |
|---|---|
Parameters
|
initialized LMFit parameters |
Source code in mmg_toolbox/xas/multi_edge_fit_models.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | |