PyJEM.eds.acquisition

PyJEM.eds.acquisition.check_communication()

Checks HTTP connection.

Returns:

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

key

type

value

Result

str

Returns "OK" when the communication is established.

Version

str

API version string.

Return type:

dict

Examples

>>> from PyJEM import eds
>>> eds.check_communication()
{'Result': 'OK', 'Version': '11'}
PyJEM.eds.acquisition.get_specification()

Retrieve device specifications for the EDS system.

Returns:

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

key

type

value

Version

str

API version string.

ProcessTimeList

dict

Dictionary of available ProcessTime options for each detector. If a detector is not configured, its list will be empty.

⇒ See ProcessTimeList items.

ProcessTimeList items

key

type

value

FirstDetector

list[str]

List of ProcessTime values available for detector 1.

SecondDetector

list[str]

List of ProcessTime values available for detector 2.

ThirdDetector

list[str]

List of ProcessTime values available for detector 3.

FourthDetector

list[str]

List of ProcessTime values available for detector 4.

Return type:

dict

Examples

>>> from PyJEM import eds
>>> eds.get_specification()
{
    "ProcessTimeList": {
        "FirstDetector": [
            "T1",
            "T2",
            "T3",
            "T4",
            "T5"
        ],
        "FourthDetector": [],
        "SecondDetector": [
            "T1",
            "T2",
            "T3",
            "T4",
            "T5"
        ],
        "ThirdDetector": []
    },
    "Version": "2.0.0"
}
PyJEM.eds.acquisition.get_analyzer_settings()

Retrieve analyzer settings for the EDS system.

Returns:

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

key

type

value

Version

str

API version string.

ProcessTime

list[list[str]]

List of ProcessTime settings for each detector. The outer list contains 4 elements, corresponding to detectors 1 through 4. Each inner list contains available ProcessTime values for that detector.

Return type:

dict

Examples

>>> from PyJEM import eds
>>> eds.get_analyzer_settings()
{
    "ProcessTime": [
        "T3",
        "T3",
        "T3",
        "T3"
    ],
    "Version": "2.0.0"
}
PyJEM.eds.acquisition.set_analyzer_settings(param)

Change the EDS Analyzer settings. Pass a ProcessTime array with 4 elements to the Body parameter. Each array element corresponds to a detector and is applied in the order Detector 1, 2, 3, 4.

Parameters:

param (dict) –

Analyzer settings payload.

key

type

value

ProcessTime

list[str]

List of ProcessTime values to apply to detectors 1 through 4. The list must contain exactly 4 elements.

Returns:

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

key

type

value

Version

str

API version string.

ProcessTime

list[str]

List of ProcessTime values applied to detectors 1 through 4. The list contains exactly 4 elements, each corresponding to a detector in order.

Return type:

dict

Warning

If the array contains more than 4 elements, any additional elements are ignored. If it contains fewer than 4 elements, an error occurs.

Example:

Passing ["T2", "T2"] will result in an error response after the settings are applied to detectors 1 and 2.

Notes

The settings apply even when any arbitrary string is entered.

Example:

Passing ["a", "a", "a", "a"] sets "a" as the ProcessTime for detectors 1, 2, 3, and 4.

Examples

>>> from PyJEM import eds
>>> eds.set_analyzer_settings({'ProcessTime' : ['T1','T2','T3','T4']})
{
    "ProcessTime": [
        "T3",
        "T3",
        "T3",
        "T3"
    ],
    "Version": "2.0.0"
}
PyJEM.eds.acquisition.get_analyzer_status()

Retrieve the current status of the EDS Analyzer.

Returns:

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

key

type

value

Version

str

API version string.

DeadTime

list[float]

DeadTime values for each detector and their total. The list contains 5 elements in the following order: [Detector1, Detector2, Detector3, Detector4, Total]. Values are expressed as percentages.

InputCountRate

list[float]

Input count rate values for each detector and their total. Same order and format as DeadTime. Values are expressed as percentages.

OutputCountRate

list[float]

Output count rate values for each detector and their total. Same order and format as DeadTime. Values are expressed as percentages.

Return type:

dict

Examples

