-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test sw_egrid #130
Test sw_egrid #130
Conversation
As input I've used the 1D chain [qh 0 0] spectrum from the spinwave tests, though it might be nice to have a 2 magnetic atom system too, especially for testing the There is a bit of inconsistent behaviour with the output structure where extra fields |
Thanks for documenting these, I think I'll try and address them in this PR
I wonder if that's because those fields ( |
Looks great, it's almost here thanks!
Is there anything else you think I've missed? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #130 +/- ##
==========================================
+ Coverage 38.67% 39.23% +0.55%
==========================================
Files 239 239
Lines 15829 15837 +8
==========================================
+ Hits 6122 6213 +91
+ Misses 9707 9624 -83 ☔ View full report in Codecov by Sentry. |
Code refactor and renaming variables to make clearer bin edges and centress
Tends to blow up at zero energy and soemtimes due to floating point precision zero eignevalues are actually included in energy bins with edge at zero energy
fadc685
to
3b99137
Compare
3b99137
to
a23c6c7
Compare
a3d6153
to
b11f738
Compare
f57fb99
to
88b814a
Compare
ec2bf63
to
df2a40d
Compare
Added test for new parameter (zeroEnergyTol, previously ZeromodeThreshold) and fixed other tests by removing all intensity from bins with edge at zero
Change in behaviour - now adds max imag component of energy eig vals (ioMax) to the first energy bin edge if within ioMax of 0 (and half this to the bin center)
I think I should highlight this, it produces slightly different behaviour for Lines 468 to 476 in 40fbc1d
but I think it is an improvement on what was there before Lines 465 to 472 in df2a40d
which mis-used epsilon (now deprecated in this PR but was a tolerance for regular binning) and made ebin centers and edges inconsistent.
However, I'm not completely happy as it doesn't fix all the problems - there are still the following issues (that exist with the old code as well):
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're almost there. The changes look good. I've just got a request to fix the Px
bug. Regarding your comments about the zero energy boundary
I propose to filter out these modes 9or provide the user the option to do so) when calculating swConv but it's a case of finding a code set of criteria. I can think of the following:
- Threshold fraction of eigenvalues <1e-6 (i.e. much smaller than typical resolution in data) ?
- Such modes tend to have DSF with extremely large values ~10^7 (relative to e.g. median?)
Whatever approach we take we want to ensure we can discriminate between valid modes with v. small eigenvalues and won't mis-behave if few q-bins.
I think option 2 is better - so maybe a check for eigenvalues below some threshold and with some intensity above some threshold?
However, I'm not completely happy as it doesn't fix all the problems - there are still the following issues (that exist with the old code as well):
- If imgChk=False then there is no guarantee that the ioMax < bin width so the first bin edge could be moved beyond the second
- The energy bin edges are sorted, but this fails to account for the fact the first energy bin could be negative and span the elastic line (probably unlikely though)
Maybe if imgChk=false
we don't move the bin edges at all?
Not sure what to do about the second issue... let's see if it becomes a big problem later...
Thanks @mducle for spotting and fixing this
Don't have to uodate test as imgChk is true by default
Have added a parameter
Done, I agree I think this is good enough for now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks!
No description provided.