Code Monkey home page Code Monkey logo

cltem's Introduction

Logo

clTEM

About

clTEM is an OpenCL accelerated multislice program for simulating images from a transmission electron microscope, originally written by Dr Adam Dyson as part of his PhD.

Citing

Please cite clTEM using the Zenodo repository, or the following paper:

Jonathan J. P. Peters, A Fast Frozen Phonon Algorithm Using Mixed Static Potentials, Ultramicroscopy (2021)

Features

  • OpenCL acceleration with multi-device support
  • Open any structure defined by simple .xyz or .cif files
  • View structure through a OpenGL accelerated model viewer (showing slice positions and simulation area)
  • Use classic slice model with projected potentials or a full 3D approximation
  • Use potential parameterisation by Kirkland, Peng et al. or Lobato and Van Dyck
  • Simulate inelastic scattering using the frozen phonons and plasmons
  • Simulate CTEM exit wave, diffraction pattern and image
  • Incorporate dose into CTEM simulation with detective quantum efficiency (DQE) and noise transfer function (NTF)
  • Use as a command line interface or with a GUI
  • Compatible with Linux and Windows

Usage

Some documentation has been written on the github pages site to introduce the basic concepts.

Installation

Currently clTEM has only been released in alpha. It is fully functional, though not thoroughly tested and bugs can be expected.

Dependencies

cltem's People

Contributors

jjppeters avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

cltem's Issues

Implement finite difference method

Existing code for finite difference exists, though I'm not entirely familiar with how it works. This should be added and tested at some point.

Add support for default settings

Settings defaults should be editable by the user (perhaps from a file a la #3). Maybe multiple defaults can be loaded and selected from. This would help as many people only need to simulate for a select few microscopes in certain configurations.

CTEM CCD image simulation doesnt work on some hardware

The dose/CCD simulation doesn't work on some hardware (i.e. an intel i7-4600u) when it does on others (tested working on a gtx 670). This is likely caused by reading/writing buffers before kernels have finished, or similar.

Images appear to update mutiple times

The images are updated multiple times (at least after the first simulation). This is very noticeable for larger images. Possible causes are the image plot redrawing multiple times or the signal slot mechanism to return images is called multiple times.

Structure info on main GUI is incorrect

Changes to the way the simulation area is handled means the structure info on the main window is incorrect/irrelevant. This just needs to make sure the correct function are called

Add separate console application

instead of needing the GUI, a separate console application should be created to use the simulation library. This makes it easier to run on servers, or to automate with scripting.

Unknown error when performing TDS CBED simulations in command line

Whilst batch simulating CBED patterns, an unexpected error occurred (program has stopped working) only sometimes. Running 400+ 10 TDS configuration simulations produced zero error, but with 30 TDS configurations the error happens sometimes (every 30 simulations or so?). No clue what caused it.

Change atom bins to be appropriate size

I beleive a bug is caused where the bins get overladed with atoms. This main occurs when loading a structure that should be in nm as Angstroms. The simulation then faults at the potential generation stage (it completes the empty 'pre-structure' slices and fails as soon as it enters the structure).

I'm guessing this is due to the bins containing too many atoms but I'm not really sure...

Simulation produces blank results

On some systems, some of the time, the simulation produces blank results. Similar problems before have related to asynchronous read/write of opencl buffers before a kernel has completed.

Small images are not shown correctly

Images with small dimensions (found in a 2x2 image) do not resize properly as the window is resized. Untested for even slightly larger images. May not be a problem as 2x2 simulations are going to be very rare.

Change how the simulation area is handled

The simulation area has different purposes for different modes. Currently it works for the CTEM mode, but doesnt make much sense in STEM/CBED. In these modes, the simulation area is purely to determine the reciprocal scale. The dialog should depend changing on the mode, and for STEM/CBED, should be allowed to set a desired resolution, or desired maximum in reciprocal space (similar options could be used to achieve a set resolution in CTEM).

Release build does not always produce output

tested on windows doing cbed with 30 TDS configs. Suspected OpenCL issue not completing kernels before getting data/continueing.

Perhaps try spamming WaitForQueueFinish commands to see if it helps

Add support for .cif files

currently, only xyz files are handled. Generating a structure from a .cif would also be useful (and maybe allow it to be exportable as a .xyz)

Add option to crop CTEM simulations

Currently, CTEM simulations remove the padded area around the desired simulation area. This should be an optional as the diffraction pattern always includes the padded area and it may be needed to show exactly what has been simulated.

Find way to preserve exit wave between simulations (for CTEM)

For CTEM image simulations, the exit wave does not need to be recalculated when the aberrations change (only for voltage, etc...). It could be possible to preserve the exit wave simulation so it does not need to be recalculated (if possible), though this is made tricky by the use of threads and multi-device support.

Define code style

Need to use a defined code style for function names etc...

Currently it is a complete mess. Sorry.

Add icon

For windows, icon needs to be added at build

Check CBED probe is in expected position

Check the CBED probe is in the correct position. It is fairly easy to export the generated incident wavefunction to measure. Check complications due to the reversal of the y-axis too.

Verify units

Every variables needs to be tested to verify it's units. Currently it is not obvious and some things seem to have a massive effect on the simulation when they might not be expected to.

Cannot edit default microscope config due to write protection

In windows, the default install location is write protected, so users cannot easily edit the default. This should be moved to a new location so it can be changed, with a possible option to 'save as default' so the user does not need to know the location.

Add in CTEM image simulation

Currently, only the exit wave part is simulated. Functions to simulate the actual image are present but not 'hooked up' and are untested in the current version.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.