57 def run(self, filename):
58 """Read an object catalog from the specified FITS file
63 Path to specified FITS file
68 a numpy structured array containing the specified columns
71 table = Table.read(filename, hdu=self.config.hdu)
73 raise RuntimeError(
"No data found in %s HDU %s" % (filename, self.config.hdu))
75 if not self.config.column_map:
77 return table.as_array()
79 missingnames = set(self.config.column_map.keys()) - set(table.columns.keys())
81 raise RuntimeError(
"Columns %s in column_map were not found in %s" % (missingnames, filename))
83 for inname, outname
in self.config.column_map.items():
84 table.columns[inname].name = outname
85 return table.as_array()