odf_inversion¶
nrxrdct.texture.odf_inversion ¶
ODF inversion from pole-figure data (WIMV method).
Inverts one or more pole figures (from :mod:nrxrdct.texture.odf) into a
discretised orientation distribution function (ODF) on a grid of Bunge Euler
angles, using the WIMV algorithm (Matthies & Vinel, 1982): an iterative,
multiplicative correction scheme that is the standard choice in texture
analysis whenever pole-figure coverage is incomplete, because it degrades
gracefully over uncovered regions and — unlike a literal generalised
spherical-harmonic fit — guarantees a non-negative ODF by construction.
This is the natural next step after single-rotation-axis pole-figure
extraction: a fixed vertical rotation axis with no tilt only ever sweeps a
curve on the pole sphere per hkl (see the coverage caveat in
:mod:nrxrdct.texture.odf), so pole-figure coverage here is inherently
incomplete — the reason WIMV rather than the harmonic method is used.
Orientation convention¶
Orientations are represented as rotation matrices mapping a crystal-frame
vector to the sample frame, v_sample = R @ v_crystal, parametrised by
Bunge-style Euler angles (phi1, Phi, phi2) via
R(phi1, Phi, phi2) = Rz(phi1) @ Rx(Phi) @ Rz(phi2)
This is one of several conventions in use across texture software (Bunge, Roe, Kocks differ, and even "Bunge" implementations disagree on axis order and active/passive sense) — verify against your reference before comparing Euler angles quantitatively with another package.
Crystal directions passed to :func:compute_odf must already be unit
vectors in an orthonormal crystal Cartesian frame (this module does not
parse lattice parameters); for a cubic crystal, [h, k, l] normalised is
sufficient, otherwise apply your crystal's B-matrix first.
compute_odf ¶
compute_odf(pole_figures: Dict[str, Tuple[ndarray, ndarray, ndarray]], crystal_directions: Dict[str, ndarray], step_deg: float = 10.0, n_iter: int = 10, fold_hemisphere: bool = False, chunk_size: int = 4096) -> dict
Invert pole-figure data into a discretised ODF via WIMV.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in src/nrxrdct/texture/odf_inversion.py
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 | |
load_pole_figures ¶
load_pole_figures(pole_figure_file: Path, hkl_labels: Sequence[str], n_rot: int, line_index: Optional[int] = None, translation_motor: str = 'dty', rotation_motor: str = 'rot', chi_offset_deg: float = 0.0, chi_sign: float = 1.0, clip_negative: bool = True) -> Dict[str, Tuple[np.ndarray, np.ndarray, np.ndarray]]
Build the pole_figures dict :func:compute_odf expects, directly from
a merged pole-figure HDF5 file.
For each hkl, assembles the pole-figure sinogram
(:func:~nrxrdct.texture.odf.assemble_pole_figure_sinogram), reads its
stored 2theta window, and converts it to flat pole-figure coordinates
(:func:~nrxrdct.texture.odf.sinogram_to_pole_figure) — the glue between
a file written by :func:~nrxrdct.texture.odf.assemble_pole_figure_data /
:mod:nrxrdct.texture.slurm_pole_figures and :func:compute_odf.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in src/nrxrdct/texture/odf_inversion.py
misorientation_angle_deg ¶
Angle (degrees) of the relative rotation between two orientation matrices.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in src/nrxrdct/texture/odf_inversion.py
orientation_grid ¶
Build a regular grid of orientations in Bunge Euler space.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in src/nrxrdct/texture/odf_inversion.py
recalculate_pole_figure ¶
recalculate_pole_figure(odf_result: dict, crystal_direction: ndarray, alpha_deg: ndarray, beta_deg: ndarray, fold_hemisphere: bool = False) -> np.ndarray
Forward-project the fitted ODF back onto pole-figure coordinates, for comparison against the original measured pole figure (quality check).
| Parameters: |
|
|---|
| Returns: |
|
|---|