jfkcooper / HOGBEN

Experimental design in neutron reflectometry using the Fisher information.
BSD 3-Clause "New" or "Revised" License
6 stars 2 forks source link

Add iSLD to converter functions #70

Closed sstendahl closed 1 year ago

sstendahl commented 1 year ago

Closes issue #68.

Adds the imaginary part of the SLD to the to_refnx and to_refl1d functions, such that this component is properly transferred over as well. For the refnx syntax, see the docs: https://refnx.readthedocs.io/en/latest/refnx.reflect.html#refnx.reflect.SLD

Where the parameters have to be added as argument as a Parameter type:

>>> re = Parameter(3.47)
>>> im = Parameter(0.01)
>>> sio2 = SLD([re, im])

In this particular case, refl1d syntax is actually pretty straightforward. These changes in this method have been tested with the unit tests in PR #69.

sstendahl commented 1 year ago

Just to check, if there is no iSLD, this behaves as it did before? I think it does but wanted to check

I just double-checked, if you create a refnx sample without specifiying the iSLD, it sets it equal to zero on init. Same with refl1d samples and irho. So short answer, yes. It will just copy the zero value from the iSLD in refnx to the irho value in refl1d sample.

In the old case, it would assign zero upon init. So the end-result is the same in the case of an unassigned iSLD.

jfkcooper commented 1 year ago

perfect, resolve the conflicts and merge :)