Repository navigation
Python API: single-crystal Fourier and pair distribution function - #35
Merged
Merged
Conversation
- diffuse.fourier(): intensities on a line or plane in reciprocal space (corners ll/lr/ul as in DISCUS), radiation, wavelength, ADPs, and subtract_average to leave the diffuse scattering. FourierMap holds the intensities, their (h, k, l) and an image/line plot with a sensible log dynamic range. - diffuse.pdf(): G(r) for a periodic crystal or a finite particle, with Qmax termination, Qdamp/Qbroad, thermal broadening and correlated-motion corrections. PDFPattern with plot(). - Fix: DISCUS's cd changed the working directory of the whole Python process; Session.run() now restores the caller's. - Tests (tests/python/test_fourier_pdf.py): PDF identical to the legacy .grcalc references, Fourier line/plane vs legacy RESULTS and golden data, map orientation, finite particles, option checks, plots; new golden data. - Gallery: fourier_demo.py (anatase hk0, diffuse scattering of a Cu/Au layer with short-range order) and pdf_demo.py (nickel termination effects, anatase X-ray vs neutron). API docs, README and WP0 log updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018Yw8KkfPLawp8Po4f5Bc9v
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018Yw8KkfPLawp8Po4f5Bc9v
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merges into
claude-python-app(notmaster).What this adds
diffuse.fourier(): single-crystal intensities on a line or plane in reciprocal space (cornersll/lr/ulas in DISCUS). Options: radiation, wavelength, ADPs, andsubtract_average(100 leaves the diffuse scattering). Returns aFourierMapwith the intensities, the (h, k, l) of every point, and an image/line plot with a sensible log dynamic range.diffuse.pdf(): G(r) for a periodic crystal or a finite particle (particle_diameter), with Qmax termination, Qdamp/Qbroad, thermal broadening and correlated-motion corrections. Returns aPDFPatternwithplot().fourier_demo.py(anatase hk0 map; diffuse scattering of a Cu/Au layer with short-range order) andpdf_demo.py(nickel termination effects; anatase X-ray vs neutron).cdchanged the working directory of the whole Python process, so relative paths in a user's script broke after anydiffusecall.Session.run()now restores the caller's directory.CLAUDE.md: pull requests targetclaude-python-app, nevermaster.How it was checked
pdf()vs legacy03.Pair_Distribution_Function/*.grcalc(histogram, thermal, Qmax 30, Qdamp 0.02)fourier()line vs02.Calculation_Scattering/RESULTS/1d.intefourier()plane vs golden02.2dLocally:
pytest tests/python39 passed (33 legacy macro tests skipped withoutDISCUS_SUITE); Sphinx docs build with-Wclean, three gallery examples.Note: the PDF reference files were made from
water_hex.cell(oxygen only), althoughpdf.mac's plot titles say nickel.Suggested in-depth testing
pdf_nano.mac(needs a structure already cut to a sphere).subtract_averageon your own disordered models.Generated by Claude Code