odf¶
nrxrdct.texture.odf ¶
Pole-figure extraction for texture tomography.
This is the texture-tomography analogue of :mod:nrxrdct.xrdct.sinogram:
instead of assembling a powder (2theta) sinogram, it extracts azimuthal
(chi) intensity profiles around a chosen hkl Debye-Scherrer ring from
cake-integrated diffraction images acquired by the same XRD-CT scan
(:class:nrxrdct.xrdct.parameters.Scan, :mod:nrxrdct.azimuthal.integration),
and converts scan geometry (2theta, chi, sample rotation) into pole-figure
coordinates on the sample's orientation sphere.
This module stops at pole-figure data: it does not invert pole figures into
an orientation distribution function (ODF). The output is the per-scan-
position raw material an ODF inversion (harmonic series, WIMV, ...) would
consume, analogous to how :func:nrxrdct.xrdct.sinogram.assemble_sinogram
produces the sinogram that :func:nrxrdct.xrdct.reconstruction.reconstruct_slice
later consumes.
Diffraction geometry convention¶
:func:pole_figure_coordinates assumes a single vertical rotation axis
(the XRD-CT rot motor) and a horizontal incident beam, with the
azimuthal (chi) angle of :func:~nrxrdct.azimuthal.integration.cake_integration
measured from the vertical (rotation-axis) direction on the detector,
increasing towards the horizontal direction. Beamlines differ in where
chi=0 points and which way it increases; use chi_offset_deg and
chi_sign to align the convention with your setup before trusting the
resulting pole-figure angles.
As a concrete data point (not a substitute for calibrating your own setup):
pyFAI's own azimuthal-angle convention (AzimuthalIntegrator.chiArray /
the azimuthal axis returned by :func:~nrxrdct.azimuthal.integration.cake_integration)
was verified empirically to be chi = atan2(row_offset, col_offset) relative
to the detector's beam-center pixel — i.e. chi=0 along the horizontal
(column) detector axis, not vertical as this module's derivation assumes by
default. A chi_offset_deg of roughly 90 (sign depending on your detector's
row/column handedness) is therefore a more likely starting point than 0 for
data straight out of cake_integration — but detector rotation/flip flags
can shift this per beamline, so verify rather than assume.
assemble_pole_figure_data ¶
assemble_pole_figure_data(master_file: Path, output_file: Path, poni_file: Path, mask_file: Path, tth_range: Tuple[float, float], hkl_label: str, background_ranges: Optional[Tuple[Tuple[float, float], Tuple[float, float]]] = None, npt_rad: int = 1000, npt_azim: int = 360, n_workers: int = 16, camera_name: str = 'eiger', monitor_name: str = 'fpico6', translation_motor: str = 'dty', rotation_motor: str = 'rot') -> None
Extract per-frame pole-figure (chi-intensity) profiles for one hkl ring from a raw XRD-CT master file, in parallel.
Mirrors :func:nrxrdct.azimuthal.integration.integrate_powder_parallel
(same master-file layout, entry validation, and monitor normalisation) but
cake-integrates each frame and reduces it to an azimuthal intensity
profile via :func:extract_ring_intensity, instead of a 1-D powder
pattern. Results are appended to output_file under
pole_figures/<hkl_label>/scan_XXXX; scans already present are skipped,
so a failed run can be resumed by calling this function again.
| Parameters: |
|
|---|
Source code in src/nrxrdct/texture/odf.py
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 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 | |
assemble_pole_figure_sinogram ¶
assemble_pole_figure_sinogram(pole_figure_file: Path, hkl_label: str, n_rot: int, translation_motor: str = 'dty', rotation_motor: str = 'rot') -> Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]
Stack per-scan pole-figure profiles written by :func:assemble_pole_figure_data
into a texture-tomography sinogram.
Mirrors :func:nrxrdct.xrdct.sinogram.assemble_sinogram: scans are sorted by
the recorded translation_motor value (not file order, for the same reason
documented there) and zero-padded along the rotation axis to n_rot.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in src/nrxrdct/texture/odf.py
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 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 | |
extract_ring_intensity ¶
extract_ring_intensity(cake: ndarray, radial: ndarray, azimuthal: ndarray, tth_range: Tuple[float, float], background_ranges: Optional[Tuple[Tuple[float, float], Tuple[float, float]]] = None) -> Tuple[np.ndarray, np.ndarray]
Extract the azimuthal (chi) intensity profile of one hkl ring from a cake-integrated image.
| Parameters: |
|
|---|
| Returns: |
|
|---|
| Raises: |
|
|---|
Source code in src/nrxrdct/texture/odf.py
pole_figure_coordinates ¶
pole_figure_coordinates(tth_deg, chi_deg, omega_deg, chi_offset_deg: float = 0.0, chi_sign: float = 1.0) -> Tuple[np.ndarray, np.ndarray]
Convert diffraction-geometry angles into pole-figure coordinates.
Assumes a vertical rotation axis, a horizontal incident beam, and chi
measured from the vertical (rotation-axis) direction as described in this
module's docstring. tth_deg, chi_deg, and omega_deg may be scalars or
arrays that broadcast together (e.g. a 1-D chi_deg array combined with a
scalar omega_deg for one frame, or a 2-D grid built from
np.meshgrid(chi_deg, omega_deg) for a full scan).
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in src/nrxrdct/texture/odf.py
sinogram_to_pole_figure ¶
sinogram_to_pole_figure(sino: ndarray, azimuthal: ndarray, rot_deg: ndarray, tth_deg: float, line_index: Optional[int] = None, chi_offset_deg: float = 0.0, chi_sign: float = 1.0) -> Tuple[np.ndarray, np.ndarray, np.ndarray]
Convert a pole-figure sinogram into flat pole-figure coordinates, ready for
:func:nrxrdct.texture.odf_inversion.compute_odf.
Applies :func:pole_figure_coordinates to every (chi, rot) grid point
of sino and flattens the result — the direct bridge between
:func:assemble_pole_figure_sinogram's output and the bulk ODF fit.
| Parameters: |
|
|---|
| Returns: |
|
|---|