Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions doc/examples/profile/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

def nuc(z, period, phase):
"""Nuclear profile"""
# print("nuc", period, phase, z)
return sin(2 * pi * (z / period + phase))


Expand All @@ -58,7 +59,8 @@ def mag(z, z1, z2, M1, M2, M3):
$re^{kz_2} = M_2$, and $a,b$ are set such that $az_2 + b = M_2$
and $az_{\rm end} + b = M_3$.
"""
# Make sure z1 > z2, swapping if they are different. Note that in the

# print("mag", z1, z2, M1, M2, M3, z)
# posterior probability this will set P(z1, z2)=P(z2, z1) always.
if z1 > z2:
z1, z2 = z2, z1
Expand Down Expand Up @@ -91,11 +93,10 @@ def mag(z, z1, z2, M1, M2, M3):

# Need to be able to compute the thickness of the functional magnetic
# layer, which unfortunately requires the layer stack and an index.
# The index can be layer number, layer name, or if there are multiple
# layers with the same name, (layer name, k), where the magnetism
# is attached to the kth layer.
# set_magnetism_anchors(sample) needs to be called whenever layers are
# added or removed.

flayer.magnetism.set_anchor(sample, "sin")
set_magnetism_anchors(sample)

# Set the fittable parameters. Note that the parameters to the function
# after the first parameter *z* become fittable parameters.
Expand Down
2 changes: 1 addition & 1 deletion refl1d/names.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
XrayProbe,
)
from .sample.cheby import ChebyVF, FreeformCheby, cheby_approx, cheby_points
from .sample.flayer import FunctionalMagnetism, FunctionalProfile
from .sample.flayer import FunctionalMagnetism, FunctionalProfile, set_magnetism_anchors
from .sample.layers import Slab, Stack
from .sample.magnetism import FreeMagnetism, FreeMagnetismInterface, Magnetism, MagnetismStack, MagnetismTwist
from .sample.material import SLD, Compound, Material, Mixture
Expand Down
Loading
Loading