Opened 3 years ago

Last modified 3 years ago

#998 new defect

improve corfunc tests

Reported by: pkienzle Owned by:
Priority: major Milestone: SasView 4.3.0
Component: SasView Keywords:
Cc: Work Package: SasView Bug Fixing


Corfun tests are suppressed for now since the results are different on different machines.

Change History (3)

comment:1 Changed 3 years ago by smk78

pkienzle notes:
(The corfunc unit tests) only test that the result stays the same in the future, not that it is correct. It would be better to test against a known correct model.

I put the currently generated output in as the target value for the test.

I had trouble getting the tests to work. It turned out that the tests were loading the data as 32 bit but the application was using 64 bit floats. This had a surprisingly big impact, with the results only good to 3 digits (not the 7-8 digits of single precision), and the computed sigma being off by a factor of 5. This algorithm may have numerical stability issues.

I (later) removed the tests to corfunc that I put in … the results were too different depending on environment.

With 12 digits of accuracy stored in the file on one system, I'm getting differences in gamma1 and gamma3 after 9 digits, and idf after only 3 digits.

The sigma value was in the order of 1e-5 rather than 1e-10 for this machine. Perhaps the version of curve_fit on the first machine was returning sigma-squared rather than sigma, and this got fixed in a newer version of scipy.

comment:2 Changed 3 years ago by smk78

Test dataset ISIS_98289.TXT is from hydrated nylon, a well-studied semi-crystalline polymer. The long period returned by the Corfuc analysis (taking the default extrapolations and transforms) is ~62 A. This is consistent with the literature (see for example doi:10.1016/j.polymer.2005.09.064) but it is very difficult to say what a 'correct' value would be (because of polydispersity, crystal form, hydration, strain, etc).

A more robust test would require data from a more robust sample with better delineated paracrystalline order that could be verified by other means. Ideas welcome!

comment:3 Changed 3 years ago by butler

  • Milestone changed from SasView 4.2.0 to SasView 4.3.0
Note: See TracTickets for help on using tickets.