SasView / sasmodels

Package for calculation of small angle scattering models using OpenCL.
BSD 3-Clause "New" or "Revised" License
16 stars 28 forks source link

explore/realspace.py cleanup #505

Closed pkienzle closed 2 years ago

pkienzle commented 2 years ago

Some code cleanup on explore/realspace.py with minor reformatting and removing deprecated functions.

This code is not part of the sasmodels library or the sasview application. Its purpose is to validate analytical models with Monte Carlo sampling on real-space models.

To see options for running the code type:

$ python explore/realspace.py --help

The Pr curve should match the analytic curve but the normalization is wrong so it is shifted. The Iq_avg curve is only valid for radially symmetric samples, so in general it will not match.

lucas-wilkins commented 2 years ago

The only things that really require change is import of Tuple, and the removing the parameterisation on ndarray

pkienzle commented 2 years ago

@dehoni I modified the magnetic calculations a bit to use the numpy @ operator instead of dot. I also simplified the code for orth. I compared it to a magnetic sphere model and it still seems to produce the same results as the analytic calculation so I probably didn't break anything, but you might want to check the code.

wpotrzebowski commented 2 years ago

@dehoni can you check please if it is ok now?

wpotrzebowski commented 2 years ago

@dehoni will take a quick look and we hopefully can merge it

dehoni commented 2 years ago

Sorry, my bad, I did not find the box to approve the changes...