container_functions¶
average_polarised_scans(*scans)
¶
Find unique polarisations and average each scan at that polarisation Spectra are only separated by polarisation, all spectra with the same polarisation are averaged together.
pol1, pol2 = average_polarised_scans(*scans)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scans
|
SpectraContainer
|
list of SpectraContainer objects |
()
|
Returns:
| Type | Description |
|---|---|
tuple[SpectraContainerAverage, SpectraContainerAverage | None]
|
pol1, (pol2|None) SpectraContainer objects for opposite polarisations |
Source code in mmg_toolbox/xas/container_functions.py
average_scans(*scans)
¶
Average spectra within a set of scans
av_scan = average_scans(scan1, scan2, scan3)
Equivalent to: av_scan = sum([scan2, scan3], scan1)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scans
|
SpectraContainer
|
list of SpectraContainer objects |
()
|
Returns:
| Type | Description |
|---|---|
SpectraContainerAverage
|
SpectraContainer object containing averaged spectra |
Source code in mmg_toolbox/xas/container_functions.py
find_similar_measurements(*scans, temp_tol=1.0, field_tol=0.1)
¶
Find similar measurements based on energy, temperature and field.
Each measurement is compared to the first one in the list, using energy, temperature and field tolerances.
The polarisation is also checked to be similar (lh, lv or cl, cr).
Scans with different or missing metadata are removed from the list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scans
|
SpectraContainer
|
list of SpectraContainer objects |
()
|
temp_tol
|
float
|
Tolerance for temperature comparison (default: 0.1 K) |
1.0
|
field_tol
|
float
|
Tolerance for field comparison (default: 0.1 T) |
0.1
|
Returns:
| Type | Description |
|---|---|
list[SpectraContainer]
|
List of similar measurements |
Source code in mmg_toolbox/xas/container_functions.py
pair_scans(*scans)
¶
Find the polarisation pair of each spectra from the list of spectra
[(pol1, pol2), (pol3, pol4)] = pair_scans(*scans)
Scans are paired against their opposite polarisation or the opposite magnetic field, whichever comes first.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scans
|
SpectraContainer
|
list of SpectraContainer objects |
()
|
Returns:
| Type | Description |
|---|---|
list[tuple[SpectraContainer, SpectraContainer]]
|
list((pol1, pol2)) SpectraContainer objects for opposite polarisations |
Source code in mmg_toolbox/xas/container_functions.py
polarised_pairs(*scans)
¶
Find the polarisation pair of each spectra from the list of spectra
[(pol1, pol2), (pol3, pol4)] = polarised_pairs(*scans)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scans
|
SpectraContainer
|
list of SpectraContainer objects |
()
|
Returns:
| Type | Description |
|---|---|
list[tuple[SpectraContainer, SpectraContainer]]
|
list((pol1, pol2)) SpectraContainer objects for opposite polarisations |