Skip to content

Add iSLD to converter functions#70

Merged
sstendahl merged 3 commits intomainfrom
68-add_iSLD_to_converter
Sep 5, 2023
Merged

Add iSLD to converter functions#70
sstendahl merged 3 commits intomainfrom
68-add_iSLD_to_converter

Conversation

@sstendahl
Copy link
Collaborator

@sstendahl sstendahl commented Aug 25, 2023

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.

Copy link
Owner

@jfkcooper jfkcooper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@sstendahl
Copy link
Collaborator Author

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
Copy link
Owner

perfect, resolve the conflicts and merge :)

@sstendahl sstendahl merged commit 42f95b9 into main Sep 5, 2023
sstendahl added a commit to sstendahl/HOGBEN that referenced this pull request Sep 6, 2023
sstendahl added a commit to sstendahl/HOGBEN that referenced this pull request Sep 6, 2023
@sstendahl sstendahl deleted the 68-add_iSLD_to_converter branch October 2, 2023 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants