TableTree

class msumastro.table_tree.TableTree(*args, **kwd)[source]

Bases: msumastro.table_tree.RecursiveTree

Base class for grouping images hierarchically into a tree based on metadata.

Parameters:

table : astropy.table.Table instance

Table containing the metadata to be used for grouping images.

tree_keys : list of str

Keys to be used in grouping images. Each key must be the name of a column in table.

index_key : str

Key which is used to indicate which rows of the input table are in each group; it must be the name of one of the columns in table. Values of the index must uniquely identify rows of the table (in database parlance, index must be able to serve as a primary key for the table).

Raises:

TypeError

Raised if the number of initialization arguments is incorrect or the types of any of the arguments is incorrect.

Attributes

table astropy.table.Table of metadata used to group rows.
tree_keys list of str, Table columns to be used in grouping the rows.
index_key str, Name of column whose values uniquely identify each row.

Attributes Summary

index_key str, Name of column whose values uniquely identify each row.
table astropy.table.Table of metadata used to group rows.
tree_keys list of str, Table columns to be used in grouping the rows.

Methods Summary

walk(*args, **kwd) Walk the grouped tree

Attributes Documentation

index_key

str, Name of column whose values uniquely identify each row.

table

astropy.table.Table of metadata used to group rows.

tree_keys

list of str, Table columns to be used in grouping the rows.

Methods Documentation

walk(*args, **kwd)[source]

Walk the grouped tree

The functionality provided is similar to that in os.walk: starting at the top of tree, yield a tuple of return values indicating parents, children and rows at each level of the tree.

Parameters:

None

Returns:

parents, children, index : lists

parents : list

Dictionary keys that led to this return

children : list

Child nodes at this level

index : list

Index values for the items in the table that correspond to the values in parents