def lamda_to_hitran(level, mol):
    """Convert levels from Lamda to HITRAN notation

    Parameters
    ----------
    level : str
        LAMDA level notation
    mol : str
        molecule name
    """
    import re
    if mol == 'aCH3OH':
        m = re.match('(\\d+)_(-?)(\\d+)', level)
        if m.group(2) == '-':
            quanta = m.group(1).rjust(3) + m.group(3).rjust(3) + '  A-     '
        else:
            quanta = m.group(1).rjust(3) + m.group(3).rjust(3) + '  A+     '
    elif mol == 'eCH3OH':
        m = re.match('(\\d+)_(-?)(\\d+)', level)
        if m.group(2) == '-':
            quanta = m.group(1).rjust(3) + m.group(3).rjust(3) + '  E2     '
        else:
            quanta = m.group(1).rjust(3) + m.group(3).rjust(3) + '  E1     '
    elif mol == 'H2O' or mol == 'HDO':
        m = re.match('(\\d+)_(\\d+)_(\\d+)', level)
        quanta = m.group(1).rjust(3) + m.group(2).rjust(3) + m.group(3).rjust(3
            ) + '      '
    return quanta.encode('utf-8')
