refnx/reflect/spline.py
def slabs(self, structure=None):
        """
        Slab representation of the spline, as an array

        Parameters
        ----------
        structure : refnx.reflect.Structure
            The Structure hosting this Component
        """
        if structure is None:
            raise ValueError("Spline.slabs() requires a valid Structure")

        num_slabs = np.ceil(float(self.extent) / self.microslab_max_thickness)
        slab_thick = float(self.extent / num_slabs)
        slabs = np.zeros((int(num_slabs), 5))
        slabs[:, 0] = slab_thick

        # give last slab a miniscule roughness so it doesn't get contracted
        slabs[-1:, 3] = 0.5

        dist = np.cumsum(slabs[..., 0]) - 0.5 * slab_thick
        slabs[:, 1] = self(dist, structure)

        return slabs

        Slab representation of the spline, as an array

        Parameters
        ----------
        structure : refnx.reflect.Structure
            The Structure hosting this Component
        
Slab representation of the spline, as an array
Parameters

structure : refnx.reflect.Structure
The Structure hosting this Component
Slab representation of the spline as an array Parameters structure : refnx . reflect . Structure The Structure hosting this Component
def slabs(self, structure=None):
        if structure is None:
            raise ValueError("Spline.slabs() requires a valid Structure")
        num_slabs = np.ceil(float(self.extent) / self.microslab_max_thickness)
        slab_thick = float(self.extent / num_slabs)
        slabs = np.zeros((int(num_slabs), 5))
        slabs[:, 0] = slab_thick
        slabs[-1:, 3] = 0.5
        dist = np.cumsum(slabs[..., 0]) - 0.5 * slab_thick
        slabs[:, 1] = self(dist, structure)
        return slabs
def slabs ( self , structure = None ) : if structure is None : raise ValueError ( "Spline.slabs() requires a valid Structure" ) num_slabs = np . ceil ( float ( self . extent ) / self . microslab_max_thickness ) slab_thick = float ( self . extent / num_slabs ) slabs = np . zeros ( ( int ( num_slabs ) , 5 ) ) slabs [ : , 0 ] = slab_thick slabs [ - 1 : , 3 ] = 0.5 dist = np . cumsum ( slabs [ ... , 0 ] ) - 0.5 * slab_thick slabs [ : , 1 ] = self ( dist , structure ) return slabs
Slab representation of the spline, as an array
Parameters
Slab representation of the spline as an array Parameters
"""
        Slab representation of the spline, as an array

        Parameters
        ----------
        structure : refnx.reflect.Structure
            The Structure hosting this Component
        """ # give last slab a miniscule roughness so it doesn't get contracted
self
structure