def remove_aliens(data, config_map, data_dir=None):
    "\n    Finds which algorithm is cofigured to remove the aliens and applies it to clean the data.\n    \n    Parameters\n    ----------\n    data : ndarray\n        an array with experiment data\n    config : Object\n        configuration object providing access to configuration parameters\n    data_dir : str\n        a directory where 'alien_analysis' subdirectory will be created to save results of analysis if configured\n    Returns\n    -------\n    data : ndarray\n        data array without aliens\n    "
    try:
        algorithm = config_map.alien_alg
        if (algorithm == 'block_aliens'):
            data = remove_blocks(data, config_map)
        elif (algorithm == 'alien_file'):
            data = filter_aliens(data, config_map)
        elif (algorithm == 'AutoAlien1'):
            data = auto_alien1(data, config_map, data_dir)
        elif (algorithm != 'none'):
            print('not supported alien removal algorithm', algorithm)
    except AttributeError:
        pass
    except Exception as e:
        print('did not remove aliens, error in aliens removal, error: ', str(e))
    return data
Finds which algorithm is cofigured to remove the aliens and applies it to clean the data.

Parameters
----------
data : ndarray
    an array with experiment data
config : Object
    configuration object providing access to configuration parameters
data_dir : str
    a directory where 'alien_analysis' subdirectory will be created to save results of analysis if configured
Returns
-------
data : ndarray
    data array without aliens
def remove_aliens(data, config_map, data_dir=None):
    "\n    Finds which algorithm is cofigured to remove the aliens and applies it to clean the data.\n    \n    Parameters\n    ----------\n    data : ndarray\n        an array with experiment data\n    config : Object\n        configuration object providing access to configuration parameters\n    data_dir : str\n        a directory where 'alien_analysis' subdirectory will be created to save results of analysis if configured\n    Returns\n    -------\n    data : ndarray\n        data array without aliens\n    "
    try:
        algorithm = config_map.alien_alg
        if (algorithm == 'block_aliens'):
            data = remove_blocks(data, config_map)
        elif (algorithm == 'alien_file'):
            data = filter_aliens(data, config_map)
        elif (algorithm == 'AutoAlien1'):
            data = auto_alien1(data, config_map, data_dir)
        elif (algorithm != 'none'):
            print('not supported alien removal algorithm', algorithm)
    except AttributeError:
        pass
    except Exception as e:
        print('did not remove aliens, error in aliens removal, error: ', str(e))
    return data