Dark-field X-ray microscopy visualization

Dark-field X-ray microscopy visualization - Published in JOSS (2023)

https://github.com/trygvrad/df-xrm_viz

Science Score: 93.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Scientific Fields

Mathematics Computer Science - 84% confidence
Last synced: 6 months ago · JSON representation

Repository

Visualization of DF-XRM

Basic Info
  • Host: GitHub
  • Owner: trygvrad
  • License: mit
  • Language: Jupyter Notebook
  • Default Branch: master
  • Size: 7.49 MB
Statistics
  • Stars: 4
  • Watchers: 1
  • Forks: 2
  • Open Issues: 4
  • Releases: 1
Created over 4 years ago · Last pushed 6 months ago
Metadata Files
Readme Contributing License

README.md

DF-XRM_viz

Visualization of DF-XRM, made to be hosted at https://trygvrad-df-xrm-viz-df-xrm-vis-streamlit-91mzhk.streamlit.app/

You may run a standalone version by using streamlit locally by calling streamlit run DF-XRM_vis_streamlit.py or run the jupyter example.

Usage

Sample absorption

Uploading a .cif file to DF-XRM_vis (Fig. 1a) DF-XRM_vis will plot the attenuation length with respect to the energy (Fig. 1d), and plot the transmission with respect to the sample thickness (Fig. 1e).

A handful of crystal-structures are available from the dropdown menu for easy access (as shown in the example).

The selected X-ray energy can then be changed (Fig. 1b, in keV or Å), and the thickness of the sample can be changed (Fig. 1c).

This gives an immediate assessment of the flux exiting the sample, thus determins the viability of utilizing the sample for DF-XRM.

Considering Q-vectors

Based on the provided .cif file and chosen wavelength, DF-XRM_vis will provide a table of available reflections, their scattering angle and d-spacing.

A suitable reflection, as allowed by the instrument, can then be chosen. DF-XRM_vis will automatically select the brightest reflection as an initial guess.

Crystal-sample-instrument orientation

A 3d rendering of the experimental conditions will then be generated based on an educated guess of sample facets. The user may then change the sample facets using real or reciprocal lattice vectors.

The rendering shows the required alignment of the crystal at to fulfill the selected reflection. Users may freely rotate the rendering in three dimensional space. The rendering consists of 4 parts:

  1. The sample, annotated with the dimensions along the differnt axes.

  2. The crystal structure, shown in the orientation determined by the scattering condition and and in complience with the crystallographic axes of the sample.

  3. The beam, lens, and scattered beam.

  4. The goiniometer stage, annotated with the angles of rotation.

Example visualization showing an x-cut LiNbO$_3$ wafer, aligned on the (1,-1,2) (brightest) reflection.

Rendering the sample with realistic dimensions makes it easier to ensure that samples are positioned with the intended orientation during the experiment, and helps visualize past experiments.

Showing the crystal structure together with the sample geometry ensures that the relationship between the crystal lattice and sample geometry is correct. The rendering intentionally uses a parallel projection. This makes it easier to compare the crystal axes to the axes of the sample.

By showing the beam in the rendering, the intersection between the beam and sample can be understood. The detector image in DF-XRM is a projection of the intersection between the beam and sample, so that a rendering of this intersection is useful when inspecting DF-XRM images.

The goiniometer position is also shown. For large angles of $\phi$, such as shown here, it is advised to build a custom sample holder to hold the sample prior to the experiment. For smaller angles, the values presented in DF-XRM_vis may be directly applied to the instrument as part of the alignment procedure.

Special thanks to Dan Porter for developing https://github.com/DanPorter/Dans_Diffraction which is here used to read .cif fiels.

This work is published in the Journal of Open Source Software (JOSS)

Markdown: DOI

Owner

  • Name: Trygve Magnus Ræder
  • Login: trygvrad
  • Kind: user
  • Company: Technical University of Denmark

Marie Sklodowska-Curie fellow, Department of Physics, Nanomaterials and Devices,

JOSS Publication

Dark-field X-ray microscopy visualization
Published
April 15, 2023
Volume 8, Issue 84, Page 5177
Authors
Trygve Magnus Ræder ORCID
Department of Physics, Technical University of Denmark, Denmark
Editor
Jeff Gostick ORCID
Tags
python material science X-rays Bragg diffraction streamlit

GitHub Events

Total
  • Watch event: 1
  • Issue comment event: 2
  • Push event: 1
Last Year
  • Watch event: 1
  • Issue comment event: 2
  • Push event: 1

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 89
  • Total Committers: 2
  • Avg Commits per committer: 44.5
  • Development Distribution Score (DDS): 0.011
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
trygvrad t****d@g****m 88
Thomas White t****w@p****g 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 3
  • Total pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: 1 day
  • Total issue authors: 1
  • Total pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • trygvrad (2)
Pull Request Authors
  • trygvrad (1)
  • taw10 (1)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

requirements.txt pypi
  • Dans-Diffraction ==2.2.0
  • fpdf ==1.7.2
  • imageio ==2.19.5
  • kaleido ==0.2.1
  • matplotlib ==3.5.2
  • numpy ==1.23.1
  • pandas ==1.4.3
  • plotly ==5.9.0
  • scipy ==1.8.1
  • streamlit ==1.11.0
  • xraydb ==4.4.7
.github/workflows/draft-pdf.yml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v1 composite
  • openjournals/openjournals-draft-action master composite
.github/workflows/test_with_pytest.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite