startracker.py
def update_nonstars(current_image, source):
    """Iterate over all stars, tag nonstars."""
    global NONSTARS, NONSTAR_NEXT_ID
    nonstars_next = {}
    im = current_image.img_stars
    db = current_image.db_stars
    db_lm = current_image.db_stars_from_lm
    if db is not None:
        assert(db.size() == im.size())
    if db_lm is not None:
        assert(db_lm.size() == im.size())
        for i in range(im.size()):
            im.get_star(i).id = db_lm.get_star(i).id
    for i in range(im.size()):
        s_im = im.get_star(i)
        # is this a star? if so remove from nonstars
        if db is not None and db.get_star(i).id >= 0:
            if (s_im.id in NONSTARS):
                del NONSTARS[s_im.id]
            s_im.id = -1
        # if it's already there, add the latest mesurement
        elif (s_im.id in NONSTARS):
            NONSTARS[s_im.id].add_data(current_image, i, source)
            nonstars_next[s_im.id] = NONSTARS[s_im.id]
        # otherwise add a new nonstar
        else:
            ns = nonstar(current_image, i, source)
            nonstars_next[ns.id] = ns
    NONSTARS = nonstars_next

    # wrap around to prevent integer overflow
    if (NONSTAR_NEXT_ID > 2**30):
        flush_nonstars()
Iterate over all stars, tag nonstars.
Iterate over all stars, tag nonstars.
Iterate over all stars tag nonstars .
def update_nonstars(current_image, source):
    global NONSTARS, NONSTAR_NEXT_ID
    nonstars_next = {}
    im = current_image.img_stars
    db = current_image.db_stars
    db_lm = current_image.db_stars_from_lm
    if db is not None:
        assert(db.size() == im.size())
    if db_lm is not None:
        assert(db_lm.size() == im.size())
        for i in range(im.size()):
            im.get_star(i).id = db_lm.get_star(i).id
    for i in range(im.size()):
        s_im = im.get_star(i)
        if db is not None and db.get_star(i).id >= 0:
            if (s_im.id in NONSTARS):
                del NONSTARS[s_im.id]
            s_im.id = -1
        elif (s_im.id in NONSTARS):
            NONSTARS[s_im.id].add_data(current_image, i, source)
            nonstars_next[s_im.id] = NONSTARS[s_im.id]
        else:
            ns = nonstar(current_image, i, source)
            nonstars_next[ns.id] = ns
    NONSTARS = nonstars_next
    if (NONSTAR_NEXT_ID > 2**30):
        flush_nonstars()
def update_nonstars ( current_image , source ) : global NONSTARS , NONSTAR_NEXT_ID nonstars_next = { } im = current_image . img_stars db = current_image . db_stars db_lm = current_image . db_stars_from_lm if db is not None : assert ( db . size ( ) == im . size ( ) ) if db_lm is not None : assert ( db_lm . size ( ) == im . size ( ) ) for i in range ( im . size ( ) ) : im . get_star ( i ) . id = db_lm . get_star ( i ) . id for i in range ( im . size ( ) ) : s_im = im . get_star ( i ) if db is not None and db . get_star ( i ) . id >= 0 : if ( s_im . id in NONSTARS ) : del NONSTARS [ s_im . id ] s_im . id = - 1 elif ( s_im . id in NONSTARS ) : NONSTARS [ s_im . id ] . add_data ( current_image , i , source ) nonstars_next [ s_im . id ] = NONSTARS [ s_im . id ] else : ns = nonstar ( current_image , i , source ) nonstars_next [ ns . id ] = ns NONSTARS = nonstars_next if ( NONSTAR_NEXT_ID > 2 ** 30 ) : flush_nonstars ( )
Iterate over all stars, tag nonstars.
Iterate over all stars tag nonstars .
"""Iterate over all stars, tag nonstars.""" # is this a star? if so remove from nonstars # if it's already there, add the latest mesurement # otherwise add a new nonstar # wrap around to prevent integer overflow
current_image
source