def filter_aliens(data, config_map):
    '\n    Sets to zero points in the data array defined by a file.\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\n    Returns\n    -------\n    data : ndarray\n        data array with zeroed out aliens\n    '
    try:
        alien_file = config_map.alien_file
        if os.path.isfile(alien_file):
            mask = np.load(alien_file)
            for i in range(len(mask.shape)):
                if (mask.shape[i] != data.shape[i]):
                    print('exiting, mask must be of the same shape as data:', data.shape)
                    return
            data = np.where((mask == 1), data, 0.0)
    except AttributeError:
        print('alien_file parameter not configured')
    except Exception as e:
        print('did not remove aliens, error in aliens removal ', str(e))
    return data
Sets to zero points in the data array defined by a file.

Parameters
----------
data : ndarray
    an array with experiment data
config : Object
    configuration object providing access to configuration parameters

Returns
-------
data : ndarray
    data array with zeroed out aliens
def filter_aliens(data, config_map):
    '\n    Sets to zero points in the data array defined by a file.\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\n    Returns\n    -------\n    data : ndarray\n        data array with zeroed out aliens\n    '
    try:
        alien_file = config_map.alien_file
        if os.path.isfile(alien_file):
            mask = np.load(alien_file)
            for i in range(len(mask.shape)):
                if (mask.shape[i] != data.shape[i]):
                    print('exiting, mask must be of the same shape as data:', data.shape)
                    return
            data = np.where((mask == 1), data, 0.0)
    except AttributeError:
        print('alien_file parameter not configured')
    except Exception as e:
        print('did not remove aliens, error in aliens removal ', str(e))
    return data