processing_components/skycomponent/operations.py
def remove_neighbouring_components(comps, distance):
    """ Remove the faintest of a pair of components that are within a specified distance

    :param comps:
    :param target_comps:
    :param distance: Minimum distance
    :return: Indices of components in target_comps, selected components
    """
    ncomps = len(comps)
    ok = ncomps * [True]
    for i in range(ncomps):
        if ok[i]:
            for j in range(i+1, ncomps):
                if ok[j]:
                    d = comps[i].direction.separation(comps[j].direction).rad
                    if d < distance:
                        if numpy.max(comps[i].flux) > numpy.max(comps[j].flux):
                            ok[j] = False
                        else:
                            ok[i] = False
                        break

    from itertools import compress
    idx = list(compress(list(range(ncomps)), ok))
    comps_sel = list(compress(comps, ok))
    return idx, comps_sel
 Remove the faintest of a pair of components that are within a specified distance

    :param comps:
    :param target_comps:
    :param distance: Minimum distance
    :return: Indices of components in target_comps, selected components
    
Remove the faintest of a pair of components that are within a specified distance
Remove the faintest of a pair of components that are within a specified distance
def remove_neighbouring_components(comps, distance):
    ncomps = len(comps)
    ok = ncomps * [True]
    for i in range(ncomps):
        if ok[i]:
            for j in range(i+1, ncomps):
                if ok[j]:
                    d = comps[i].direction.separation(comps[j].direction).rad
                    if d < distance:
                        if numpy.max(comps[i].flux) > numpy.max(comps[j].flux):
                            ok[j] = False
                        else:
                            ok[i] = False
                        break
    from itertools import compress
    idx = list(compress(list(range(ncomps)), ok))
    comps_sel = list(compress(comps, ok))
    return idx, comps_sel
def remove_neighbouring_components ( comps , distance ) : ncomps = len ( comps ) ok = ncomps * [ True ] for i in range ( ncomps ) : if ok [ i ] : for j in range ( i + 1 , ncomps ) : if ok [ j ] : d = comps [ i ] . direction . separation ( comps [ j ] . direction ) . rad if d < distance : if numpy . max ( comps [ i ] . flux ) > numpy . max ( comps [ j ] . flux ) : ok [ j ] = False else : ok [ i ] = False break from itertools import compress idx = list ( compress ( list ( range ( ncomps ) ) , ok ) ) comps_sel = list ( compress ( comps , ok ) ) return idx , comps_sel
Remove the faintest of a pair of components that are within a specified distance
Remove the faintest of a pair of components that are within a specified distance
""" Remove the faintest of a pair of components that are within a specified distance

    :param comps:
    :param target_comps:
    :param distance: Minimum distance
    :return: Indices of components in target_comps, selected components
    """
Indices of components in target_comps, selected components
Indices of components in target_comps selected components
comps
None
distance
None
target_comps
None