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