Skip to content

Commit

Permalink
Fix reflection.cutoff_prune() (#90)
Browse files Browse the repository at this point in the history
* Fix normalisation in prune_cutoff

* Fix reflection tests

* Fix realworld tests

* Freeze xarray so tests pass

* Urgh.
  • Loading branch information
PeterKraus authored Feb 22, 2024
1 parent b20a4fc commit b3b4e6e
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"chemicals>=1.0.0",
"rdkit>=2022.3",
"h5netcdf~=1.0",
"xarray < 2023.11",
"xarray-datatree>=0.0.12",
"dgbowl-schemas>=116",
"matplotlib>=3.5.0",
Expand Down
2 changes: 1 addition & 1 deletion src/dgpost/transform/reflection.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def prune_cutoff(
pi = _find_peak(near, absgamma, freq)
max_v = absgamma.max()
min_v = absgamma[pi]
norm = absgamma - (min_v / (max_v / min_v))
norm = (absgamma - min_v) / (max_v - min_v)
for l in range(pi - 1):
li = pi - l
if norm[li] <= cutoff:
Expand Down
Binary file modified tests/test_realworld/ts1_reflection/ref.table.pkl
Binary file not shown.
Binary file modified tests/test_reflection/ref.fit_kajfez_0.pkl
Binary file not shown.
Binary file modified tests/test_reflection/ref.fit_kajfez_1.pkl
Binary file not shown.
Binary file modified tests/test_reflection/ref.prune_cutoff.pkl
Binary file not shown.

0 comments on commit b3b4e6e

Please sign in to comment.