slitflow.tbl.create module

class Index(info_path=None)[source]

Bases: Table

Create nested index Table.

This class can be used for the initial step of simulations.

Parameters:
  • reqs[] (None) – Input Data is not required.

  • param["index_counts"] (list of int) – Total counts of each column.

  • param["split_depth"] (int) – File split depth number.

  • param["index_value"] (int, optional) – Set a single value to the first index column if you want to fix it.

  • param["type"] (str, optional) –

    Parameter initiation type. If you do not use type, you must set calc_cols as a list of column names.

    • ”image” : Add img_no index.

    • ”trajectory” : Add img_no and trj_no index.

    • ”movie” : Add img_no and frm_no index.

  • param["param"] (list of list, optional) – Additional parameters. The list should be [[name, value, unit, description],…].

Returns:

Index Table of iterated numbers

Return type:

Table

Examples

Create a nested trajectory index list.

D = sf.data.tbl.create.Index()
D.run([],{"type":"trajectory", "index_counts":[2,3],
          "split_depth":0})
print(D.data[0])
#   img_no trj_no
# 0      1      1
# 1      1      2
# 2      1      3
# 3      2      1
# 4      2      2
# 5      2      3
set_info(param)[source]

Set columns and params.

static process(reqs, param)[source]

Create nested index table.

Parameters:
  • reqs (None) – Empty list.

  • param["calc_cols"] (list of str) – List of column names.

  • param["index_counts"] (list of int) – Total counts of each column.

  • param["index_value"] (int, optional) – An explicit value of the top level column.

Returns:

Index table of iterated numbers

Return type:

pandas.DataFrame