ubermagtable.util.columns#

ubermagtable.util.columns(filename, rename=True)#

Extracts column names from a table file.

Parameters:
  • filename (str) – OOMMF .odt or mumax3 .txt file.

  • rename (bool) – If rename=True, the column names are renamed with their shorter versions. Defaults to True.

Returns:

List of column names.

Return type:

list

Examples

  1. Extracting the column names from an OOMMF .odt file.

>>> import os
>>> import ubermagtable.util as uu
...
>>> odtfile = os.path.join(os.path.dirname(__file__), '..',
...                        'tests', 'test_sample', 'oommf-new-file1.odt')
>>> uu.columns(odtfile)
[...]
  1. Extracting the names of columns from a mumax3 .txt file.

>>> odtfile = os.path.join(os.path.dirname(__file__), '..',
...                        'tests', 'test_sample', 'mumax3-file1.txt')
>>> uu.columns(odtfile)
[...]