PyJEM.eds.function module

PyJEM.eds.function.check_communication()dict

Checks HTTP connection.

Returns

Result:

Returns OK when the communication established.

Version:

A version number of this specification.

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.check_communication()
{'Result': 'OK', 'Version': '11'}
PyJEM.eds.function.create_count_map(param)dict

Creates gross count mapping data.

Parameters

param (dict) –

  • TargetDataID (string):

    An ID start_acquisition() returns as DataID.

  • Elements (ElementsKey):

    A dictionary of elements that contains elemental numbers and shell names.

    • List of Line:

      None, K, L, M, N, O, or Default.

      Default is an automatically selected line.

  • TargetDetector (integer):

    0: Total, 1: FirstDetector, 2: SecondDetector, 3: ThirdDetector, 4: ForthDetector

Returns

  • Message (string):

    A free text from EDS system.

  • DataIDs (string):

    An array of IDs detected. E.g., [‘aaaa-aaaa-aaaa-aaaa’, ‘bbbb-bbbb-bbbb-bbbb’, ‘cccc-cccc-cccc-cccc’]

  • Result (string):
    • OK:

      Success

    • Fail:

      Failure

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.create_count_map({
    'TargetDataID' : 'xxxx-xxxx-xxxx-xxxx',
    'Elements' : [
        {'ElementalNumber' : 8, 'Line' : 'K'},
        {'ElementalNumber' : 14, 'Line' : 'L'},
        {'ElementalNumber' : 21, 'Line' : 'L'},],
    'TargetDetector' : 1
    })
PyJEM.eds.function.create_net_count_map(param)dict

Sets the settings of net count mapping.

Parameters

param (dict) –

  • TargetDataID (string):

    An ID start_acquisition() returns as DataID.

  • Elements (ElementsKey):

    A dictionary of elements that contains elemental numbers and shell names.

    • List of Line:

      None, K, L, M, N, O, or Default.

      Default is an automatically selected line.

  • TargetDetector (integer):

    0: Total, 1: FirstDetector, 2: SecondDetector, 3: ThirdDetector, 4: ForthDetector

Returns

  • Message (string):

    A free text from EDS system.

  • DataIDs (string):

    An array of IDs detected. E.g., [‘aaaa-aaaa-aaaa-aaaa’, ‘bbbb-bbbb-bbbb-bbbb’, ‘cccc-cccc-cccc-cccc’]

  • Result (string):
    • OK:

      Success

    • Fail:

      Failure

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.create_net_count_map({
    'TargetDataID' : 'xxxx-xxxx-xxxx-xxxx',
    'Elements' : [
        {'ElementalNumber' : 8, 'Line' : 'K'},
        {'ElementalNumber' : 14, 'Line' : 'L'},
        {'ElementalNumber' : 21, 'Line' : 'L'},],
    'TargetDetector' : 1
    })
PyJEM.eds.function.create_quantitative_map(param)dict

Creates quantitative mapping data.

Parameters

param (dict) –

  • TargetDataID (string):

    An ID start_acquisition() returns as DataID.

  • Elements (ElementsKey):

    A dictionary of elements that contains elemental numbers and shell names.

    • List of Line:

      None, K, L, M, N, O, or Default.

      Default is an automatically selected line.

  • TargetDetector (integer):

    0: Total, 1: FirstDetector, 2: SecondDetector, 3: ThirdDetector, 4: ForthDetector

Returns

  • Message (string):

    A free text from EDS system.

  • DataIDs (string):

    An array of IDs detected. E.g., [‘aaaa-aaaa-aaaa-aaaa’, ‘bbbb-bbbb-bbbb-bbbb’, ‘cccc-cccc-cccc-cccc’]

  • Result (string):
    • OK:

      Success

    • Fail:

      Failure

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.create_quantitative_map({
    'TargetDataID' : 'xxxx-xxxx-xxxx-xxxx',
    'Elements' : [
        {'ElementalNumber' : 8, 'Line' : 'K'},
        {'ElementalNumber' : 14, 'Line' : 'L'},
        {'ElementalNumber' : 21, 'Line' : 'L'},],
    'TargetDetector' : 1
    })
{'DataIDs': ['aaaa-aaaa-aaaa-aaaa',
             'bbbb-bbbb-bbbb-bbbb',
             'cccc-cccc-cccc-cccc'],
 'Result': 'OK'}
PyJEM.eds.function.execute_autoqualitative_analysis(param)dict

Executes auto qualitative analysis.

Parameters

param (dict) –

  • TargetDataID (string):

    An ID start_acquisition() returns as DataID.

  • TargetDetector (integer):

    0: Total, 1: FirstDetector, 2: SecondDetector, 3: ThirdDetector, 4: ForthDetector

Returns

  • Message (string):

    A free text from EDS system.

  • Elements (dict):

    Searched elements containing elemental numbers and shell names.

    • List of Line:

      None, K, L, M, N, O, or Default.

      Default is an automatically selected line.

  • Result (string):
    • OK:

      Success

    • Fail:

      Failure

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.execute_autoqualitative_analysis({'TargetDataID': 'xxxx-xxxx-xxxx-xxxx','TargetDetector': 0,})
{'Message' : 'A free text from EDS system.',
 'Elements' :['aaaa-aaaa-aaaa-aaaa', 'bbbb-bbbb-bbbb-bbbb','cccc-cccc-cccc-cccc'],
 'Result': 'OK'}
PyJEM.eds.function.execute_count_line_analysis(param)dict

Executes gross count data of line analysis.

Parameters

param (dict) –

  • TargetDataID (string):

    An ID start_acquisition() returns as DataID.

  • Elements (ElementsKey):

    A dictionary of elements that contains elemental numbers and shell names.

    • List of Line:

      None, K, L, M, N, O, or Default.

      Default is an automatically selected line.

  • TargetDetector (integer):

    0: Total, 1: FirstDetector, 2: SecondDetector, 3: ThirdDetector, 4: ForthDetector

Returns

  • Message (string):

    A free text from EDS system.

  • DataIDs (string):

    An ID start_acquisition() returns as DataID. E.g., [‘aaaa-aaaa-aaaa-aaaa’, ‘bbbb-bbbb-bbbb-bbbb’, ‘cccc-cccc-cccc-cccc’]

  • Result (string):
    • OK:

      Success

    • Fail:

      Failure

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.execute_count_line_analysis({
    'TargetDataID' : 'xxxx-xxxx-xxxx-xxxx',
    'Elements' : [
        {'ElementalNumber' : 8, 'Line' : 'K'},
        {'ElementalNumber' : 14, 'Line' : 'L'},
        {'ElementalNumber' : 21, 'Line' : 'L'},],
    'TargetDetector' : 1
    })
PyJEM.eds.function.execute_net_count_line_analysis(param)dict

Executes net count data of line analysis.

Parameters

param (dict) –

  • TargetDataID (string):

    An ID start_acquisition() returns as DataID.

  • Elements (ElementsKey):

    A dictionary of elements that contains elemental numbers and shell names.

    • List of Line:

      None, K, L, M, N, O, or Default.

      Default is an automatically selected line.

  • TargetDetector (integer):

    0: Total, 1: FirstDetector, 2: SecondDetector, 3: ThirdDetector, 4: ForthDetector

Returns

  • Message (string):

    A free text from EDS system.

  • DataIDs (string):

    An ID start_acquisition() returns as DataID. E.g., [‘aaaa-aaaa-aaaa-aaaa’, ‘bbbb-bbbb-bbbb-bbbb’, ‘cccc-cccc-cccc-cccc’]

  • Result (string):
    • OK:

      Success

    • Fail:

      Failure

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.execute_net_count_line_analysis({
    'TargetDataID' : 'xxxx-xxxx-xxxx-xxxx',
    'Elements' : [
        {'ElementalNumber' : 8, 'Line' : 'K'},
        {'ElementalNumber' : 14, 'Line' : 'L'},
        {'ElementalNumber' : 21, 'Line' : 'L'},],
    'TargetDetector' : 1
    })
PyJEM.eds.function.execute_quantitative_line_analysis(param)dict

Executes quantitative data of line analysis.

Parameters

param (dict) –

  • TargetDataID (string):

    An ID start_acquisition() returns as DataID.

  • Elements (ElementsKey):

    A dictionary of elements that contains elemental numbers and shell names.

    • List of Line:

      None, K, L, M, N, O, or Default.

      Default is an automatically selected line.

  • TargetDetector (integer):

    0: Total, 1: FirstDetector, 2: SecondDetector, 3: ThirdDetector, 4: ForthDetector

Returns

  • Message (string):

    A free text from EDS system.

  • DataIDs (string):

    An array of IDs detected. E.g., [‘aaaa-aaaa-aaaa-aaaa’, ‘bbbb-bbbb-bbbb-bbbb’, ‘cccc-cccc-cccc-cccc’]

  • Result (string):
    • OK:

      Success

    • Fail:

      Failure

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.execute_quantitative_line_analysis({
    'TargetDataID' : 'xxxx-xxxx-xxxx-xxxx',
    'Elements' : [
        {'ElementalNumber' : 8, 'Line' : 'K'},
        {'ElementalNumber' : 14, 'Line' : 'L'},
        {'ElementalNumber' : 21, 'Line' : 'L'},],
    'TargetDetector' : 1
    })
PyJEM.eds.function.execute_quantitative_spectrum_analysis(param)dict

Executes quantitative spectrum analysis.

Parameters

param (dict) –

  • TargetDataID (string):

    An ID start_acquisition() returns as DataID.

  • Elements (ElementsKey):

    A dictionary of elements that contains elemental numbers and shell names.

    • List of Line:

      None, K, L, M, N, O, or Default.

      Default is an automatically selected line.

  • TargetDetector (integer):

    0: Total, 1: FirstDetector, 2: SecondDetector, 3: ThirdDetector, 4: ForthDetector

Returns

  • Message (string):

    A free text from EDS system.

  • Quantities (string):

    An array of elemental quantity.

    • Unit:

      Mass%

  • Result (string):
    • OK :

      Success

    • Fail :

      Failure

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.execute_quantitative_spectrum_analysis({
    'TargetDataID' : 'xxxx-xxxx-xxxx-xxxx',
    'Elements' : [
        {'ElementalNumber' : 8, 'Line' : 'K'},
        {'ElementalNumber' : 14, 'Line' : 'L'},
        {'ElementalNumber' : 21, 'Line' : 'L'},],
    'TargetDetector' : 1
    })
PyJEM.eds.function.extract_area_spectrum(param)dict

Extracts ID of spectrum data of area analysis.

Parameters

param (dict) –

  • TargetDataID (string):

    An ID start_acquisition() returns as DataID.

Returns

  • Message (string):

    A free text from EDS system.

  • SpectrumDataID (string):

    An ID of spectrum data.

  • Result (string):
    • OK:

      Success

    • Fail:

      Failure

Return type

dict

PyJEM.eds.function.extract_line_spectrum(param)dict

Extracts ID of spectrum data of line analysis.

Parameters

param (dict) –

  • TargetDataID (string):

    An ID start_acquisition() returns as DataID.

Returns

  • Message (string):

    A free text from EDS system.

  • SpectrumDataID (string):

    An ID of line spectrum.

  • Result (string):
    • OK:

      Success

    • Fail:

      Failure

Return type

dict

PyJEM.eds.function.get_acquisition_settings()dict

Gets the settings of EDS acquisition.

Returns

  • Version:

    A version number of this function.

  • ProcessTime:

    A list of process time for each detector.

    • Length of array:

      4 (Maximum number of detectors)

    • Order:

      [First, Second, Third, Fourth]

  • DwellTime:
    • Time for staying on the sample.

    • Actual time depends on CollectionMode.

    • Unit:

      μsec

  • CollectionMode:

    0: Endless, 1: LiveTime, 2: RealTime, 3: Sweep

    • Endless:

      Ignores DwellTime.

    • Real time:

      Stays in a certain time at each scanning point.

    • Live time:

      Effective measurement time at each scanning point.

    • Sweep:

      Number of times collecting data over an analytical area.

  • SweepCount:
    • Number of sweeps for integrating acquired data.

    • Available in Full, Area and Line analysis.

  • EDSOutput:

    0: DataCube, 1: Spectrum, 2: Playback

  • EDSSelected:
    • True:

      Selects the EDS button.

    • False:

      Deselects the EDS button.

Return type

dict

Example

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

Gets the status of an EDS acquisition.

Returns

  • Version (string):

    A version number of this function.

  • AcquisitionRunning (bool):

    True : Running, False : Stopped

  • ElapsedLiveTime (integer[]):
    • Length of array:

      4 (Maximum number of detectors) + 1 (Total count rate).

    • Order:

      [First, Second, Third, Fourth, Total]

    • Unit:

      sec

  • ElapsedRealTime (integer[]):
    • Length of array:

      4 (Maximum number of detectors) + 1 (Total count rate).

    • Order:

      [First, Second, Third, Fourth, Total]

    • Unit:

      sec

  • SweepCount (integer):

    A current number of sweeps during an analysis.

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.get_acquisition_status()
{'AcquisitionRunning': False,
 'ElapsedLiveTime': 0,
 'ElapsedRealTime': 0,
 'SweepCount': 1,
 'Version': '1.0'}
PyJEM.eds.function.get_analysis_settings()dict

Gets the settings for analyzing.

Returns

  • Version (string):

    A version number of this function.

  • LengthOfSpectrum (integer):

    • Unit:

      10 eV/ch

  • UserCategories (string[]):

    A list of standard data that user created

  • DisableElements (object[]):

    A list of disable elements.

  • QualitativeSensitivity (string):

    Sensitivity of qualitative analysis. It returns Low, Middle or High.

  • ZAFEnable (bool):

    True: Enable, False: Disable

  • PRZEnable (bool):

    True: Enable, False: Disable

  • Cliff-LorimerEnable (bool):

    True: Enable, False: Disable

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.get_analysis_settings()
{'UserCategories': [],
 'DisableElements': {'ElementalNumber': [1,2,3,]},
 'QualitativeSensitivity': 'Middle',
 'ZAFEnable': True,
 'PRZEnable': True,
 'Cliff-Lorimer': True,
 'LengthOfSpectrum': 4096,
 'Version': '1.0'}
PyJEM.eds.function.get_analysis_status()dict

Gets the status of execution.

Returns

  • Version (string):

    A version number of this function.

  • ExecutingAnalysis (bool):

    True: Executing, False: Stopped

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.get_analysis_status()
{'Version': '1.0', 'ExecutingAnalysis': False}
PyJEM.eds.function.get_analyzer_settings()dict

Gets the settings of EDS analyzers.

Returns

  • Version:

    A version number of this function.

  • ProcessTime:

    A list of process time for each detector.

  • Length of array:

    4 (Maximum number of detectors)

  • Order:

    [First, Second, Third, Fourth]

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.get_analyzer_settings()
{'ProcessTime': ['T1', 'T2', 'T3', 'T4'], 'Version': '1.0'}
PyJEM.eds.function.get_analyzer_status()dict

Gets the status of EDS analyzers.

Returns

  • InputCountRate:
    • Length of array:

      4 (Maximum number of detectors) + 1 (Total count rate).

    • Order:

      [First, Second, Third, Fourth, Total]

    • Unit:

      %

    • OutputCountRate:
      • Length of array:

        4 (Maximum number of detectors) + 1 (Total count rate).

      • Order:

        [First, Second, Third, Fourth, Total]

      • Unit:

        %

  • DeadTime:
    • Length of array:

      4 (Maximum number of detectors) + 1 (Total count rate).

    • Order:

      [First, Second, Third, Fourth, Total]

    • Unit:

      %

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.get_analyzer_status()
{'InputCountRate': [4986, 4977, 0, 0, 9963],
 'OutputCountRate': [3982, 3983, 0, 0, 7965],
 'DeadTime': [9.0, 9.0, 0.0, 0.0, 18.0]}
PyJEM.eds.function.get_config()dict

Returns settings of this package.

Example

>>> from PyJEM import eds
>>> eds.get_config()
{'name': 'femtus_eds', 'ip': 'localhost', 'port': 49306}
PyJEM.eds.function.get_detector_configuration()dict

Gets the configurations of EDS detectors.

Returns

  • Version:

    A version number of this function.

  • Enabled:

    True: Enabled, False: Disabled

    • Length of array:

      4 (Maximum number of detectors) + 1 (Total count rate).

    • Order:

      [First, Second, Third, Fourth, Total]

  • Retractable:

    True: Retractable, False: Not Retractable

    • Length of array:

      4 (Maximum number of detectors) + 1 (Total count rate).

    • Order:

      [First, Second, Third, Fourth, Total]

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.get_detector_configuration()
{'Enabled': [True, True, False, False],
 'Retractable': [True, True, False, False],
 'Version': '1.0'}
PyJEM.eds.function.get_detector_status()dict

Get the status of EDS detectors.

Returns

  • Version:

    A version number of this function.

  • Position:

    -1: Unknown, 0: Bake, 1: SampleChange, 2: Retract, 3: Insert

    • Length of array:

      4 (Maximum number of detectors) + 1 (Total count rate).

    • Order:

      [First, Second, Third, Fourth, Total]

  • MovingPosition:

    0: Stopped, 1: Moving

    • Length of array:

      4 (Maximum number of detectors) + 1 (Total count rate).

    • Order:

      [First, Second, Third, Fourth, Total]

  • DetectorErrorCode:

    Returns error codes when something went wrong.

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.get_detector_status()
{'Version': '1.0',
 'DetectorErrorCode': ['E.11'],
 'Position': [1, 1, None, None],
 'MovingPosition': [1, 1, None, None]}
PyJEM.eds.function.get_map_data(param)bin

Gets map data of specified elements.

Parameters

param (dict) –

  • TargetDataID (string):

    An ID start_acquisition() returns as DataID and AreaImageID; or create_count_map(), create_net_count_map(), and create_quantitative_map() return as DataIDs.

Returns

Returns map data in binary format.

  • Intensity:

    4 bytes floating point.

  • Length of array:

    Depends on a map size.

  • First of array:

    Top-left pixel.

  • Byte order:

    Little endian.

Return type

bin

Example

Drawing Map Data as a Heat Map

>>> from PyJEM import eds
>>> from sys import byteorder
>>> import numpy as np
>>> import seaborn as sns
>>> import struct
>>> eds.start_acquisition()
{'DataID': 'aaaa-aaaa-aaaa-aaaa','WorksheetID': 'bbbb-bbbb-bbbb-bbbb','AreaImageID': 'cccc-cccc-cccc-cccc'}
>>> eds.create_quantitative_map({'TargetDataID' : 'aaaa-aaaa-aaaa-aaaa',
                                 'Elements' : [
                                     {'ElementalNumber' : 8, 'Line' : 'K'},
                                     {'ElementalNumber' : 14, 'Line' : 'L'},
                                     {'ElementalNumber' : 13, 'Line' : 'L'},],
                                 'TargetDetector' : 1})
{'DataIDs': ['AAAA-AAAA-AAAA-AAAA','BBBB-BBBB-BBBB-BBBB','CCCC-CCCC-CCCC-CCCC'],
 'Result': 'OK'}
>>> # Get binary data using *DataIDs*.
>>> binary_spectrum_data = eds.get_map_data({'TargetDataID' : 'AAAA-AAAA-AAAA-AAAA'})
>>> # Divide binary data into 4 bytes segments.
>>> binary_intensity_list = [binary_spectrum_data[i:i+4] for i in range(0, len(binary_spectrum_data), 4)]
>>> # Convert 4 bytes to float in little-endian.
>>> floatnum = []
>>> for intensity in binary_intensity_list:
        floatnum.append(struct.unpack('<f', intensity)[0])
>>> pixels_y = eds.get_map_image_size({'TargetDataID':'AAAA-AAAA-AAAA-AAAA'})['Height']
>>> data = list(np.array_split(floatnum, pixels_y))
>>> # Draw a graph of the map data.
>>> sns.heatmap(data, square=True, cmap='gray')
PyJEM.eds.function.get_map_image_size(param)dict

Gets width and height of an acquired map image.

Parameters

param (dict) –

  • TargetDataID (string):

    An ID that create_count_map(), create_net_count_map(), and create_quantitative_map() return as DataIDs.

Returns

  • Version:

    A version number of this function.

  • Width:

    A width of an acquired map image.

  • Height:

    A height of an acquired map image.

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.get_map_image_size({'TargetDataID': 'xxxx-xxxx-xxxx-xxxx'})
{'Version': '1.0', 'Width': 120, 'Height': 100,}
PyJEM.eds.function.get_multiple_line_data(param)bin

Gets spectral data of the specified lines.

Parameters

param (dict) –

  • TargetDataID (string):

    An ID start_acquisition() returns as DataID.

  • StartLine (integer):

    A number of start line for getting spectrum imaging data.

  • EndLine (integer):

    A number of end line for getting spectrum imaging data.

Returns

Returns spectral data in binary format containing multiple lines.

Return type

bin

PyJEM.eds.function.get_multiple_spectrum_data(param)bin

Gets spectrum data of line analysis of the specified position.

Parameters

param (dict) –

  • TargetDataID (string):

    An ID start_acquisition() returns as DataID.

  • StartPosition (integer):

    An index of the first pixel for getting spectrum data.

  • EndPosition (integer):

    An index of the end pixel for getting spectrum data.

Returns

Returns spectral data in binary format containing spectrum for each pixel.

Return type

bin

PyJEM.eds.function.get_net_count_line_analysis_settings()dict

Gets the settings of net count line analysis.

Returns

  • Version (string):

    A version number of this function.

  • ProcessingMethod (integer):

    0: None, 1: Speed, 2: Precise

    Speed and Precise are supported.

  • StandardDataType (integer):

    0: None, 1: DEFSPC, 2: NORM, 3: COMMON, 4: USER, 5: External

    NORM, COMMON and USER are supported.

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.get_net_count_line_analysis_settings()
{'Version': '1.0',
 'ProcessingMethod': 0,
 'StandardDataType': 0}
PyJEM.eds.function.get_net_count_map_analysis_settings()dict

Gets the settings of net count mapping.

Returns

  • Version:

    A version number of this function.

  • PixelWidth (integer):

    Width in pixels. Select a size from the list [64, 128, 256, 512, 1024, 2048, 4096]. Make sure that the size is less than the original size.

  • PixelHeight (integer):

    Height in pixels. Select a size from the list [64, 128, 256, 512, 1024, 2048, 4096]. Make sure that the size is less than the original size.

  • ProcessingMethod (integer):

    0: None, 1: Speed, 2: Precise

    Speed and Precise are supported.

  • StandardDataType (integer):

    0 : None, 1 : DEFSPC, 2 : NORM, 3 : COMMON, 4 : USER, 5 : External

    NORM, COMMON and USER are supported.

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.get_net_count_map_analysis_settings()
{
    'PixelWidth' : 128,
    'PixelHeight' : 128,
    'ProcessingMethod' : 0,
    'StandardDataType' : 0,
}
PyJEM.eds.function.get_quantitative_line_analysis_settings()dict

Gets the settings of quantitative line analysis.

Returns

  • Version:

    A version number of this function.

  • ProcessingMethod (integer):

    0: None, 1: Speed, 2: Precise

    Speed and Precise are supported.

  • StandardDataType (integer):

    0 : None, 1 : DEFSPC, 2 : NORM, 3 : COMMON, 4 : USER, 5 : External

    NORM, COMMON and USER are supported.

  • UserCategoryName (string):

    A category name of the standard data. It is available when StandardDataType is USER.

  • CorrectionType (integer):

    0: None, 1: ZAF, 2: PRZ, 3: Cliff-Lorimer, 4: ZETA

    ZAF, PRZ and Cliff-Lorimer are supported.

  • ConversionType (integer):

    0: None, 1: Metal, 2: Oxide, 3: Compound

    Metal and Oxide are available.

  • OxideCation (integer):

    A cation number of the oxide. It is available in oxide mode of the conversion type.

  • EnableSumPeakRemoval (bool):

    True: Enable, False: Disable

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.get_quantitative_line_analysis_settings()
{'ProcessingMethod' : 0,
 'StandardDataType' : 0,
 'UserCategoryName' : '',
 'CorrectionType' : 3,
 'ConversionType' : 1,
 'OxideCation':1,
 'EnableSumPeakRemoval' : True}
PyJEM.eds.function.get_quantitative_map_analysis_settings()dict

Gets the settings of quantitative mapping.

Returns

  • Version:

    A version number of this function.

  • PixelWidth (integer):

    Width in pixels. Select a size from the list [64, 128, 256, 512, 1024, 2048, 4096]. Make sure that the size is less than the original size.

  • PixelHeight (integer):

    Height in pixels. Select a size from the list [64, 128, 256, 512, 1024, 2048, 4096]. Make sure that the size is less than the original size.

  • ProcessingMethod (integer):

    0: None, 1: Speed, 2: Precise

    Speed and Precise are supported.

  • StandardDataType (integer):

    0 : None, 1 : DEFSPC, 2 : NORM, 3 : COMMON, 4 : USER, 5 : External

    NORM, COMMON and USER are supported.

  • UserCategoryName (string):

    A category name of the standard data. It is available when StandardDataType is USER.

  • CorrectionType (integer):

    0: None, 1: ZAF, 2: PRZ, 3: Cliff-Lorimer, 4: ZETA

    ZAF, PRZ and Cliff-Lorimer are supported.

  • ConversionType (integer):

    0: None, 1: Metal, 2: Oxide, 3: Compound

    Metal and Oxide are available.

  • OxideCation (integer):

    A cation number of the oxide. It is available in oxide mode of the conversion type.

  • EnableSumPeakRemoval (bool):

    True: Enable, False: Disable

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.get_quantitative_map_analysis_settings()
{
    'PixelWidth' : 128,
    'PixelHeight' : 128,
    'ProcessingMethod' : 0,
    'StandardDataType' : 0,
    'UserCategoryName' : '',
    'CorrectionType' : 3,
    'ConversionType' : 1,
    'EnableSumPeakRemoval' : True,
}
PyJEM.eds.function.get_quantitative_spectrum_analysis_settings()dict

Gets the settings of quantitative spectrum analysis.

Returns

  • Version (string):

    A version number of this function.

  • StandardDataType (integer):

    0: None, 1: DEFSPC, 2: NORM, 3: COMMON, 4: USER, 5: External

    NORM, COMMON and USER are supported.

  • UserCategoryName (string):

    A category name of the standard data. It is available when StandardDataType is USER.

  • CorrectionType (integer):

    0 : None, 1 : ZAF, 2 : PRZ, 3 : Cliff-Lorimer, 4 : ZETA

    ZAF, PRZ and Cliff-Lorimer are supported.

  • EnableAbsorptionCorrection (bool):

    True: Enable, False: Disable

    Available in Cliff-Lorimer mode.

  • Thickness (integer):

    Available in the CorrectionType Cliff-Lorimer and EnableAbsorptionCorrection true.

    • Unit:

      nm

  • Density (integer):

    Available in the CorrectionType Cliff-Lorimer and EnableAbsorptionCorrection true.

    • Unit:

      g/cm3

  • EnableFluorescenceCorrection (bool):

    True: Enable, False: Disable

    Available in Cliff-Lorimer mode.

  • ConversionType (integer):

    0 : None, 1 : Metal, 2 : Oxide, 3 : Compound

    Metal and Oxide are available.

  • OxideCation (integer):

    A cation number of the oxide. It is available in oxide mode of the conversion type.

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.get_quantitative_spectrum_analysis_settings()()
{'Version': '1.0',
 'StandardDataType': 2,
 'CorrectionType': 3,
 'EnableAbsorptionCorrection': False,
 'Thickness': 100.0,
 'Density': 2.33,
 'EnableFluorescenceCorrection': False,
 'ConversionType': 1,
 'OxideCation': 24}
PyJEM.eds.function.get_specification()dict

Gets the specifications of process time.

Returns

  • Version:

    A version number of this specification.

  • ProcessTimeList:

    Lists of selectable process time for each detector. Its time is an index of the EDS analysis whether focusing on energy resolution or throughput time.

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.get_specification()
{'ProcessTimeList': {'FirstDetector': ['T1', 'T2', 'T3', 'T4', 'T5'],
  'SecondDetector': ['T1', 'T2', 'T3', 'T4', 'T5'],
  'ThirdDetector': [],
  'FourthDetector': []},
 'Version': '11'}
PyJEM.eds.function.get_spectrum_data(param)bin

Gets spectrum data.

Parameters

param (dict) –

  • TargetDataID (string):

    An ID start_acquisition() returns as DataID.

Returns

Returns spectrum data in binary format.

  • Intensity:

    4 bytes integer.

  • Energy length:

    4096 pixels.

  • Lowest energy:

    Beginning of data.

  • Number of spectra:

    Depends on the specified position of the line data.

  • Byte order:

    Little endian.

Return type

bin

Example

Drawing Spectrum Data as a Plotting Graph

>>> from PyJEM import eds
>>> import matplotlib.pyplot as plt
>>> # Get a *DataID*.
>>> data_id = eds.start_acquisition()['DataID']
>>> # Get binary data using *DataID*.
>>> binary_spectrum_data = eds.get_spectrum_data({'TargetDataID': data_id})
>>> # Divide binary data into 4 byte segments.
>>> binary_intensity_list = [binary_spectrum_data[i:i+4] for i in range(0, len(binary_spectrum_data), 4)]
>>> # Convert 4 bytes to integer in little-endian.
>>> intnum = []
>>> for intensity in binary_intensity_list:
        intnum.append(int.from_bytes(intensity, byteorder='little'))
>>> # Draw a graph of the spectrum data.
>>> plt.plot(intnum)
PyJEM.eds.function.reset_detector()dict

Resets detectors.

Returns

  • Result:
    • OK:

      Success.

    • Failed:

      Something went wrong.

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.reset_detector()
{'Result': 'OK'}
PyJEM.eds.function.set_acquisition_settings(param)dict

Sets the settings of EDS acquisition.

Parameters

param (dict) –

  • ProcessTime (string[]):

    A list of process time for each detector. Select a time from ProcessTimeList. For details, see get_specification().

    • Length of array:

      4 (Maximum number of detectors)

    • Order:

      [First, Second, Third, Fourth]

  • DwellTime (integer):
    • Time for staying on the sample.

    • Actual time depends on CollectionMode.

    • Unit:

      μsec

  • CollectionMode (integer):

    0: Endless, 1: LiveTime, 2: RealTime, 3: Sweep

    • Endless:

      Ignores dwell time.

    • Real time:

      Stays in a certain time at each scanning point.

    • Live time:

      Effective measurement time at each scanning point.

    • Sweep:

      Number of times collecting data over an analytical area.

  • SweepCount (integer):
    • Number of sweeps for integrating acquired data.

    • Available in Full, Area and Line analysis.

  • EDSOutput (integer):

    0: DataCube, 1: Spectrum, 2: Playback

    • Playback:

      Not supported acquiring data through EDS REST Service.

  • EDSSelected (bool):
    • True:

      Selects the EDS button.

    • False:

      Deselects the EDS button.

Returns

Corresponds to get_acquisition_settings().

Return type

dict

Example

>>> 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.function.set_analyzer_settings(param)dict

Sets the settings of EDS analyzers.

Parameters

param (dict) –

  • ProcessTime (string[]):

    A list of process time for each detector. Select a time from ProcessTimeList. For details, see get_specification().

  • Length of array:

    4 (Maximum number of detectors)

  • Order:

    [First, Second, Third, Fourth]

Returns

Corresponds to get_analyzer_settings().

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.set_analyzer_settings({'ProcessTime' : ['T1','T2','T3','T4']})
{'ProcessTime': ['T1', 'T2', 'T3', 'T4']}
PyJEM.eds.function.set_detector_status(param)dict

Sets the status of EDS detectors.

Parameters

param (dict) –

  • Position (integer[]):

    -1: Unknown, 0: Bake, 1: SampleChange, 2: Retract, 3: Insert

  • Length of array:

    4 (Maximum number of detectors)

  • Order:

    [First, Second, Third, Fourth]

Returns

  • Position:

    -1: Unknown, 0: Bake, 1: SampleChange, 2: Retract, 3: Insert

    • Length of array:

      4 (Maximum number of detectors)

    • Order:

      [First, Second, Third, Fourth]

  • Result:
    OK:

    Success.

    Failed:

    Something went wrong.

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.set_detector_status({'Position': ['1','1','1','1']})
{'Position': [1, 1], 'Result': 'OK'}
PyJEM.eds.function.set_ip(val)None

Changes the IP address.

Parameters

val (integer) –

  • val:

    An IP address.

PyJEM.eds.function.set_net_count_line_analysis_settings(param)dict

Sets the settings of net count line analysis.

Parameters

param (dict) –

  • ProcessingMethod (integer):

    0: None, 1: Speed, 2: Precise

    Speed and Precise are supported.

  • StandardDataType (integer):

    0: None, 1: DEFSPC, 2: NORM, 3: COMMON, 4: USER, 5: External

    NORM, COMMON and USER are supported.

Returns

Corresponds to get_net_count_line_analysis_settings().

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.set_net_count_line_analysis_settings({'ProcessingMethod': 0, 'StandardDataType': 0,})
{'ProcessingMethod': 0,
 'StandardDataType': 0}
PyJEM.eds.function.set_net_count_map_analysis_settings(param)dict

Sets the settings of net count mapping.

Parameters

param (dict) –

  • PixelWidth (integer):

    Width in pixels. Select a size from the list [64, 128, 256, 512, 1024, 2048, 4096]. Make sure that the size is less than the original size.

  • PixelHeight (integer):

    Height in pixels. Select a size from the list [64, 128, 256, 512, 1024, 2048, 4096]. Make sure that the size is less than the original size.

  • ProcessingMethod (integer):

    0: None, 1: Speed, 2: Precise

    Speed and Precise are supported.

  • StandardDataType (integer):

    0 : None, 1 : DEFSPC, 2 : NORM, 3 : COMMON, 4 : USER, 5 : External

Returns

Corresponds to get_net_count_map_analysis_settings().

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.set_net_count_map_analysis_settings({
    'PixelWidth' : 128,
    'PixelHeight' : 128,
    'ProcessingMethod' : 2,
    'StandardDataType' : 3,})
PyJEM.eds.function.set_port(val: int)None

Sets a port number of this package.

Parameters

val (integer) –

  • val:

    A port number.

Warning

Not granted to users.

PyJEM.eds.function.set_quantitative_line_analysis_settings(param)dict

Sets the settings of quantitative line analysis.

Parameters

