Python Code Snippets

image scan (NCM)

Code implemented to operate according to the sequence for acquiring NCM images. Default parameters are …

from time import sleep from glob import glob from json …
Control Head mode

[set] Head Mode Change SLD On/Off [get] sld on/off mode type pspd align [dependency] - …

from SmartRemote import SmartRemote class HeadMode: def __init__(self, SR:SmartRemote): self.__sr …
Image Acquisition Code for Cantilever Training Model

Sample: The specimen to be measured (if too close, sample color may mix with the …

import numpy as np from SmartRemote import SmartRemote as SR …
Flatten the grating sample

Code that uses K-Means clustering to split the Top and Bottom regions and performs line …

import os import warnings import numpy as np import matplotlib.pyplot …
Calculate the region histogram range

Code to calculate the height of a grating sample with two regions. [dependency] - numpy …

import os import warnings import numpy as np from sklearn.cluster …
3d plot tiff

Visualize the TIFF image as a 3D plot. [dependency] - numpy - matplotlib - pspylib

import os import numpy as np import matplotlib.pyplot as plt …
plot tiff

Adjust the color map range to make the TIFF visualization look better. [dependency] - numpy …

import os import numpy as np import matplotlib.pyplot as plt …
Set Data location

Set the save location for TIFF files measured by SmartScan. [dependency] - SmartRemote

from json import dumps from SmartRemote import SmartRemote class DataLocation: …
Start NCM Sweep

Code that performs an NCM Sweep

from SmartRemote import SmartRemote class NCMSweep: def __init__(self, SR:SmartRemote): self.__sr …
Add and delete bulk channels

Code to add or remove channel data displayed in the line profile. [dependency] - SmartRemote

from json import dumps from SmartRemote import SmartRemote class ControlBulkChannel: …
Control the Z Scanner

[set] You can retract the Z Scanner or adjust its operating range. [get] You can …

from SmartRemote import SmartRemote class ControlZScanner: def __init__(self): self.__sr = …
Gaussian fitting

Code to fit input 1D data with a Gaussian function. [dependency] - numpy - scipy

import numpy as np import matplotlib.pyplot as plt from scipy.interpolate …
Region histogram

Compute and plot the region histogram. [dependency] - numpy - matplotlib - pspylib

import os import numpy as np import matplotlib.pyplot as plt …
Wafer Zero Scan SmartRemote Code

Wafer Zero Scan code used in the Quality Assurance Automation Tool

from src.core.afm import AFM as AFM from src.core.afm import CHECKER …
N-dimension flatten

Flatten the TIFF image data using a n-order Legendre polynomial function. [dependency] - numpy - …

import os import numpy as np import matplotlib.pyplot as plt …