refnx/util/general.py
def neutron_transmission(formula, density, wavelength, thickness):
    """
    Calculates the transmission of neutrons through a material.
    Includes absorption + scattering (coherent+incoherent) cross sections.

    Parameters
    ----------
    formula : str
        Chemical formula of the material.
    density : float
        material density in g/cm^3
    wavelength : float, np.ndarray
        wavelength of neutron in Angstrom
    thickness : float
        thickness of material in mm

    Returns
    -------
    transmission : float or np.ndarray
        transmission of material
    """
    import periodictable as pt

    material = pt.formula(formula, density=density)

    _depth_fn = np.vectorize(_neutron_transmission_depth, excluded={0})
    depths = _depth_fn(material, wavelength)
    transmission = np.exp(-(thickness / depths))
    return transmission

    Calculates the transmission of neutrons through a material.
    Includes absorption + scattering (coherent+incoherent) cross sections.

    Parameters
    ----------
    formula : str
        Chemical formula of the material.
    density : float
        material density in g/cm^3
    wavelength : float, np.ndarray
        wavelength of neutron in Angstrom
    thickness : float
        thickness of material in mm

    Returns
    -------
    transmission : float or np.ndarray
        transmission of material
    
Calculates the transmission of neutrons through a material.
Includes absorption + scattering (coherent+incoherent) cross sections.

Parameters

formula : str
Chemical formula of the material.
density : float
material density in g/cm^3
wavelength : float, np.ndarray
wavelength of neutron in Angstrom
thickness : float
thickness of material in mm

Returns

transmission : float or np.ndarray
transmission of material
Calculates the transmission of neutrons through a material . Includes absorption + scattering ( coherent + incoherent ) cross sections . Parameters formula : str Chemical formula of the material . density : float material density in g / cm^3 wavelength : float np . ndarray wavelength of neutron in Angstrom thickness : float thickness of material in mm Returns transmission : float or np . ndarray transmission of material
def neutron_transmission(formula, density, wavelength, thickness):
    import periodictable as pt
    material = pt.formula(formula, density=density)
    _depth_fn = np.vectorize(_neutron_transmission_depth, excluded={0})
    depths = _depth_fn(material, wavelength)
    transmission = np.exp(-(thickness / depths))
    return transmission
def neutron_transmission ( formula , density , wavelength , thickness ) : import periodictable as pt material = pt . formula ( formula , density = density ) _depth_fn = np . vectorize ( _neutron_transmission_depth , excluded = { 0 } ) depths = _depth_fn ( material , wavelength ) transmission = np . exp ( - ( thickness / depths ) ) return transmission
Calculates the transmission of neutrons through a material.
Calculates the transmission of neutrons through a material .
"""
    Calculates the transmission of neutrons through a material.
    Includes absorption + scattering (coherent+incoherent) cross sections.

    Parameters
    ----------
    formula : str
        Chemical formula of the material.
    density : float
        material density in g/cm^3
    wavelength : float, np.ndarray
        wavelength of neutron in Angstrom
    thickness : float
        thickness of material in mm

    Returns
    -------
    transmission : float or np.ndarray
        transmission of material
    """
formula
density
wavelength
thickness