Skip to content

nitad54448/indexMan

Repository files navigation

IndexMan - HKL Pattern Simulator

IndexMan is a lightweight, browser-based tool for simulating X-ray Diffraction (XRD) powder patterns. It calculates theoretical reflection positions (HKL indices) based on Space Group symmetry and Unit Cell parameters, allowing for direct comparison with experimental data. Various settings for the space groups can be selected, it is designed mostly for teaching.

Created by NitaD (Univ Paris-Saclay).

Features

  • Space Group Support: * Supports all 230 space groups.
    • Handles various settings (e.g., Monoclinic unique axis a, b, or c; Hexagonal settings).
    • Automatically applies extinction rules (Centering, Glide planes, Screw axes) to filter forbidden reflections.
  • Dynamic Parameter Input: * Input fields automatically adjust based on the Crystal System (e.g., a=b=c for Cubic, γ=120° for Hexagonal).
    • Real-time validation of lattice parameters.
  • Wavelength Control: * Presets for common anode materials: Cu, Mo, Co, Fe, Cr.
    • Option to split $K\alpha_1$ and $K\alpha_2$ peaks.
    • Custom monochromatic wavelength input.
  • Interactive Visualization:
    • Responsive Chart.js plotting.
    • Zoom & Pan: Mouse wheel to zoom, click-and-drag to pan (Right-click to reset).
    • Tooltip details for every reflection (h, k, l, d-spacing).
  • Experimental Data Import: * Overlay experimental patterns for indexing and comparison.
    • Supported formats: .xy, .csv, .txt, .xrdml, .brml, .ras, .esd, .std, .udf, .xra, .gsa, .dat, .asc.
  • Export: Save the calculated HKL list (including d-spacing and 2$\theta$ positions) to a text file.

How to use

Prerequisites

This is a client-side application using HTML5 and JavaScript. It can be used directly at the link provided or, if you copy all the repo, it can be run on your computer. In this case, because it fetches a local JSON database for Space Groups, you likely need to run a local web server to avoid CORS (Cross-Origin Resource Sharing) errors typical when opening files directly via file://.

Installation

  1. Clone the repository (or download the files):

    • IndexMan.html (The main application)
    • space_groups_all_settings.json (Required database file)
  2. Directory Structure:

    /Project-Folder
    ├── IndexMan.html
    ├── space_groups_all_settings.json
    └── README.md
    

How to Run

Option A: VS Code (Recommended)

  1. Open the folder in Visual Studio Code.
  2. Install the "Live Server" extension.
  3. Right-click IndexMan.html and select "Open with Live Server".

Option B: Python

  1. Open your terminal/command prompt in the project folder.
  2. Run: python -m http.server
  3. Open your browser and go to http://localhost:8000/IndexMan.html.

Supported File Formats

IndexMan includes a parser capable of reading various proprietary and generic XRD formats:

Format Extension(s) Notes
Generic ASCII .xy, .csv, .txt, .dat XY columns (2Theta, Intensity)
Panalytical .xrdml XML-based format
Bruker .brml, .rasx XML-based format
Rigaku .ras Standard ASCII format
GSAS/Expgui .esd, .std, .xra Standard banks
Bruker/Siemens .uxd User Exchange Data
Philips .udf UDF Data

Built With

  • HTML5 / CSS3: Uses CSS Variables for theming (Inter font).
  • JavaScript (ES6): Vanilla JS logic for crystallography math.
  • Chart.js: For rendering the diffraction pattern.
  • Hammer.js: For gesture recognition.
  • Chart.js Plugin Zoom: For zooming and panning capabilities.

Logic

  1. Canonicalization: The simulation maps input indices ($hkl$) to their canonical form based on the Laue Class of the selected space group.
  2. d-spacing Calculation: Calculates $1/d^2$ using the specific quadratic form for the crystal system (Triclinic through Cubic).
  3. Bragg's Law: Converts d-spacing to 2$\theta$ positions based on the selected wavelength ($\lambda = 2d\sin\theta$).
  4. Extinction Conditions: Checks specific reflection conditions (e.g., h+k=2n for C-centering) defined in the JSON database to filter out systematically absent reflections.

License

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.

Creative Commons License

About

generate and index unit cells

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages