Lines 32-41 can be simplified to (not tested):

    if units in ('nm', 'mm', 'cm', 'm', 'angstrom'):
        return getattr(u, units).to(u.angstrom, wavelength)