Bohrium
robot
新建

空间站广场

论文
Notebooks
比赛
课程
Apps
我的主页
我的Notebooks
我的论文库
我的足迹

我的工作空间

任务
节点
文件
数据集
镜像
项目
数据库
公开
DPC_ptycho_02_sim
AI4S
STEM
py4dstem
AI4SSTEMpy4dstem
Linfeng Zhang
发布于 2023-09-18
推荐镜像 :py4dstem:py4dstem
推荐机型 :c2_m4_cpu
Defocused probe ptychography
Downloads
Acknowledgements
load the data
Calibration
DPC
Ptychography

Defocused probe ptychography

In this tutorial notebook, we will perform both differential phase contrast (DPC) and ptychographic phase reconstructions from a simulated 4D-STEM dataset.

Downloads

Acknowledgements

This tutorial was created by the py4DSTEM instructor team:

The 4D-STEM dataset used here was simulated by Colin Ophus using the reference implementation of partitioned PRISM which can be found at the Github repo for superPRISM. We have also added the common experiment artifacts of probe descan which varies over the field of view and shot noise.

Updated 2023 July 12

代码
文本
[1]
import numpy as np
import py4DSTEM
print(py4DSTEM.__version__)
0.14.2
代码
文本
[2]
file_path = 'data/'
file_data = file_path + 'ptycho_sim_01_data.h5'
file_probe = file_path + 'ptycho_sim_01_probe.h5'
代码
文本

load the data

代码
文本
[3]
dataset = py4DSTEM.read(file_data)
dataset
DataCube( A 4-dimensional array of shape (32, 32, 200, 200) called 'datacube',
          with dimensions:

              Rx = [0,1,2,...] pixels
              Ry = [0,1,2,...] pixels
              Qx = [0,1,2,...] pixels
              Qy = [0,1,2,...] pixels
)
代码
文本
[4]
probe = py4DSTEM.read(file_probe)
probe
DiffractionSlice( A 2-dimensional array of shape (200, 200) called 'diffractionslice',
                  with dimensions:

                      dim0 = [0,1,2,...] pixels
                      dim1 = [0,1,2,...] pixels
)
代码
文本

Let's plot some of the probe positions:

代码
文本
[5]
py4DSTEM.show(
[
dataset.data[11,24],
dataset.data[18,24],
dataset.data[11,12],
],
cmap='turbo',
vmax=1,
power=0.333,
axsize=(4,4),
ticks=False,
)
代码
文本

Calibration

代码
文本

We will manually enter the diffraction space sampling and the real space step size between adjacent STEM probes:

代码
文本
[6]
dataset.calibration.set_Q_pixel_size(0.025)
dataset.calibration.set_Q_pixel_units('A^-1')
dataset.calibration.set_R_pixel_size(5.0)
dataset.calibration.set_R_pixel_units('A')
dataset.calibration
Calibration( A Metadata instance called 'calibration', containing the following fields:

             Q_pixel_size:    0.025
             R_pixel_size:    5.0
             Q_pixel_units:   A^-1
             R_pixel_units:   A
)
代码
文本

DPC

代码
文本

First, we perform the preprocessing steps. These include:

  1. measuring the center of mass (CoM) for all probe postions.
  2. fitting the probe descan to a plane wave or another function.
  3. determining the best-fit rotation between real and reciprocal space.
  4. calculating the corrected CoM images.
代码
文本
[7]
dpc = py4DSTEM.process.phase.DPCReconstruction(
datacube=dataset,
energy=80e3,
).preprocess()
代码
文本

Next we perform the DPC reconstruction:

代码
文本
[8]
dpc = dpc.reconstruct(
progress_bar=True,
store_iterations=True,
max_iter=32
).visualize()
代码
文本

The reconsruction clearly shows the object on the substrate. However, the resolution is limited to the STEM probe sampling - we only recover one phase value per probe position. In order to perform superresolution imaging (i.e. recover spatial frequencies outside of the numerical aperture / probe semiangle), we will need to peform a ptychographic reconstruction.

代码
文本

Ptychography

We perform similar pre-processing for ptychography as we do for DPC.
Getting a good guess for the rotation between real space and diffraction space is essential to getting a good reconstruction in defocused probe ptychography.

代码
文本
[9]
ptycho = py4DSTEM.process.phase.SingleslicePtychographicReconstruction(
datacube=dataset,
verbose=True,
energy=80e3,
defocus=600,
vacuum_probe_intensity = probe.data,
#device='gpu',
).preprocess(
plot_center_of_mass = False,
plot_rotation = False,
plot_probe_overlaps = True,
)
代码
文本

Next, we perform the ptychographic reconstruction.
There are various options we can tune below, but this reconstruction converges quite rapidly due to the sample being close to a weak phase object (the thickest region of the sample consists of 4 graphene layers).

代码
文本
[10]
ptycho = ptycho.reconstruct(
progress_bar = True,
store_iterations = True,
max_iter = 8,
normalization_min=0.1
).visualize(
cbar=True,
iterations_grid='auto',
)
代码
文本

We then plot the final reconstructed phase:

代码
文本
[11]
py4DSTEM.show(
np.angle(ptycho.object_cropped),
vmin=0.33,
vmax=0.99,
cmap='inferno',
ticks=False,
)
代码
文本
[ ]

代码
文本
AI4S
STEM
py4dstem
AI4SSTEMpy4dstem
点个赞吧
本文被以下合集收录
py4DSTEM Tutorials
Linfeng Zhang
更新于 2024-07-25
22 篇7 人关注
推荐阅读
公开
ptycho04_STO-mixedstate
STEMpy4dstemAI4S
STEMpy4dstemAI4S
Linfeng Zhang
发布于 2023-09-18
1 转存文件
公开
ptycho03_Si-multislice: Phase contrast imaging using multislice ptychography
AI4Spy4dstemSTEM
AI4Spy4dstemSTEM
Linfeng Zhang
发布于 2023-09-18
1 转存文件