API#

The complete public API is auto-generated from docstrings by sphinx-autoapi. The package is pure Python with a single runtime dependency: NumPy.

Foundation

Core constants, rotation mathematics, and display formatting.

constants · rotation · display

constants
Geometry Primitives

Axis parsing and individual rotation stages.

axes · stage

stage
Crystallography

Lattice, reflections, sample, and radiation source.

lattice · reflection · sample · radiation

lattice
Diffractometer

Geometry class, diffraction modes, and predefined geometry factories.

diffractometer · mode · factories

diffractometer
Calculations

Orientation, forward problem, Q/energy conversions, trajectories, surface diffraction, and lattice refinement.

orientation · forward · conversions · surface · scan · refinement

orientation
Full Module Index

Every public module, class, function, and constant, auto-generated from source docstrings.

ad_hoc_diffractometer

Module Dependency Graph#

The diagram below shows how the source modules depend on each other. Arrows point from a module to the modules it imports. Modules are grouped by layer.

digraph deps {
    graph [rankdir=TB, fontname="sans-serif", fontsize=11,
           bgcolor="transparent", splines=ortho, nodesep=0.4, ranksep=0.6]
    node  [shape=box, style="rounded,filled", fontname="sans-serif",
           fontsize=10, margin="0.15,0.08"]
    edge  [color="#555555", arrowsize=0.7]

    // ── Foundation (grey) ──────────────────────────────────
    subgraph cluster_foundation {
        label="Foundation"
        style=filled fillcolor="#f0f0f0" color="#aaaaaa"
        fontname="sans-serif" fontsize=11
        constants [label="constants" fillcolor="#e0e0e0"]
        rotation  [label="rotation"  fillcolor="#e0e0e0"]
        display   [label="display"   fillcolor="#e0e0e0"]
    }

    // ── Geometry primitives (blue) ──────────────────────────
    subgraph cluster_primitives {
        label="Geometry Primitives"
        style=filled fillcolor="#ddeeff" color="#6699cc"
        fontname="sans-serif" fontsize=11
        axes  [label="axes"  fillcolor="#c8dff8"]
        stage [label="stage" fillcolor="#c8dff8"]
    }

    // ── Crystallography (green) ─────────────────────────────
    subgraph cluster_crystal {
        label="Crystallography"
        style=filled fillcolor="#ddf0dd" color="#66aa66"
        fontname="sans-serif" fontsize=11
        lattice    [label="lattice"    fillcolor="#c0e8c0"]
        reflection [label="reflection" fillcolor="#c0e8c0"]
        sample     [label="sample"     fillcolor="#c0e8c0"]
        radiation  [label="radiation"  fillcolor="#c0e8c0"]
    }

    // ── Diffractometer (amber) ──────────────────────────────
    subgraph cluster_diffractometer {
        label="Diffractometer"
        style=filled fillcolor="#fff3cc" color="#ccaa00"
        fontname="sans-serif" fontsize=11
        mode      [label="mode"      fillcolor="#ffe999"]
         diffractometer [label="diffractometer" fillcolor="#ffe999"]
        factories [label="factories" fillcolor="#ffe999"]
    }

    // ── Calculations (orange) ───────────────────────────────
    subgraph cluster_calculations {
        label="Calculations"
        style=filled fillcolor="#ffe8d6" color="#cc7733"
        fontname="sans-serif" fontsize=11
        orientation [label="orientation" fillcolor="#ffd0b0"]
        forward     [label="forward"     fillcolor="#ffd0b0"]
        conversions [label="conversions" fillcolor="#ffd0b0"]
        surface     [label="surface"     fillcolor="#ffd0b0"]
        scan        [label="scan"        fillcolor="#ffd0b0"]
        refinement  [label="refinement"  fillcolor="#ffd0b0"]
    }

    // ── Edges ───────────────────────────────────────────────
    // Foundation
    axes -> constants
    stage -> rotation

    // Crystallography
    lattice    -> display
    reflection -> display
    sample     -> lattice
    sample     -> reflection

    // Diffractometer
     diffractometer -> axes         [style=dashed]
     diffractometer -> constants
     diffractometer -> display      [style=dashed]
     diffractometer -> forward      [style=dashed]
     diffractometer -> lattice      [style=dashed]
     diffractometer -> mode         [style=dashed]
     diffractometer -> orientation  [style=dashed]
     diffractometer -> radiation    [style=dashed]
     diffractometer -> reflection
     diffractometer -> rotation     [style=dashed]
     diffractometer -> sample       [style=dashed]
     diffractometer -> stage        [style=dashed]
     diffractometer -> surface      [style=dashed]
     factories -> axes
     factories -> constants
     factories -> diffractometer
     factories -> mode
     factories -> stage

    // Calculations
    orientation -> reflection
    orientation -> rotation
    orientation -> stage
     forward     -> display    [style=dashed]
      forward     -> diffractometer  [style=dashed]
     forward     -> mode
     forward     -> orientation
     conversions -> sample
     surface     -> diffractometer  [style=dashed]
     scan        -> diffractometer  [style=dashed]
    scan        -> rotation
    refinement  -> lattice
    refinement  -> orientation
    refinement  -> reflection
    refinement  -> rotation
}

ad_hoc_diffractometer module dependencies#

Note

Dashed arrows indicate that the import is deferred (inside a function body or guarded by TYPE_CHECKING) to avoid circular imports.

Full Module Reference#