dmsky.file_io subpackage

dmsky.file_io.table module

Module that handles file IO using astropy.table.Table class.

dmsky.file_io.table.columns_from_derived(name, prop)[source]

Build a set of Column objects for a Derived object

In this case we only build a single column

Parameters:
  • name (str) – Name of the Column we will build
  • prop (dmsky.Property) – Property object we are building the column for
Returns:

cols – A list of astropy.table.Column

Return type:

list

dmsky.file_io.table.columns_from_parameter(name, prop)[source]

Build a set of astropy.table.Column objects for a dmsky.Parameter object

In this case we build a several columns

Parameters:
  • name (str) – Base of the names of the Column we will build
  • prop (dmsky.Property) – Property object we are building the column for
Returns:

cols – A list of astropy.table.Column

Return type:

list

dmsky.file_io.table.columns_from_property(name, prop)[source]

Build some of astropy.table.Column objects for a dmsky.Property object

In this case we only build a single column

Parameters:
  • name (str) – Name of the Column we will build
  • prop (dmsky.Property) – Property object we are building the column for
Returns:

cols – A list of astropy.table.Column

Return type:

list

dmsky.file_io.table.fill_table_from_targetlist(tab, targetList)[source]

Fill a table for a set of dmsky.Target objects

Parameters:
  • tab (astropy.table.Table) – The table we are filling
  • targetList (list) – List of ‘dmsky.Target’ object used to fill the table
dmsky.file_io.table.get_column_kwargs(name, prop)[source]

Get keyword arguments needed to build a column for a dmsky.Property object

Parameters:
  • name (str) – Name of the Column we will build
  • prop (dmsky.Property) – Property object we are building the column for
Returns:

opt_keys – A dictionary we can use to constuct a astropy.table.Column

Return type:

dict

dmsky.file_io.table.get_row_values(model, keys)[source]

Get the values needed to fill a row in the table

Parameters:
  • model (dmsky.Model) – Model that we are getting the data from
  • keys (list) – Names of the properties we are reading
Returns:

vals – A dictionary we can use to fill an astropy.table.Column row

Return type:

dict

dmsky.file_io.table.make_columns_for_model(names, model)[source]

Make a set of Column objects needed to describe a Model object.

Parameters:
  • names (list) – List of the names of the properties to convert
  • model (dmsky.Model) – Model that we are getting the data from
Returns:

clist – A list of astropy.table.Column

Return type:

list

dmsky.file_io.table.make_columns_for_prop(name, prop)[source]

Generic function to make a set of astropy.table.Column objects for any dmsky.Property sub-class

Parameters:
  • name (str) – Name of the Column we will build
  • prop (dmsky.Property) – Property object we are building the column for
Returns:

cols – A list of astropy.table.Column

Return type:

list

dmsky.file_io.table.make_table_for_roster(colNames, roster)[source]

Make a table for a Roster object

Parameters:
  • colNames (list) – The names of the properties to include in the table
  • roster (dmsky.Roster) – Roster used to fill the table
Returns:

table – A table with the data from that Roster

Return type:

astropy.table.Table

dmsky.file_io.table.make_table_for_targetlist(colNames, targetList)[source]

Build a table for a set of Target objects

Parameters:
  • colNames (list) – The names of the properties to include in the table
  • targetList (list) – List of ‘dmsky.Target’ object used to fill the table
Returns:

table – A table with the data from those targets

Return type:

astropy.table.Table

dmsky.file_io.table.make_target_from_row(row)[source]

Make a Target object from a Table row

dmsky.file_io.table.row_to_dict(row)[source]

Convert a Table row into a dict

Module contents

File IO for dmsky package