Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Homework 2

Chapter 2: Introduction


Homework 2

Changing Illumination

Download

OpenInColab

part of

MSE672: Introduction to Transmission Electron Microscopy

by Gerd Duscher, Spring 2025
Microscopy Facilities
Institute of Advanced Materials & Manufacturing
Materials Science & Engineering
The University of Tennessee, Knoxville

Background and methods to analysis and quantification of data acquired with transmission electron microscopes.

Load Packages

First we need to load the libraries we want to use. Here we use:

  • numpy: numerical library

  • matplotlib: graphic library

  • pyTEMlib: TEM microsocpy library

All of those packages except pyTEMlib are provided by annaconda.

Check Installed Packages

import sys
import importlib.metadata
def test_package(package_name):
    """Test if package exists and returns version or -1"""
    try:
        version = importlib.metadata.version(package_name)
    except importlib.metadata.PackageNotFoundError:
        version = '-1'
    return version

# pyTEMlib setup ------------------
if test_package('pyTEMlib') < '0.2025.1.0':
    print('installing pyTEMlib')
    !{sys.executable} -m pip install  --upgrade pyTEMlib -q
# ------------------------------
print('done')
installing pyTEMlib
done

Load the plotting and pyTEMlib packages

Note:

On Google colab you might have to restart the session in Menu: Runtime-Restart Session (Crtl-M) !

%matplotlib widget
import matplotlib.pylab as plt
import numpy as np
import sys
if 'google.colab' in sys.modules:
    from google.colab import output
    output.enable_custom_widget_manager()
    
import pyTEMlib.animation as animate
You don't have igor2 installed.     If you wish to open igor files, you will need to install it     (pip install igor2) before attempting.
You don't have gwyfile installed.     If you wish to open .gwy files, you will need to      install it (pip install gwyfile) before attempting.
Symmetry functions of spglib enabled
Using kinematic_scattering library version {_version_ }  by G.Duscher

Change Illumination on sample

Below is a stack of lenses that is equivalent to the condenser lens system on the Spectra 300.

The objective lens focal length is usually not changed (at least not much), and the sample is in the middle of the objective lens system.

Change the focal lengths parameters so that there the illumination changes from parallel to convergent.

Tip: do not change the gun (first value), and the objective (last two values) values.

# ------ INPUT ------#
focal_lengths = np.array([50.0, 70.0,  378.0,  127.0 ,  50,  50]) # Slightly convergent

#                         Gun,  C1,   C2,      C3,   objective lens
#--------------------#

# Define lenses here
lens_labels =             ['Gun', 'C1', 'C2', 'C3' , 'Objective', '']
lens_positions = np.array([200.0, 400.0, 600.0, 800.0, 1100,1200    ]) # lens positions


animate.propagate_beam([0,],1,  3, lens_positions, focal_lengths, lens_labels,   'blue')
Loading...

Questions

  • Does your beam stay close to the optic axis?

  • Could you reach a convergent beam byonly changing one lens?

  • What is the convergence angle?