import re


def get_currents( content ):
    """
    Gets the currents from an Igor file

    :param content: The content to search
    :returns: A numpy array of the currents
    """
    j_search = 'WAVES\s*PhotoCurrent1\nBEGIN\n(.*)\nEND'
    match = re.search( j_search, content, flags = ( re.IGNORECASE | re.DOTALL ) )

    if match is None:
        # no match found, raise exception
        raise RuntimeError( 'Currents not found' )

    currents = match.group( 1 ).split( '\n' )
    return [ float( j ) for j in currents ]