>>> from PyJEM import eds
>>> eds.get_analyzer_status()
{
    "DeadTime": [
        10,
        11,
        0,
        0,
        10
    ],
    "InputCountRate": [
        4983,
        5012,
        0,
        0,
        10015
    ],
    "OutputCountRate": [
        3991,
        3999,
        0,
        0,
        7985
    ],
    "Version": "2.0.0"
}
PyJEM.eds.acquisition.get_detector_configuration()

Retrieve configuration settings for EDS detectors.

Returns:

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

key

type

value

Version

str

API version string.

Enabled

list[bool]

List indicating whether each detector is enabled. The list contains 4 elements corresponding to detectors 1 through 4.

Retractable

list[bool]

List indicating whether each detector is retractable. The list contains 4 elements corresponding to detectors 1 through 4.

Return type:

dict

Examples

>>> from PyJEM import eds
>>> eds.get_detector_configuration()
{
    "Enabled": [
        True,
        True,
        False,
        False
    ],
    "Retractable": [
        True,
        True,
        False,
        False
    ],
    "Version": "1.0.0"
}
PyJEM.eds.acquisition.get_detector_status()

Retrieve the current status of EDS detectors.

Returns:

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

key

type

value

Version

str

API version string.

Position

list[str]

List of position states for each detector. The list contains 4 elements in the following order: [Detector1, Detector2, Detector3, Detector4].

Possible values:
  • "-1": Unknown

  • "0": Bake

  • "1": SampleChanged

  • "2": Retract

  • "3": Insert

MovingPosition

list[str]

List of movement states for each detector. The list contains 4 elements in the same order.

Possible values:
  • "-1": Unknown

  • "0": Stopped

  • "1": Moving

DetectorErrorCode

list[str]

List of error codes for each detector. The list contains 4 elements corresponding to detectors 1 through 4.

Return type:

dict

Examples

>>> from PyJEM import eds
>>> eds.get_detector_status()
{
    "DetectorErrorCode": [
        [],
        [],
        [],
        []
    ],
    "MovingPosition": [
        0,
        0,
        -1,
        -1
    ],
    "Position": [
        3,
        3,
        -1,
        -1
    ],
    "Version": "1.0.0"
}
PyJEM.eds.acquisition.set_detector_status(param)

Set the position status for each EDS detector.

Parameters:

param (dict) –

Detector status payload.

key

type

value

Position

list[int]

List of position values to apply to detectors 1 through 4. The list must contain exactly 4 elements. Both numeric strings (e.g., "0", "1") and symbolic strings (e.g., "Insert") are accepted.

Valid values:
  • -1: Unknown

  • 0: Bake

  • 1: SampleChanged

  • 2: Retract

  • 3: Insert

Returns:

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

key

type

value

Version

str

API version string.

Position

list[int]

List of applied position values for detectors 1 through 4, represented as ints.

Return type:

dict

Examples

>>> from PyJEM import eds
>>> eds.set_detector_status({'Position': ['1','1','1','1']})
{
    "Position": [
        3,
        3,
        -1,
        -1
    ],
    "Version": "1.0.0"
}
PyJEM.eds.acquisition.reset_detector()

Reset the error detector.

Returns:

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

key

type

value

Version

str

API version string.

Return type:

dict

Examples

>>> from PyJEM import eds
>>> eds.reset_detector()
{
    "Version": "2.0.0"
}
PyJEM.eds.acquisition.get_acquisition_settings()

Retrieve acquisition settings from the EDS detector.

Returns:

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

key

type

value

Version

str

API version string.

CollectionMode

str

Data acquisition mode. One of "LiveTime" or "RealTime".

  • "LiveTime": Effective measurement time per scan point.

  • "RealTime": Fixed duration per operation point.

EDSOutput

str

Output format of the data. One of "Spectrum" or "DataCube".

  • "Spectrum": Outputs only spectrum data.

  • "DataCube": Outputs both spectrum and cube data.

SpectrumEnergyRange

int

Energy range of the spectrum data. One of 1024, 2048, or 4096.

EnableCubeExport

bool

Whether to enable cube data export. If False, a 2D image integrated along the energy axis is returned.

Return type:

dict

Examples

>>> from PyJEM import eds
>>> eds.get_acquisition_settings()
{
    "CollectionMode": "RealTime",
    "EDSOutput": "DataCube",
    "SpectrumEnergyRange": 2048,
    "Version": "2.0.0"
}
PyJEM.eds.acquisition.set_acquisition_settings(param)

Sets the settings of EDS acquisition.

Parameters:

param (dict) –

Acquisition settings payload.

key

type

value

CollectionMode

str

Data acquisition mode. One of "LiveTime" or "RealTime".

  • "LiveTime": Effective measurement time per scan point.

  • "RealTime": Fixed duration per operation point.

EDSOutput

str

Output format of the data. One of "Spectrum" or "DataCube".

  • "Spectrum": Outputs only spectrum data.

  • "DataCube": Outputs both spectrum and cube data.

SpectrumEnergyRange

int

Energy range of the spectrum data. One of 1024, 2048, or 4096.

EnableCubeExport

bool

Whether to enable cube data export. If False, a 2D image integrated along the energy axis is returned.

Returns:

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

key

type

value

Version

str

API version string.

CollectionMode

str

Data acquisition mode. One of "LiveTime" or "RealTime".

  • "LiveTime": Effective measurement time per scan point.

  • "RealTime": Fixed duration per operation point.

EDSOutput

str

Output format of the data. One of "Spectrum" or "DataCube".

  • "Spectrum": Outputs only spectrum data.

  • "DataCube": Outputs both spectrum and cube data.

SpectrumEnergyRange

int

Energy range of the spectrum data. One of 1024, 2048, or 4096.

EnableCubeExport

bool

Whether to enable cube data export. If False, a 2D image integrated along the energy axis is returned.

Return type:

dict

Examples

>>> from PyJEM import eds
>>> eds.set_acquisition_settings({'ProcessTime': ['T1', 'T2', 'T3', 'T4'],'DwellTime': 1000.0,'CollectionMode': 3,'SweepCount': 0,'EDSOutput': 0,'EDSSelected': False,})
{'ProcessTime': ['T1', 'T2', 'T3', 'T4'],
 'DwellTime': 1000.0,
 'CollectionMode': 3,
 'SweepCount': 0,
 'EDSOutput': 0,
 'EDSSelected': False}
PyJEM.eds.acquisition.get_acquisition_status()

Retrieve the current acquisition status from the EDS system.

Returns:

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

key

type

value

Version

str

API version string.

AcquisitionRunning

bool

Indicates whether data acquisition is currently in progress.

ElapsedLiveTime

float

Elapsed live time in seconds. If acquisition is not running, this reflects the previous acquisition.

ElapsedRealTime

float

Elapsed real time in seconds. If acquisition is not running, this reflects the previous acquisition.

Return type:

dict

Notes

If AcquisitionRunning == False, the returned time fields represent the previous acquisition result.

Examples

>>> from PyJEM import eds
>>> eds.get_acquisition_status()
{
    "AcquisitionRunning": False,
    "ElapsedLiveTime": 0,
    "ElapsedRealTime": 0,
    "Version": "2.0.0"
}
PyJEM.eds.acquisition.get_acquisition_result(id)

Retrieve the acquisition result for the specified EDS acquisition ID.

Parameters:

id (str) – Unique identifier for the acquisition session. Typically obtained from the AcquisitionREST Start API.

Returns:

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

key

type

value

Version

str

API version string.

Results

list[dict]

List of Results items.

Results items

key

type

value

Id

str

Identifier of the result data.

DataType

str

Format of the result data.

Return type:

dict

Examples

>>> from PyJEM import eds
>>> eds.get_acquisition_result("84c84756-639c-4cec-863b-0772e9c52185")
{
    "Results": [
        {
            "DataType": "EDS_Line",
            "Id": "ed8c008a-ee32-4e03-a01e-e586c21f2591"
        },
        {
            "DataType": "EDS_CountLine",
            "Id": "636b94cb-0a8e-45d8-9870-e682324ffd39"
        },
        {
            "DataType": "EDS_CountLine",
            "Id": "88b1dd29-7f65-4558-96fb-79b690e0eeec"
        },
        {
            "DataType": "EDS_CountLine",
            "Id": "f1a709a6-fbee-40bc-906d-b850347dd03c"
        },
        {
            "DataType": "EDS_CountLine",
            "Id": "f4e67088-a9be-4df8-bc7e-dbf28586b37e"
        },
        {
            "DataType": "EDS_Line_WholeSpectrum",
            "Id": "bbbda4db-bd52-4bf0-9e35-c2819c86bad0"
        }
    ],
    "Version": "2.0.0"
}