82 def run(self, filename):
83 """Read an object catalog from the specified text file
88 Path to specified text file
92 A numpy structured array containing the specified columns
95 if self.config.colnames:
97 kwargs[
'names'] = list(self.config.colnames)
99 kwargs[
'data_start'] = self.config.header_lines
102 kwargs[
'header_start'] = self.config.header_lines
104 if self.config.fill_values:
105 kwargs[
'fill_values'] = [list(self.config.fill_values)]
107 table = Table.read(filename, format=self.config.format,
108 delimiter=self.config.delimiter,
112 arr = np.array(table.as_array())
114 if self.config.replace_missing_floats_with_nan:
115 for column
in table.columns:
116 if (table.dtype[column] == np.float32)
or (table.dtype[column] == np.float64):
117 arr[column][table.mask[column]] = np.nan