Closed kmdalton closed 2 years ago
I think this is a reasonable request. I agree it should go in rs.algorithms
, and I think it will be important to explicitly specify the assumptions that go into this.
Personally, I don't have a use-case for this, but it seems like a reasonable place to include these equations if they are useful to careless
Does it seem prudent to give these columns a name that explicitly describes what has been done? Just so as to a) not overwrite existing columns and b) avoid confusion/misinterpretation. Call it like, I_backcalc
or I_fromF
or something snappier and equally informative.
to avoid that issue, I think we could use an API that returns a new DataSet object (similar to what we do for rs.algorithms.scale_merged_intensities()
.
@kmdalton Could you point me towards a suitable dataset for testing that contains F
/SigF
columns, or even better, contains F
/SigF
and also I
/SigI
two which they could be compared?
You could send it to me offline, or put I suppose just put it in the tests/data
directory on the intensities-clean
branch
i believe this file in tests/data/algorithms
fits the bill. As per tests/algorithms/conftest.py, it should be available to tests in the tests/algorithms
namespace under the fixture
: ref_hewl
.
Let me know if that works for you.
Ah amazing, thanks!
We have made it easy to convert intensities to structure factors using our French-Wilson implementation. However, sometimes I find myself wanting to go the other direction. This is especially useful in comparing
careless
output to other methods.I propose we provide a method for doing this conversion which takes into account uncertainties. By this I mean,
1) From the definition of variance,
I = SigF*SigF + F*F
2) From uncertainty propation,SigI = abs(2*F*SigF)
Note that 2 is only approximate, we could do better if we knew the distribution of F. For starters, we could just add this as a function in the algorithms submodule.