Explore 4D-STEM in three minutes#
Question: Which scattering angles make the gold particles easiest to see?
In Colab, choose Runtime → Run all. Wait for the explorer to appear. There is nothing to upload or configure.
# @title 2. Load a small real dataset { display-mode: "form" }
from quantem.widget import Show4DSTEM
from quantem.widget.datasets import show4dstem_gold
stem_dataset = show4dstem_gold(size="medium")
Source: gold_128_npy_bin8 from Hugging Face
Full stack: (128, 128, 24, 24) uint16
Preview: (64, 64, 24, 24), scan stride 2
Sampling: [4. 4. 3.68 3.68] ['A', 'A', 'mrad', 'mrad']
Processing: real-space 4x4 block average from gold_512_npy_bin8; detector remains bin8
Try three things#
Before you click, predict which panel will change.
Choose a scan point: click a particle in the right image. The diffraction pattern on the left updates.
Compare angles: click BF, then ADF, below the left panel. Which image makes the particles stand out?
Measure a line: turn on Profile above either panel, then click two points. Drag an endpoint to move the measurement.
Use Reset above a panel whenever you want a clean view.
# @title 3. Open the explorer { display-mode: "form" }
from sys import modules
viewer = Show4DSTEM(
stem_dataset,
dp_scale_mode="linear",
offline="google.colab" not in modules,
offline_dtype="uint16",
save_state=True,
precompute_virtual_images=False,
show_fft=False,
)
viewer
What changed?#
A new scan point selects a different diffraction pattern.
A new detector integrates different scattering angles into the image.
A Profile plots intensity along the line you drew. No Python call is required.
Ready for microscope data? Open one dataset or several datasets.