SasView / sasmodels

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

make fractal a structure factor model (Trac #791) #130

Open pkienzle opened 5 years ago

pkienzle commented 5 years ago

Currently fractal and core_shell_fractal are implemented as P(q) * S(q), where P(q) is the sphere structure factor for fractal or the core shell sphere for core_shell_fractal and S(q) is the fractal structure factor.

Propose splitting the S(q) into its own structure factor model so that all variants of fractal clustering are supported at once.

Migrated from http://trac.sasview.org/ticket/791

{
    "status": "new",
    "changetime": "2019-03-03T00:51:52",
    "_ts": "2019-03-03 00:51:52.684322+00:00",
    "description": "Currently `fractal` and `core_shell_fractal` are implemented as `P(q) * S(q)`, where `P(q)` is the sphere structure factor for fractal or the core shell sphere for core_shell_fractal and `S(q)` is the fractal structure factor.\n\nPropose splitting the S(q) into its own structure factor model so that all variants of fractal clustering are supported at once.",
    "reporter": "pkienzle",
    "cc": "",
    "resolution": "",
    "workpackage": "SasModels Model Issues",
    "time": "2016-10-20T14:17:30",
    "component": "sasmodels",
    "summary": "make fractal a structure factor model",
    "priority": "major",
    "keywords": "",
    "milestone": "SasView 4.3.0",
    "owner": "",
    "type": "enhancement"
}
butlerpd commented 5 years ago

Trac update at 2016/10/27 16:12:32:

This can be done in two pieces -- treating the model as such in the background allows for cleaner reuse of code. PK says this has been done in his branch and should be implemented in 4.1. The second part is to present this to the user as independent structure factor. This may well be a good idea, but there is concern about how to distinguish different approaches to the fractal Sq and how users will know what to do. This requires some thinking and discussion before implementing so moving this to 4.2 for now

butlerpd commented 5 years ago

Trac update at 2018/02/13 02:43:40: butler changed milestone from "SasView 4.2.0" to "SasView 4.3.0"

butlerpd commented 5 years ago

Trac update at 2019/02/23 23:33:57: butler commented:

Closed ticket #185 which was essentially a duplicate. Some thoughts from that ticket:

Since all our fractal models are simply one of our form factors multiplied by the Teixeira Structure factor we should pull out the Teixeira fractal SQ and name it as such (i.e. teixera_fractal_sq). This distinguishes from other fractal models we may want to add. Eventually we may then want to remove the two/three existing combo fractals. 5.0 might the time to remove the old combos since that will break backward compatibility with saved projects and plugins that use the old models?

butlerpd commented 5 years ago

Trac update at 2019/03/03 00:51:52: butler changed workpackage from "SasModels New Model" to "SasModels Model Issues"

smk78 commented 5 years ago

During his last couple of days, Ziggy created both Mildner-type and Teixeira-type fractal S(q) structure factor models for Matt Hughes in the Dougan Group at Leeds.

In the process it was noted:

smk78 commented 5 years ago

I have now "cleaned up" the docstrings for both of Ziggy's fractal S(q) models and posted them both to the Marketplace as mass_fractal_sq and fractal_sq.

I have also tested that:

smk78 commented 3 years ago

User ChrisG comments "I think it would be helpful to have the Teixeira fractal structure factor as part of this menu [meaning the structure factor combobox]. Some people use this in their study of gels."

I have pointed him at the Marketplace, but maybe this issue needs bumping up in priority?

butlerpd commented 3 years ago

Agreed. In fact had planned on doing so a few times myself, but got derailed by other code camp priorities. The first part of this issue is relatively trivial and would deal with Chris' issues: create a python wrapper for the existing Teixeira S(Q) which is in C. The only question is the name: fractal or teixeira_fractal or teixeira_fractal_sq. Thinking about it I think I would argue for the simple "fractal" as I believe the Teixeira fractal is by far the most used fractal S(Q) and it is not clear if or when we might add other approaches. In which case those can be named fractal_named if and when that becomes relevant?

The other parts of this issue recommending a clean-up by removing what will then be the two obsolete sphere and core shell sphere fractal models (trying to manage the eventual overload of models would take quite a bit more finessing due to backward compatibility with project files. That should probably not impede progress on part I of this ticket.

butlerpd commented 3 years ago

More generally though there should be a ticket for allowing custom models to be recognized as structure factors. Maybe @krzywon can tell us what that issue # is 😄