Skip to content

[FEAT]: Add wrapper functions for soft x-ray index of refraction. #103

@HarlanHeilman

Description

@HarlanHeilman

It would be nice if the popular index of refraction components $\delta$ and $\beta$ could be added as functions to the xsf module. They could be modeled from the index of refraction function.

Proposed addition:

def delta(compound, *, density=None, natural_density=None,
                        energy=None, wavelength=None):
    """
    Calculates the δ component of the index of refraction for a given compound
    ...
    """
    if energy is not None:
        wavelength = xray_wavelength(energy)
    assert wavelength is not None, "scattering calculation needs energy or wavelength"
    f1, f2 = xray_sld(compound,
                      density=density, natural_density=natural_density,
                      wavelength=wavelength)
    return wavelength**2/(2*pi)*(f1)*1e-6
def beta(compound, *, density=None, natural_density=None,
                        energy=None, wavelength=None):
    """
    Calculates the β component of the index of refraction for a given compound
    ...
    """
    if energy is not None:
        wavelength = xray_wavelength(energy)
    assert wavelength is not None, "scattering calculation needs energy or wavelength"
    f1, f2 = xray_sld(compound,
                      density=density, natural_density=natural_density,
                      wavelength=wavelength)
    return -wavelength**2/(2*pi)*(f2)*1e-6

Should I make a pr for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions