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
73 table = Table.read(filename, hdu=self.config.hdu, character_as_bytes=
False)
75 raise RuntimeError(
"No data found in %s HDU %s" % (filename, self.config.hdu))
77 if not self.config.column_map:
79 return table.as_array()
81 missingnames = set(self.config.column_map.keys()) - set(table.columns.keys())
83 raise RuntimeError(
"Columns %s in column_map were not found in %s" % (missingnames, filename))
85 for inname, outname
in self.config.column_map.items():
86 table.columns[inname].name = outname
87 return table.as_array()