PyJEM.eels.spectrum

PyJEM.eels.spectrum.set_calibration_result(data_set_id, param)

Set the calibration result for the given target graph data set ID.

Parameters:
  • data_set_id (str) – The ID of the target graph data set.

  • param (dict) –

    Calibration parameters.

    key

    type

    value

    Dispersion

    float

    The dispersion value.

    FirstEnergyLoss

    float

    The first energy loss value.

    SecondEnergyLoss

    float

    The second energy loss value.

Return type:

None

Examples

>>> from PyJEM import eels
>>> dataset_id = "99fa8d22-bd92-4021-a868-edf886bb549b"
>>> body = {
...     "Dispersion": 2,
...     "FirstEnergyLoss": -512,
...     "SecondEnergyLoss": 510
... }
>>> eels.set_calibration_result(dataset_id, body)
PyJEM.eels.spectrum.quantitative_analysis(data_set_id, param)

Perform quantitative analysis for the given target graph data set ID.

Parameters:
  • data_set_id (str) – The ID of the target graph data set.

  • param (dict) –

    Analysis configuration.

    key

    type

    value

    Config

    dict

    Analysis configuration.

    ⇒ See Config items.

    Config items

    key

    type

    value

    CoreLossCrossSection

    int

    Core loss cross section.

    AccelarationVoltage

    float

    Acceleration voltage.

    CorrectionAngle

    float

    Correction angle.

    IsUseZlp

    bool

    Whether to use zero-loss peak.

    Spectrum

    dict

    Spectrum reference.

    ⇒ See Spectrum items.

    Spectrum items

    key

    type

    value

    Mode

    str

    One of "SameSpectrum" or "AnotherSpectrum".

    Spectrum

    str

    Spectrum ID.

Returns:

The returned value is a dictionary. A description of each item is provided below.

key

type

value

Results

list[dict]

List of Results items.

Results items

key

type

value

ElementShellName

str

Combined element and shell name.

Example:

"H-K", "B-K"

Sigma

float

Cross-section value used in quantification.

TotalSignalIntensity

float

Integrated signal intensity for the element.

TotalZeroLossPeakIntensity

float

Intensity of the zero-loss peak used for normalization or background correction.

Return type:

dict

Examples

>>> param = {
...     "Config": {
...         "AccelarationVoltage": 1,
...         "CoreLossCrossSection": 0,
...         "CorrectionAngle": 1,
...         "IsUseZlp": False,
...         "Spectrum": {
...             "Mode": "SameSpectrum",
...             "Spectrum": "15b7caa0-88ed-4062-b52a-1de2699f8363"
...         }
...     }
... }
>>> eels.quantitative_analysis("99fa8d22-bd92-4021-a868-edf886bb549b", param)
{
    "Results": [
        {
            "ElementShellName": "H-K",
            "Sigma": 20922.33820901753,
            "TotalSignalIntensity": 3015473.958217323,
            "TotalZeroLossPeakIntensity": 0
        },
        {
            "ElementShellName": "B-K",
            "Sigma": 12.064301522783381,
            "TotalSignalIntensity": 3047254.5492922068,
            "TotalZeroLossPeakIntensity": 0
        }
    ]
}
PyJEM.eels.spectrum.calculate_thickness(data_set_id)

Calculate thickness for the given target graph data set ID.

Parameters:

data_set_id (str) – The ID of the target graph data set.

Returns:

The returned value is a dictionary. A description of each item is provided below.

key

type

value

RelativeThickness

float

Calculated relative thickness.

ZeroLossPeakIndex

int

Index of the zero-loss peak.

ZeroLossPeakIntensity

int

Intensity of the zero-loss peak.

Return type:

dict

Examples

>>> eels.calculate_thickness("99fa8d22-bd92-4021-a868-edf886bb549b")
{
    "RelativeThickness": 0.14930775789003622,
    "ZeroLossPeakIndex": 220,
    "ZeroLossPeakIntensity": 16829504
}