Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
bcd7840
Add preferred-orientation-category ADR suggestion
AndrewSazonov Jun 11, 2026
2a83b9b
Add preferred-orientation-category implementation plan
AndrewSazonov Jun 11, 2026
76892ca
Add pref_orient preferred-orientation category
AndrewSazonov Jun 11, 2026
0e799aa
Expose preferred_orientation on Bragg powder experiment
AndrewSazonov Jun 11, 2026
2cbf607
Emit texture loop in cryspy experiment CIF
AndrewSazonov Jun 11, 2026
1457e4c
Pass preferred-orientation through cryspy cache
AndrewSazonov Jun 11, 2026
53629a3
Write preferred-orientation loop in IUCr report
AndrewSazonov Jun 11, 2026
8c61ff2
Promote preferred-orientation-category ADR to accepted
AndrewSazonov Jun 11, 2026
402a6e6
Reach Phase 1 review gate
AndrewSazonov Jun 11, 2026
fbefa3b
Scope cryspy texture emission to constant wavelength
AndrewSazonov Jun 11, 2026
41ff1e4
Bind preferred-orientation l property without noqa
AndrewSazonov Jun 11, 2026
471c42e
Rename preferred-orientation direction to index_h/k/l
AndrewSazonov Jun 11, 2026
22a4e80
Align plan and ADR with CW-only index_h/k/l wiring
AndrewSazonov Jun 11, 2026
f9b3d17
Add preferred-orientation unit tests
AndrewSazonov Jun 11, 2026
9e1f75d
Apply pixi run fix auto-fixes
AndrewSazonov Jun 11, 2026
b94ead8
Format preferred-orientation ADR and plan with prettier
AndrewSazonov Jun 11, 2026
9c6bcc7
Add LBCO preferred-orientation cross-engine verification
AndrewSazonov Jun 11, 2026
c456959
Map preferred-orientation r to cryspy g1=1/r
AndrewSazonov Jun 11, 2026
c1b8ea6
Use both March-Dollase parameters in LBCO verification
AndrewSazonov Jun 11, 2026
fca242a
Correct ADR: cryspy is March-Dollase with g1=1/r
AndrewSazonov Jun 11, 2026
2644e9f
Align march-lbco notebook titles and set fraction in create
AndrewSazonov Jun 11, 2026
cd89bca
Document cross-engine preferred-orientation parameter map
AndrewSazonov Jun 11, 2026
ce31097
Wrap _march_r_to_cryspy_g1 docstring within doc-length limit
AndrewSazonov Jun 11, 2026
aae0cdb
Refine only scale in march-lbco fit section
AndrewSazonov Jun 11, 2026
8b51f5c
Document crysfml r/fraction mapping for future PO wiring
AndrewSazonov Jun 11, 2026
16364b0
Rename pref_orient params to march_r and march_random_fract
AndrewSazonov Jun 11, 2026
d995232
Update notebook
AndrewSazonov Jun 11, 2026
6103107
Document preferred orientation in user guide and verification TOC
AndrewSazonov Jun 11, 2026
238e371
Apply docstring formatting to _march_r_to_cryspy_g1
AndrewSazonov Jun 11, 2026
67f9c9d
Refine preferred-orientation parameters in march-lbco verification
AndrewSazonov Jun 11, 2026
5a04cae
Document cryspy March-Dollase convention in march-lbco notebook
AndrewSazonov Jun 11, 2026
eda72b2
Fix ADR pass-through pseudocode to show 1/r and label matching
AndrewSazonov Jun 11, 2026
aa72202
Update plan create example to march_r/march_random_fract
AndrewSazonov Jun 11, 2026
7cec05a
Add preferred-orientation CIF round-trip test
AndrewSazonov Jun 11, 2026
680fdea
Align plan Phase 2 wording with final verification behaviour
AndrewSazonov Jun 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
577 changes: 577 additions & 0 deletions docs/dev/adrs/accepted/preferred-orientation-category.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/dev/adrs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ folders.
| Experiment model | Accepted | Immutable Experiment Type | Makes experiment type axes creation-time state rather than mutable runtime state. | [`immutable-experiment-type.md`](accepted/immutable-experiment-type.md) |
| Experiment model | Accepted | Automatic Line-Segment Background Estimation | Detects line-segment background control points from the measured pattern, peak-insensitive and editable. | [`background-auto-estimate.md`](accepted/background-auto-estimate.md) |
| Experiment model | Accepted | Calculation Without Measured Data | Adds a writable `data_range` category so a structure-only experiment is calculable and plottable without loaded data. | [`calculation-without-measured-data.md`](accepted/calculation-without-measured-data.md) |
| Experiment model | Accepted | Preferred-Orientation Category | Adds a per-phase March–Dollase preferred-orientation category for textured powder refinement on the CrysPy backend. | [`preferred-orientation-category.md`](accepted/preferred-orientation-category.md) |
| Factories | Accepted | Factory Contracts and Metadata | Standardizes factory construction, metadata, compatibility, and registration behavior. | [`factory-contracts.md`](accepted/factory-contracts.md) |
| Naming | Accepted | Factory Tag Naming | Defines canonical factory tag style and standard abbreviations. | [`factory-tag-naming.md`](accepted/factory-tag-naming.md) |
| Persistence | Accepted | Free-Flag CIF Encoding | Encodes fit free/fixed state through CIF uncertainty syntax instead of a separate free list. | [`free-flag-cif-encoding.md`](accepted/free-flag-cif-encoding.md) |
Expand Down
7 changes: 7 additions & 0 deletions docs/dev/package-structure/full.md
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,13 @@
│ │ │ │ │ └── 🏷️ class TotalGaussianDampedSinc
│ │ │ │ └── 📄 total_mixins.py
│ │ │ │ └── 🏷️ class TotalBroadeningMixin
│ │ │ ├── 📁 pref_orient
│ │ │ │ ├── 📄 __init__.py
│ │ │ │ ├── 📄 default.py
│ │ │ │ │ ├── 🏷️ class PrefOrient
│ │ │ │ │ └── 🏷️ class PrefOrients
│ │ │ │ └── 📄 factory.py
│ │ │ │ └── 🏷️ class PrefOrientFactory
│ │ │ ├── 📁 refln
│ │ │ │ ├── 📄 __init__.py
│ │ │ │ ├── 📄 bragg_pd.py
Expand Down
4 changes: 4 additions & 0 deletions docs/dev/package-structure/short.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@
│ │ │ │ ├── 📄 tof_mixins.py
│ │ │ │ ├── 📄 total.py
│ │ │ │ └── 📄 total_mixins.py
│ │ │ ├── 📁 pref_orient
│ │ │ │ ├── 📄 __init__.py
│ │ │ │ ├── 📄 default.py
│ │ │ │ └── 📄 factory.py
│ │ │ ├── 📁 refln
│ │ │ │ ├── 📄 __init__.py
│ │ │ │ ├── 📄 bragg_pd.py
Expand Down
311 changes: 311 additions & 0 deletions docs/dev/plans/preferred-orientation-category.md

