Skip to content
Michael-MD edited this page Mar 27, 2023 · 8 revisions

Welcome to the Electron-Microscopy-in-C wiki! Here I'll go through how the code is structured so that by the end you'll understand how it all works and be able to modify it yourself. If you intend on using this code, you may fork although I would appreciate it if you email me at: [email protected] to left me know first.
Disclaimer 1: Although I have tested this code by reproducing the appropriate figures from Kirkland, use this code at your own discretion.
Disclaimer 2: I will assume you are already familiar with the theory of electron microscopy so it would be better to gain familiarity with this first before trying to read this wiki or use this code. I personally recommend Advanced computing in electron microscopy by Earl J. Kirkland 3rd Ed. which provides an extensive introduction.

Overview

Here is an overview of the classes and their inheritance. From here you can either jump to a specific class you are trying to use. '->' denotes used by

atom.h -> crystal.h -> layer.h -> multislice.h -> CTEM.h and STEM.h. STEM.h -> ASTEM -> ADFSTEM, ABFSTEM and BFSTEM.

The top of the tree are the most fundamental classes while classes lower on the tree correspond are higher level and will likely be the classes you will be instantiating. Some files are simply for defining convenient functions that will be used repeatedly such as forier_utils.h (short for fourier utilities) which contains various fourier transform and matrix operations common to fourier transforms. The files for defined for convince to be used for calculations are

  • constants.h
  • general_purpose_utils.h
  • relativistic_corrections.h
  • fft.h
  • fourier_utils.h
Files which contribute to the physics simulation directly are
  • atom.h
  • crystal.h
  • layer.h
  • multislice.h
  • ASTEM.h
  • CTEM.h
  • ADFSTEM.h
  • BFSTEM.h
  • ABFSTEM.h
Each of these files will be elaborated on in a separate section.

Notes

Note 1: The fft convention used in kirkland is the opposite to the implementation used in code so whenever kirkland says to do an fft and inverse fft is done in the code.
Note 2: The code uses the fft from https://github.com/Michael-MD/Radix-2-FFT with the functions adapted to take in vectors rather than lists.

Clone this wiki locally