This is a python based sample component. The sample is a 2D surface with a center at (0,0,0), a norm along y axis, and a size in the xz-plane (size_x, size_z). The neutron will be scattered according to a reflectivity curve R(Q), which will be given as a python function, where Q is a numpy array.
Implementation (hint: use the "monitor" component as the starting point)
Propagate neutron to the xz-plane (note: the "monitor" component has a function to propagate neutrons to xy-plane. easy to adapt that)
Filter out neutrons that are not in within the size limit of the sample, and those propagate backward
Calculate the Q value as v2k 2vy
Calculate reflectivity using R(Q)
Change the velocity of neutrons that are scattered by the sample to (vx, -vy, vz)
Multiply the probability of scattered neutrons by reflectivity
This is a python based sample component. The sample is a 2D surface with a center at (0,0,0), a norm along y axis, and a size in the xz-plane (size_x, size_z). The neutron will be scattered according to a reflectivity curve R(Q), which will be given as a python function, where Q is a numpy array.
Implementation (hint: use the "monitor" component as the starting point)
Test: