
def wnum2ang(wavenum):
    '''
    Convert input wavenumber in cm^-1 (vacuum) to air Angstroms.

    Routine first computes refractive index of air using a standard
    formulation (Coleman, Bozman, and Meggers; 1960;
    "Table ov Wavenumbers"; NBS Monograph 3).  Then computes the
    wavelength using:

    angstroms = 1./(n*wavenum) * 1.e8

    Routine translated by Tom Schad from IDL version written by
    Matt Penn (29 Dec 93).  -- 20 April 2016
    '''

    # Compute index of refraction from NBS formulation
    a = 1. + 6432.8e-8
    b = 2949810.0
    c = 146.0e8
    d = 25540.0
    e = 41.0e8
    n = a + (b / (c - wavenum**2)) + ( d / (e - wavenum**2))

    angstrom = 1. / (n * wavenum) * 1.e8
    return angstrom

if __name__ == "__main__":
    print('testing wnum2ang.py')
    print('entering wnum2ang(9231.)')
    print(wnum2ang(9231.))
    
