PyJEM.sightx.function module¶
-
class
PyJEM.sightx.function.
Detector
(det)¶ Bases:
object
-
AutoContrastBrightness
() → dict¶ Start AutoContrastBrightness function.
- Returns
Execute status
- Return type
dict
-
AutoFocus
() → dict¶ Start AutoFocus function.
- Returns
Execute status
- Return type
dict
Example
>>> detector.Detector(detector name).AutoFocus() {"status":...}
-
AutoOrientation
() → dict¶ Start AutoOrientation function.
- Returns
Execute status
- Return type
dict
-
AutoStigmator
() → dict¶ Start AutoStigmator function.
- Returns
Execute status
- Return type
dict
-
AutoZ
() → dict¶ Start AutoZ function.
- Returns
Execute status
- Return type
dict
-
get_detectorsetting
() → dict¶ Obtaining setting information of selected detector.
- Returns
get the selected detector’s info.
- Return type
dict
Example
>>> detector.Detector(detector name).get_detectorsetting() { "ExposureTimeValue":100, "GainIndex":100, ... }
-
get_image_cache
() → bytes¶ Returns a cached image of a Live image without using SnapShot. Can only be used if the flag to leave the cache is ON
- Returns
bytes array.
- Return type
bytes
-
get_insert_state
() → dict¶ Get detector in/out status.
- Returns
Execute status
- Return type
dict
-
insert
() → dict¶ Insert a select detector.
- Returns
Execute status
- Return type
dict
-
livesnapshot
(ext: str, save=False, filename=None, show=False)¶ Take an image with the specified extension. Obtaining images faster than “snapshot”.
- Parameters
extention (str) – “jpg”, “bmp”, “tiff”
save (bool) – ‘True’ is save capture file.
filename (str) – Name of file to save. It is possible to include an absolute path. Only available when ‘save’ is True.
show (bool) – show the Image file.
- Returns
if enter argument is only “extention”, return value is image data stream (bytes). else return value is saved file name.
File stream saved with the selected extension
- Return type
bytes or str
-
livestart
() → dict¶ Start live.
- Returns
Execution result
- Return type
dict
Example
>>> det=detector.Detector(*detector name*) >>> det.livestart() {"status":"OK"}
-
livestop
() → dict¶ Stop live.
- Returns
Execution result
-
retract
() → dict¶ retract a select detector.
- Returns
Execute status
- Return type
dict
-
set_areamode_imagingarea
(Width: int, Height: int, X=None, Y=None) → dict¶ Set the beam position when ScanMode is “Area”. Sets which part of the scanning range set by ImagingArea is scanned. The top left vertex is (0, 0). If no value is entered for the argument, the value is not changed.
- Parameters
X (int) – 0-4096
Y (int) – 0-4096
Width (int) – 0-4096
Height (int) – 0-4096
- Returns
The value set to TEM.
- Return type
dict
-
set_binningindex
(value: int) → dict¶ Set the Binning value as index.
- Parameters
value (int) – 0-4
- Returns
The value set to TEM.
- Return type
dict
Note
value(Args)’s range sdepends on TEM model
Note
This function corresponds to camera only.
-
set_detectorsetting
(body: dict) → dict¶ Wild card method.
- Parameters
body (dict) – “key” is function name you want to use. “value” is to change value.
- Returns
The value set to TEM.
- Return type
dict
Example
>>> body = {"ExposureTimeValue":100,"GainIndex":8000,"OffsetIndex":8000} >>> detector.Detector(detector name).set_detectorsetting(body)
-
set_digitalrotation
(value: float) → dict¶ Set the digital rotation angle as absolute value.
- Parameters
value (float) – 0.0-360.0
- Returns
The value set to TEM.
- Return type
dict
-
set_exposuretime_index
(value: int) → dict¶ Set the exposure time as index.
- Parameters
value (int) – exposure time index. range is 0-65535
- Returns
The value set to TEM.
- Return type
dict
Example
>>> detector.Detector(detector name).set_exposuretime_index(100) {"ExposureTimeIndex":100}
Note
value(Args)’s range sdepends on TEM model
-
set_exposuretime_value
(value: float) → dict¶ Set the exposure time as usec value.
- Parameters
value (float) – 0.0-1000.0(μsec)
- Returns
The value set to TEM.
Note
value(Args)’s range sdepends on TEM model
-
set_frameintegration
(value: int) → dict¶ Set the accumulation count.
- Parameters
value (int) – frame integration value. range is 0-255.
- Returns
The value set to TEM.
- Return type
dict
Note
value(Args)’s range sdepends on TEM model
-
set_gainindex
(value: int) → dict¶ Set the gain value as index.
- Parameters
value (int) – 0- 4095
- Returns
The value set to TEM.
- Return type
dict
Note
value(Args)’s range sdepends on TEM model
-
set_imaging_area
(Width: int, Height: int, X=None, Y=None) → dict¶ Set the number of pixels of the live image. x and y are the coordinates of the starting pixel of the read image. width and height are the coordinates of the end pixel of the read image. If no value is entered for the argument, the value is not changed.
- Parameters
X (int) – 0-4096
Y (int) – 0-4096
Width (int) – 0-4096
Height (int) – 0-4096
- Returns
The value set to TEM.
- Return type
dict
-
set_offsetindex
(value: int) → dict¶ Set the offset value as index.
- Parameters
value (int) – 0- 4095
- Returns
The value set to TEM.
- Return type
dict
Note
value(Args)’s range sdepends on TEM model
-
set_scanmode
(value: int) → dict¶ Set the scanMode. :param value: 0:Scan, 1:Area, 3:Spot :type value: int
- Returns
The value set to TEM.
- Return type
dict
-
set_scanrotation
(value: float) → dict¶ Set the scanRotation angle as absolute value.
- Parameters
value (float) – 0.0-360.0
- Returns
The value set to TEM.
- Return type
dict
-
set_scanrotation_step
(value: float) → dict¶ Set the minimum variation of scanRotation.
- Parameters
value (float) – 0.0-20.0
- Returns
The value set to TEM.
- Return type
dict
-
set_spotposition
(X: int, Y: int) → dict¶ Set the beam position when ScanMode is “Spot”. Sets which part of the scanning range set by ImagingArea is scanned. The top left vertex is (0, 0). If no value is entered for the argument, the value is not changed.
- Parameters
X (int) – 0-4096
Y (int) – 0-4096
- Returns
The value set to TEM.
- Return type
dict
-
snapshot
(ext: str, save=False, filename=None, show=False)¶ Acquire image about the args “extension”. The image is taken with the selected detector and the acquired image array is output or saved.
- Parameters
extention (str) – “jpg”, “bmp”, “tiff”
save (bool) – ‘True’ is save capture file.
filename (str) – Name of file to save. It is possible to include an absolute path. Only available when ‘save’ is True.
show (bool) – show the Image file.
- Returns
if enter argument is only “extention”, return value is image data stream (bytes). else return value is saved file name.
File stream saved with the selected extension. (If there is an input in an argument other than ‘extention’, None is returned.)
-
snapshot_rawdata
() → bytes¶ Raw data of the image acquired by the specified detector. the raw data is returned as a byte array.
- Returns
2 dimensional byte array of acquired image data.
- Return type
dict
-
snapshotframe
(ext, save=False, filename=None, show=False)¶ This function is output the acquired image array. this function does not acquire the new image, to return the image array acquired with the snapshotall() function.
- Parameters
extention (str) – “jpg”, “bmp”, “tiff”
save (bool) – ‘True’ is save capture file.
filename (str) – Name of file to save. It is possible to include an absolute path. Only available when ‘save’ is True.
show (bool) – show the Image file.
- Returns
if enter argument is only “extention”, return value is image data stream (bytes). else return value is saved file name (str).
File stream saved with the selected extension
Note
This function does not acquire new image, to return the image array acquired with the snapshotall() function.
-
-
PyJEM.sightx.function.
assign_channel
(detectorName: str, channel=0) → dict¶ Assign the selected detector to a channel.
- Parameters
detectorName (str) – Detector name
channel (int) – Channel number to assign the detector. (Only multiple channles)
- Returns
Execution result.
- Return type
dict
-
PyJEM.sightx.function.
get_assignChannels
() → dict¶ Get activate detectors list.
- Returns
activate detectors dict.
- Return type
dict
Example
>>> detector.get_assignChannels() { "0": “BF”, "1": “ADF1”, "2": “ADF2”, "3": “None”, }
-
PyJEM.sightx.function.
get_attached_detector
() → list¶ Acquisition of detector names currently available in TEMCenter.
- Returns
List of available detector names.
-
PyJEM.sightx.function.
get_config
() → dict¶ This function returns the package’s settings.
- Returns
service info.
- Return type
dict
Example
>>> detector.get_config() {'name': '---', 'ip': '---', 'port': ---, 'uri': '---'}
-
PyJEM.sightx.function.
set_ip
(val) → None¶ This function can modify the IP Address which is URI of this package.
- Parameters
val (int) – ip address.
-
PyJEM.sightx.function.
set_port
(val: int) → None¶ This function can modify the port number which is URI of this package.
- Parameters
val (int) – port numnber.
Warning
Please do not use it except for JEOL service.
-
PyJEM.sightx.function.
snapshotall
() → dict¶ Acquire all available detectors.
- Returns
Execution result
- Return type
dict
Note
this function is only STEM mode.
Note
To get the acquired image data by this function, please to use snapshotframe() function.
-
PyJEM.sightx.function.
start_accumulate_image_cache
() → dict¶ Turn on the flag to keep the cached image of the Live image.
- Returns
Execution result
- Return type
dict
Example
>>> detector.start_accumulate_image_cache() {"status":"OK"}
-
PyJEM.sightx.function.
stop_accumulate_image_cache
() → dict¶ Turn off the flag to keep the cached image of the Live image
- Returns
Execution result
- Return type
dict
Example
>>> detector.stop_accumulate_image_cache() {"status":"OK"}