Ejemplo n.º 1
0
def read_sources_from_numpy_file(npfile):
    """ Open a numpy pickle file and read all the new sources into a dictionary

    Parameters
    ----------
    npfile : file name
       The input numpy pickle file

    Returns
    -------
    tab : `~astropy.table.Table`
    """
    srcs = np.load(npfile).flat[0]['sources']

    roi = ROIModel()
    roi.load_sources(srcs.values())
    return roi.create_table()
Ejemplo n.º 2
0
def read_sources_from_numpy_file(npfile):
    """ Open a numpy pickle file and read all the new sources into a dictionary

    Parameters
    ----------
    npfile : file name
       The input numpy pickle file

    Returns
    -------
    tab : `~astropy.table.Table`
    """
    srcs = np.load(npfile).flat[0]['sources']

    roi = ROIModel()
    roi.load_sources(srcs.values())
    return roi.create_table()
Ejemplo n.º 3
0
def read_sources_from_yaml_file(yamlfile):
    """ Open a yaml file and read all the new sources into a dictionary

    Parameters
    ----------
    yaml : file name
       The input yaml file

    Returns
    -------
    tab : `~astropy.table.Table`
    """
    f = open(yamlfile)
    dd = yaml.safe_load(f)
    srcs = dd['sources']
    f.close()
    roi = ROIModel()
    roi.load_sources(srcs.values())
    return roi.create_table()
Ejemplo n.º 4
0
def read_sources_from_yaml_file(yamlfile):
    """ Open a yaml file and read all the new sources into a dictionary

    Parameters
    ----------
    yaml : file name
       The input yaml file

    Returns
    -------
    tab : `~astropy.table.Table`
    """
    f = open(yamlfile)
    dd = yaml.load(f)
    srcs = dd['sources']
    f.close()
    roi = ROIModel()
    roi.load_sources(srcs.values())
    return roi.create_table()