Converting sample structures does not copy imaginary part of SLD
Closed this issue · 1 comments
When refl1d and refnx samples are converted, imaginary components of the SLD are lost.
In the case of refnx to refl1d, the only mention of the SLD is at line 234:
name, sld = component.name, component.sld.real.value,
Where only the real value of the sld is copied over.
Similarly, when converting refl1d to refnx, the rho
parameter is copied over. (Refl1d uses irho for the imaginary part):
name, sld = component.name, component.material.rho.value,
While it's very common to have a neglegible absorption, this makes these conversion functions unfit for samples that do absorb neutrons.
From looking quickly at the documentation, the imaginary part of the SLD can be set on initiation of the structure. So in principle adding the imaginary components is an easy task:
See the docs for refl1d) for instance: class refl1d.material.SLD(name='SLD', rho=0, irho=0)