Large diffs are not rendered by default.

23 changes: 22 additions & 1 deletion docs/docs/user-guide/analysis-workflow/experiment.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,28 @@ project.experiments['hrpt'].background.auto_estimate(n_points=10)
project.experiments['hrpt'].linked_phases.create(id='lbco', scale=10.0)
```

### 6. Measured Data Category { #measured-data-category }
### 6. Preferred Orientation Category { #preferred-orientation-category }

For textured powders, add a March–Dollase preferred-orientation
correction per phase. Set the March coefficient `march_r` (1 = no
texture, <1 platy/disk, >1 needle), the texture direction
(`index_h`, `index_k`, `index_l`), and optionally the random untextured
fraction `march_random_fract`:

```python
# Add a March–Dollase preferred-orientation correction for a phase
project.experiments['hrpt'].preferred_orientation.create(
phase_id='lbco', march_r=1.2, index_h=0, index_k=0, index_l=1
)
```

This is a constant-wavelength Bragg powder correction, available on the
`cryspy` engine. The defaults (`march_r=1`, `march_random_fract=0`)
apply no texture, so it has no effect until you set them. See the
[preferred-orientation parameters](../parameters/pref_orient.md) for
details.

### 7. Measured Data Category { #measured-data-category }

If you do not have a CIF file for your experiment, you can load measured
data from a file in a supported format. The measured data will be
Expand Down
11 changes: 11 additions & 0 deletions docs/docs/user-guide/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ EasyDiffraction.
| | :material-format-superscript: [order][background] | background.order |
| | :material-arrow-collapse-up: [coef][background] | background.coef |
| :material-puzzle: [linked_phases][linked_phases] | :material-scale: [scale][linked_phases] | linked_phases['ID'].scale |
| :material-compass-outline: [pref_orient][pref_orient] | :material-chart-bell-curve-cumulative: [march_r][pref_orient] | preferred_orientation['ID'].march_r |
| | :material-shuffle-variant: [march_random_fract][pref_orient] | preferred_orientation['ID'].march_random_fract |
| | :material-axis-arrow: [index_h][pref_orient] | preferred_orientation['ID'].index_h |
| | :material-axis-arrow: [index_k][pref_orient] | preferred_orientation['ID'].index_k |
| | :material-axis-arrow: [index_l][pref_orient] | preferred_orientation['ID'].index_l |

=== "CIF name for serialization"

Expand All @@ -186,6 +191,11 @@ EasyDiffraction.
| | :material-format-superscript: [order][background] | \_pd_background.chebyshev_order | [pdCIF][0]{:.label-cif} |
| | :material-arrow-collapse-up: [coef][background] | \_pd_background.chebyshev_coef | [pdCIF][0]{:.label-cif} |
| :material-puzzle: [linked_phases][linked_phases] | :material-scale: [scale][linked_phases] | \_pd_phase_block.scale | [pdCIF][0]{:.label-cif} |
| :material-compass-outline: [pref_orient][pref_orient] | :material-chart-bell-curve-cumulative: [march_r][pref_orient] | \_pref_orient.march_r | [easydiffractionCIF][0]{:.label-cif} |
| | :material-shuffle-variant: [march_random_fract][pref_orient] | \_pref_orient.march_random_fract | [easydiffractionCIF][0]{:.label-cif} |
| | :material-axis-arrow: [index_h][pref_orient] | \_pref_orient.index_h | [easydiffractionCIF][0]{:.label-cif} |
| | :material-axis-arrow: [index_k][pref_orient] | \_pref_orient.index_k | [easydiffractionCIF][0]{:.label-cif} |
| | :material-axis-arrow: [index_l][pref_orient] | \_pref_orient.index_l | [easydiffractionCIF][0]{:.label-cif} |

[pd-neut-cwl][3]{:.label-experiment} [pd-xray][3]{:.label-experiment}

Expand Down Expand Up @@ -289,4 +299,5 @@ EasyDiffraction.
[peak]: parameters/peak.md
[background]: parameters/background.md
[linked_phases]: parameters/linked_phases.md
[pref_orient]: parameters/pref_orient.md
<!-- prettier-ignore-end -->
55 changes: 55 additions & 0 deletions docs/docs/user-guide/parameters/pref_orient.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
[pdCIF][2]{:.label-cif}

# \_pref_orient

Per-phase **preferred-orientation** (texture) correction using the
March–Dollase model. Powder samples whose crystallites pack with a
preferred orientation (platy crystals lying flat, needles aligning) show
Bragg intensities that deviate from the ideal random-powder average;
this correction restores them.

Each row corrects one linked phase along one crystallographic direction.
The defaults (`march_r = 1`, `march_random_fract = 0`) are a
mathematical no-op, so a freshly added row applies no texture until you
change them. Supported on the **CrysPy** engine for constant-wavelength
Bragg powder experiments.

See the
[IUCr powder dictionary](https://www.iucr.org/resources/cif/dictionaries/browse/cif_pd)
(`pd_pref_orient_March_Dollase`) for the standard data names.

## \_pref_orient.phase_id

Identifier of the linked phase corrected by this row.

## \_pref_orient.march_r

March coefficient `r`. `r = 1` means no preferred orientation; `r < 1`
describes disk-/plate-like crystallites and `r > 1` needle-like ones.
This is the standard IUCr/FullProf/GSAS coefficient (serialised as
`_pd_pref_orient_March_Dollase.r`); the CrysPy backend stores its
reciprocal internally.

## \_pref_orient.index_h

Texture-axis Miller index _h_.

## \_pref_orient.index_k

Texture-axis Miller index _k_.

## \_pref_orient.index_l

Texture-axis Miller index _l_.

## \_pref_orient.march_random_fract

Random (untextured) fraction of crystallites; `0` is pure March–Dollase.
There is no IUCr standard name for this quantity, so it is serialised
under the EasyDiffraction custom dictionary.

<!-- prettier-ignore-start -->
[0]: #
[1]: https://www.iucr.org/resources/cif/dictionaries/browse/cif_core
[2]: https://www.iucr.org/resources/cif/dictionaries/browse/cif_pd
<!-- prettier-ignore-end -->
Loading
Loading