NeuXtalViz.config package#

Submodules#

NeuXtalViz.config.atoms module#

Static periodic-table reference data for element lookup and rendering.

This module holds plain dictionaries keyed by element symbol (plus “D” for deuterium and “XX” for an unknown/default element in colors) that back the periodic table widgets and crystal structure viewer.

Attributes#

namesdict[str, str]

Full element name for each atomic symbol, e.g. names["H"] is "Hydrogen". Used by NeuXtalViz.models.periodic_table.AtomModel to look up a human-readable name for a selected element.

isotopesdict[str, list[int]]

Mass numbers of the isotopes available for each element symbol. An empty list means no isotope data is available, which the periodic table view uses to disable selection of that element.

colorsdict[str, tuple[float, float, float]]

RGB color (each channel in the range 0-1) used to render each atom, e.g. in the crystal structure viewer.

radiidict[str, tuple[float, float, float]]

Per-element radii in angstroms, roughly ordered as (covalent, ionic/calculated, van der Waals), where a value of 0.0 indicates the radius is undefined/unavailable for that element. Only index 0 is currently used elsewhere, as the base atom rendering radius in the crystal structure viewer.

indexingdict[str, tuple[int, int]]

(row, column) position of each element in the periodic table grid layout, used to place the corresponding button widget.

groupsdict[str, str]

Element family/category name (e.g. “Alkali Metals”, “Noble Gases”) for each element symbol, used to color-code periodic table buttons by group.

NeuXtalViz.config.colormap module#

Custom “modified” Matplotlib colormap definition and registration.

Defines the custom RGB color table (blue -> green -> yellow -> red) used to build the “modified” colormap, and provides add_modified() to register it (and its reversed variant) with Matplotlib so it can be selected by name elsewhere in NeuXtalViz (e.g. volume slicing and UB tool views).

add_modified()[source]#

Register the custom ‘modified’ colormap and its reversed version.

The ‘modified’ colormap is based on the color array ‘custom’. After calling this function, ‘modified’ can be used as a colormap.

Example usage:

import matplotlib.pyplot as plt from NeuXtalViz.config.colormap import add_modified add_modified() plt.imshow(data, cmap=’modified’)

NeuXtalViz.config.instruments module#

Static per-instrument (beamline) configuration for SNS and HFIR.

Provides the beamlines dictionary consumed by the UB and experiment planning models/views to look up instrument-specific defaults such as wavelength range, detector geometry, goniometer definitions, and data file naming conventions.

Attributes#

beamlinesdict[str, dict]

Mapping of instrument key (e.g. “SNAP”, “CORELLI”, “TOPAZ”, “MANDI”, “IMAGINE”, “WAND²”, “DEMAND”) to a dictionary of settings. Common keys found in the per-instrument dictionaries:

Namestr

Short display/identifier name for the beamline.

InstrumentNamestr

Mantid instrument name, used e.g. with MaskBTP.

Facilitystr

Facility the instrument belongs to (“SNS” or “HFIR”).

Wavelengthfloat or list[float]

Incident wavelength in angstroms, or a [min, max] wavelength band for white-beam/Laue instruments.

MinDfloat

Minimum d-spacing in angstroms usable for peak indexing/search.

Groupingstr

Default detector pixel grouping/binning as a “columns x rows” string (e.g. “2x2”), parsed and passed to Mantid’s grouping algorithms.

PixelSizelist[float]

Detector pixel size in meters as [width, height].

BankPixelslist[int]

Number of pixels per detector bank as [columns, rows].

MaskEdgeslist[int]

Number of pixels to mask at each tube/bank edge as [columns, rows], to exclude noisy edge pixels.

MaskBankslist[int]

Bank numbers to mask entirely for this instrument.

MaskLostlist[list], optional

Additional bank/tube/pixel regions to mask, each entry as [bank, [tube_min, tube_max], [pixel_min, pixel_max]].

Goniometerslist[str]

Goniometer axis definitions as comma-separated strings "name,x,y,z,sense" (motor/log name and rotation axis vector components and sense), passed directly to Mantid’s SetGoniometer algorithm.

Goniometerdict[str, dict]

Named goniometer configurations (e.g. different sample environments or angle conventions) mapping each motor/log name to [x, y, z, sense, min, max]: rotation axis vector components, rotation sense, and allowed angle range in degrees.

GoniometerNamesstr

Display string of goniometer axis symbols (e.g. “ω,χ,φ”).

Motordict[str, float], optional

Default fixed motor positions (e.g. detector arc/translation or two-theta) used when planning or simulating an experiment.

RawFilestr

Template file path (relative to an IPTS directory) for the instrument’s raw event/histogram file, with a {} placeholder for the run number.

Countinglist[str]

Available run-duration counting/normalization options: a proton-charge log/PV name and/or "seconds" for time-based counting.

Titlestr

EPICS PV name providing the run/scan title, used to read or display the current run’s title.

Module contents#