param (dict) –

  • ProcessingMethod (integer):

    0 : None, 1 : Speed, 2 : Precise

    Speed and Precise are supported.

  • StandardDataType (integer):

    0 : None, 1 : DEFSPC, 2 : NORM, 3 : COMMON, 4 : USER, 5 : External

    NORM, COMMON and USER are supported.

  • CorrectionType (integer):

    0 : None, 1 : ZAF, 2 : PRZ, 3 : Cliff-Lorimer, 4 : ZETA

    ZAF, PRZ and Cliff-Lorimer are supported.

  • ConversionType (integer):

    0 : None, 1 : Metal, 2 : Oxide, 3 : Compound

    Metal and Oxide are available.

  • OxideCation (integer):

    A cation number of the oxide. It is available in oxide mode of the conversion type.

  • EnableSumPeakRemoval (bool):

    True: Enable, False: Disable

Returns

Corresponds to get_quantitative_line_analysis_settings().

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.set_quantitative_line_analysis_settings({
    'ProcessingMethod' : 1,
    'StandardDataType' : 2,
    'CorrectionType' : 3,
    'ConversionType' : 1,
    'OxideCation' : 24,
    'EnableSumPeakRemoval' : True,

})

PyJEM.eds.function.set_quantitative_map_analysis_settings(param)dict

Sets the settings of quantitative mapping.

Parameters

param (dict) –

  • PixelWidth (integer):

    Width in pixels. Select a size from the list [64, 128, 256, 512, 1024, 2048, 4096]. Make sure that the size is less than the original size.

  • PixelHeight (integer):

    Height in pixels. Select a size from the list [64, 128, 256, 512, 1024, 2048, 4096]. Make sure that the size is less than the original size.

  • ProcessingMethod (integer):

    0: None, 1: Speed, 2: Precise

    Speed and Precise are supported.

  • StandardDataType (integer):

    0 : None, 1 : DEFSPC, 2 : NORM, 3 : COMMON, 4 : USER, 5 : External

    NORM, COMMON and USER are supported.

  • UserCategoryName (string):

    A category name of the standard data. It is available when StandardDataType is USER.

  • CorrectionType (integer):

    0: None, 1: ZAF, 2: PRZ, 3: Cliff-Lorimer, 4: ZETA

    ZAF, PRZ and Cliff-Lorimer are supported.

  • ConversionType (integer):

    0: None, 1: Metal, 2: Oxide, 3: Compound

    Metal and Oxide are available.

  • OxideCation (integer):

    A cation number of the oxide. It is available in oxide mode of the conversion type.

  • EnableSumPeakRemoval (bool):

    True: Enable, False: Disable

Returns

Corresponds to get_quantitative_map_analysis_settings().

Return type

dict

PyJEM.eds.function.set_quantitative_spectrum_analysis_settings(param)dict

Sets the settings of quantitative spectrum analysis.

Parameters

param (dict) –

  • ProcessingMethod (integer):

    0: None, 1: Speed, 2: Precise

    Speed and Precise are supported.

  • StandardDataType (integer):

    0: None, 1: DEFSPC, 2: NORM, 3: COMMON, 4: USER, 5: External

    NORM, COMMON and USER are supported.

  • UserCategoryName (string):

    A category name of the standard data. It is available when StandardDataType is USER.

  • CorrectionType (integer):

    0: None, 1: ZAF, 2: PRZ, 3: Cliff-Lorimer, 4: ZETA

    ZAF, PRZ and Cliff-Lorimer are supported.

  • EnableAbsorptionCorrection (bool):

    True: Enable, False: Disable

    Available in Cliff-Lorimer mode.

  • Thickness (integer):

    Available in the CorrectionType Cliff-Lorimer and EnableAbsorptionCorrection true.

    • Unit:

      nm

  • Density (integer):

    Available in the CorrectionType Cliff-Lorimer and EnableAbsorptionCorrection true.

    • Unit:

      g/cm3

  • EnableFluorescenceCorrection (bool):

    True: Enable, False: Disable

    Available in Cliff-Lorimer mode.

  • ConversionType (integer):

    0: None, 1: Metal, 2: Oxide, 3: Compound

    Metal and Oxide are available.

  • OxideCation (integer):

    A cation number of the oxide. It is available in oxide mode of the conversion type.

Returns

Corresponds to get_quantitative_spectrum_analysis_settings().

Return type

dict

PyJEM.eds.function.start_acquisition()dict

Starts an acquisition of EDS signals.

Returns

  • Message:

    A free text from EDS system.

  • DataID:

    An ID of acquired data.

  • AreaImageID:

    An ID of a selected area-scan image.

  • WorksheetID:

    An ID of a worksheet.

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.start_acquisition()
{'DataID': 'aaaa-aaaa-aaaa-aaaa','WorksheetID': 'bbbb-bbbb-bbbb-bbbb','AreaImageID': 'cccc-cccc-cccc-cccc'}
PyJEM.eds.function.stop_acquisition()dict

Stops an acquisition of EDS signals.

Returns

  • Message:

    A free text from EDS system.

  • Result:
    • OK:

      Success

    • Fail:

      Failure

Return type

dict

Example

>>> from PyJEM import eds
>>> eds.stop_acquisition()
{'Result': 'OK'}