def ossos_discoveries(directory=parameters.REAL_KBO_AST_DIR,
                      suffix='ast',
                      no_nt_and_u=False,
                      single_object=None,
                      all_objects=True,
                      data_release=None,
                      ):
    """
    Returns a list of objects holding orbfit.Orbfit objects with the observations in the Orbfit.observations field.
    Default is to return only the objects corresponding to the current Data Release.
    """
    retval = []
    # working_context = context.get_context(directory)
    # files = working_context.get_listing(suffix)
    files = [f for f in os.listdir(directory) if (f.endswith('mpc') or f.endswith('ast') or f.endswith('DONE'))]

    if single_object is not None:
        files = filter(lambda name: name.startswith(single_object), files)
    elif all_objects and data_release is not None:
        # only return the objects corresponding to a particular Data Release
        data_release = ossos_release_parser(table=True, data_release=data_release)
        objects = data_release['object']
        files = filter(lambda name: name.partition(suffix)[0].rstrip('.') in objects, files)

    for filename in files:
        # keep out the not-tracked and uncharacteried.
        if no_nt_and_u and (filename.__contains__('nt') or filename.startswith('u')):
            continue
        # observations = mpc.MPCReader(directory + filename)
        mpc_filename = directory + filename
        abg_filename = os.path.abspath(directory + '/../abg/') + "/" + os.path.splitext(filename)[0] + ".abg"
        obj = TNO(None, ast_filename=mpc_filename, abg_filename=abg_filename)
        retval.append(obj)

    return retval
def ossos_discoveries ( directory = parameters . REAL_KBO_AST_DIR , suffix = 'ast' , no_nt_and_u = False , single_object = None , all_objects = True , data_release = None , ) : retval = [ ] files = [ f for f in os . listdir ( directory ) if ( f . endswith ( 'mpc' ) or f . endswith ( 'ast' ) or f . endswith ( 'DONE' ) ) ] if single_object is not None : files = filter ( lambda name : name . startswith ( single_object ) , files ) elif all_objects and data_release is not None : data_release = ossos_release_parser ( table = True , data_release = data_release ) objects = data_release [ 'object' ] files = filter ( lambda name : name . partition ( suffix ) [ 0 ] . rstrip ( '.' ) in objects , files ) for filename in files : if no_nt_and_u and ( filename . __contains__ ( 'nt' ) or filename . startswith ( 'u' ) ) : continue mpc_filename = directory + filename abg_filename = os . path . abspath ( directory + '/../abg/' ) + "/" + os . path . splitext ( filename ) [ 0 ] + ".abg" obj = TNO ( None , ast_filename = mpc_filename , abg_filename = abg_filename ) retval . append ( obj ) return retval
Returns a list of objects holding orbfit.Orbfit objects with the observations in the Orbfit.observations field.
    Default is to return only the objects corresponding to the current Data Release.