Skip to content

Match phase data and apply a chosen origin shift - #358

Draft
tjlane wants to merge 1 commit into
codex/phase-alignment-07-origin-rankingfrom
codex/phase-alignment-08-phase-data
Draft

Match phase data and apply a chosen origin shift#358
tjlane wants to merge 1 commit into
codex/phase-alignment-07-origin-rankingfrom
codex/phase-alignment-08-phase-data

Conversation

@tjlane

@tjlane tjlane commented Aug 22, 2026

Copy link
Copy Markdown
Member

! This PR was vibe-coded.

Stack

Part 8 of 11 for #31. Depends on #357. Merge bottom-up.

Next branch: codex/phase-alignment-09-align-api.

What this implements

Adds the DataSet boundary for phase alignment: phase-column validation, common-HKL matching independent of row order, amplitude or intensity-derived weights, optional FOM factors, and application of a Phenix-sign origin shift to a copied dataset.

Phase MTZ dtypes are restored after transformation, complex columns receive the same phase multiplier, and inputs are not mutated.

Tests

Direct tests cover HKL matching, amplitude-product weights, intensity equivalence, minimum finite overlap, Phase dtype restoration, and the documented Phenix sign convention.

Reviewer focus

  • Matching by Miller index rather than row position.
  • Weight normalization and intensity-to-amplitude conversion.
  • Consistent transformation of every Phase and complex column without mutating inputs.

Related: #31 and #174.

@tjlane tjlane changed the title Add phase matching and origin application Match phase data and apply a chosen origin shift Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant