Example #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()
Example #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()
Example #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()
Example #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()