-
Notifications
You must be signed in to change notification settings - Fork 23
Description
TLDR:
- export fine-grained profile aligned on Δz=0.1
- option auto-align to "average" profile as well as best
- option to align on normalized thicknesses in addition to auto-alignment variants and alignment to an interface
- tutorial on contour creation from pair-wise subtraction from models fit separately
- tutorial on contour creation for wet – dry subtraction, after substituting wet thickness into the dry model
- fix default dz for DistributionExperiment
We sometimes want to see contours from a difference between sample profiles, for example to highlight water rich layers when doing H₂O – D₂O contrast measurements.
The interpretation of the profile contours is challenging. For example, a dip of fixed depth beside a layer of varying thickness will be smeared over a range of z, making the average ρ(z) over that region larger than the ρ for that layer in any of the parameter sets. Subtracted contours will be even harder to interpret. For example, comparing wet and dry samples, you not only have the changes in sld and interface, but also swelling moving the interfaces relative to each other.
For auto-aligned curves the z-offset is somewhat arbitrary. The current implementation aligns against the best fit profile for each model. Another choice would be to use the "typical" model formed from the average (or maybe median) of each of the parameters, and align each profile to that model.
Profile contours are not very good for showing thickness variation. We could have an option to replace each layer thickness with the average thickness prior to forming the profile contour. This would be an alternative to auto-alignment and aligning on a particular interface to highlight variability in [interface X sld]. The normalized thickness will reduce spurious broadening due to thickness variation. This will be helpful when subtracting profiles with contrast variation.
The current implementation uses step size Δz = 0.1 for generating profiles. This should be good enough for profile contours. Note that the Experiment object has a different dz parameter, used to control the microslab thickness in freeform and functional layers. This is unrelated to the step size for the profile contour.
We export the profile contours for each model separately. From there users can approximate the difference profile by subtracting the quantiles. It is awkward in since we use the number of steps in z to control the step size Δz, which means that z values between the profiles will have a different step size and will not align. It would be little easier if we exported the the profiles using the fine-grained profiles aligned on the Δz boundaries. That way overlapping regions will have the same z values.
It would be better to incorporate the subtraction into the contour generation. That is, we should first align the profiles for each model, then form the subtraction contour from randomly sampled pairs. When the models are fit separately this will be too complex to do within webview so it needs a tutorial example.
Profile subtraction will work for contrast variation, but it won't help with the wet – dry comparison. Maybe we could substitute the thicknesses from the wet system into the dry system before subtraction. This will be too complex to do automatically, not least because the wet and dry systems are probably fit independently. Instead, we would need a set of helper functions a tutorial example showing how to do this.
Bug: The current implementation generates the profiles with default dz=0.1, except for DistributionExperiment(), which defaults to dz=1. We should refactor so that the default dz only occurs in one place, either by using dz=None in the API and setting it to DEFAULT_DZ where it is actually used, or by using dz=DEFAULT_DZ in the API.