def convert_to_air(lam):
    """This function converts the vacuum wavelength of spectral lines to 
       the air wavelength. The wavelength is the difference in energy
       levels of the upper and lower transition. By defualt in the adf04
       file these energy correspond to the vacuum wavelengths to this
       must be converted at some point for UV and visible light.

    :param lam: The wavelengths in nm in vacuum
    :type lam: array

    :returns: array --wavelengths in nm in air

    """
    s = 10 ** 3 / lam
    return 1 + 8.34254e-05 + 0.02406147 / (130 - s ** 2) + 0.00015998 / (
        38.9 - s ** 2)
