Close this search box.
  1. Home
  2. »
  3. Product
  4. »
  5. Phenom Desktop Scanning Electron Microscopes
  6. »
  7. Python-Based SEM Automation

Python-Based SEM Automation

Phenom Knowledge base

– Webinar –

If SEM, Then Script: Python Coding for Scanning Electron Microscopes

This upcoming webinar will showcase the innovative application of…

– Blogs –

Applications of SEM in Semiconductor Device Failure Analysis

Failure analysis (FA) is an essential methodology that engineers…

– Blogs –

Desktop SEM vs Floor Model SEM: A Comparison

In the realms of scientific industry and research, scanning…

Phenom Desktop SEM

Automated SEM with Python

Package Overview

Phenom Desktop SEMs benefit from Python compatibility, a feature that enables users to activate coded scripts that control imaging workflows and data collection procedures. Scripting offers absolute freedom to dictate which functions the microscope performs, how that action is completed, and where each step may fit into a larger sequence. Because Python inherently comes with a multitude of supported libraries, one can easily take advantage of widely-used sets like NumPy, Pandas, or SciPy to amplify the number of possibilities they have at their disposal.

There are two ways of implementing Python with Phenom Desktop SEMs, and although each method is based on the same Python programming foundation, the two are used very differently, requiring drastic differences of engagement from users. The first is known as the Phenom Programming Interface (PPI) package and gives users direct access to code themselves by using the PyPhenom Python library. Contrarily, the second method, Phenom Process Automation (PPA), represents a hands-off coding solution in which the executive script is planned, developed, and delivered to the recipient by an external team.

Freedom to Craft SEM Workflows

The PyPhenom library contains hundreds of callable functions to control the electron beam, sample stage, EDS, and anything in between

Time Saving Solution

Whether it’s PPI or PPA, Python makes it possible to contain a huge sequence of SEM actions in a single button or custom user interface

Version Compatibility

Compatibility with all versions of Python from Python 2.7 to 3.10 means that the newest Python updates translate directly to the microscope

Easy Installation

Easy to install, connect with the Phenom, and begin scripting through any text editor like Atom or PyCharm; the choice completely open

The video above is a demonstration of the Ultra-Depth of Focus PPA script performed on the Phenom Pharos. The protocol stacks images with varying focal points by capturing height differences of a sample that would otherwise be impossible to image at one focus. Simply set a focal range by adjusting foreground and background foci, enter respective quantities into the user interface, choose a distance step size, and then prompt the script to begin.

What is the Difference Between PPI and PPA?

PPI = Phenom Programming Interface

  • Freedom to script as you wish
  • Engage with PyPhenom: the Python library designed for Phenom Desktop SEMs and streamlined for accessibility
  • Compose precise workflows and enable automated data collection 

PPA = Phenom Process Automation

  • Service to receive scripts tailored to your SEM analysis workflow
  • Custom-made solution based on specific goals and outcomes
  • Select from a repertoire of existing scripts that may suit your application

Talk to an Instrumentation Specialist Today!

Phenom Programming Interface (PPI)

PPI Features

Using PPI empowers the user of the Phenom Desktop SEM to program functions such as:

  • Acquire the operational mode of the Phenom
  • Move the sample from the NavCam to SEM and vice versa
  • Move to a position on a sample
  • Adjust the beam settings
  • Focus
  • Viewing modes
  • Vacuum settings (Phenom XL-only)

Examples of processes that are good candidates for PPI scripting:

  • Critical dimension analysis
  • Failure analysis of periodic features
  • Coating analysis
  • Automated fiber analysis
  • And many more!
Phenom Process Automation (PPA)

Available Scripts

P-Series & XL Compatible Scripts


SmartScan is an automated large field-of-view image mapping script that provides a wide range of customization. This script will automatically acquire several images across one or multiple areas drawn by the user. Users can also determine how their SmartScan is collected, either in random or sequential acquisition strategies, and customize the imaging area shape and size. There are even post processing capabilities to allow for contrast/brightness adjustments. The amount of time saved, and the consistency of the results make SmartScan an excellent tool for any application.


Autoscan can automatically acquire images of samples at selectable magnification levels over a defined area. This script is great for obtaining consistent images of samples over a short amount of time. 

Ultra-depth of focus

Ultra-depth of focus is a simple script designed to take multiple images at multiple working distances and combine them to create an image that is fully in focus. This script is extremely useful for failure analysis applications since it provides an effectively large depth of focus in the final image.


Chloroscan was written for an application requiring the detection of PVC microparticles in mussels. While not being able to specifically identify PVC with EDS, PVC contains a large amount of chlorine. This script will analyze a BSD image, identify particles in said image, and then conduct EDS point analysis on those identified particles. Once complete, the script will calculate the chlorine content at each point and flag those specific particles. Chloroscan has the ability to analyze thousands of particles in a brief timeframe, making it invaluable for customers looking to conduct large scale particle analyses.

XL Compatible Scripts

Air void script

The distribution of bubbles/air voids in concrete affects its durability during freeze/thaw cycles. As such, companies that produce concrete will conduct quality control analyses to determine the spacing factor, which refers to the distance between the air bubbles. This script works by capturing an image using the BSD, identifying the voids, and then calculating the spacing factor using the linear transverse method. The Air Void Script is an incredible tool as it saves time and removes any operator bias.

Critical dimension script

Lithography, the process of patterning circuits on the surface of silicon wafers, is a fundamental step in the semiconductor manufacturing process. Checking each of these patterns for factory acceptance tests takes an exhaustive amount of time. Our critical dimension script was developed to help drastically reduce the time it takes to conduct these analyses. The only steps the user has to take when using this script is to load the sample into the Phenom, set the proper coordinates, and let the script do the rest. A report will be generated upon the completion of the script that displays all of the relevant measurements acquired. Our Critical Dimension Script is the perfect tool for customers focused on increasing throughput while generating more reliable results.

Coating inspection script (Zn-Phosphate)

Our Coating Inspection Script is able to measure the total coverage percentage over a given sample using backscatter thresholding. BSDs show variance in elemental compositions through differing brightness/contrast levels in an image. The coating inspection tool is able to differentiate these brightness/contrast levels and calculate the coating coverage in a given image. This method allows us to bypass EDS while providing higher resolution data at a significantly faster pace. The Coating Inspection Script can be used for any coating, including zinc-phosphate coatings on steel parts.

AsbestosScan 2.0

AsbestosScan 2.0 was developed for customers looking to detect and analyze asbestos fibers on air filters and bulk samples. AsbestosScan 2.0 improves upon its predecessor by incorporating quick navigation controls, EDS analysis, a reference spectra library, and automatically generated reports. This script also adheres to ISO 14966.

Python Automation Compatibility

Phenom Desktop SEM Models Compatible with Python

Want to learn more? Talk to a scientist:

Questions about an instrument? Send us a message!

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.