get_table_data¶
-
gunagala.utils.
get_table_data
(data_table, column_names, column_units, data_dir='data/performance_data', **kwargs)[source]¶ Parses a data table to extract specified columns, converted to Quantity with specified units.
Parameters: - data_table: astropy.table.Table or str
The data table for parsing, either as an astropy.table.Table object or the name of a file that can be read by
astropy.table.Table.read()
. The filename can be either the path to a user file or the name of one of gunagala’s included files.- column_names: sequence
Names of the columns to extract from the table
- column_units: sequence
Desired units for the extracted columns. If data_table specifies units for its columns then the extracted columns will be converted to these units. If not then the specified units will be added to the corresponding column.
- Additional keyword arguments will be passed to the call to astropy.table.Table.read()
- if reading a Table from a file. See the documentation for Table.read() for details
- of the available parameters.
Returns: - data: tuple of astropy.units.Quantity
Tuple of Quantity objects corresponding to the named columns, with the specified units.