pyyeti.nastran.bulk.rdtabled1¶
- pyyeti.nastran.bulk.rdtabled1(f, name='tabled1', *, follow_includes=True, include_symbols=None, encoding='utf_8')[source]¶
Read Nastran TABLED1 or other identically formatted cards from a Nastran bulk file.
- Parameters:
f (string or file_like or None) – Either a name of a file, or is a file_like object as returned by
open(). If file_like object, it is rewound first. Can also be the name of a directory or None; in these cases, a GUI is opened for file selection.name (string; optional) – Name of cards to read.
follow_includes (bool; optional) – If True, INCLUDE statements will be followed recursively. Note that if f is a StringIO object, or another object that does not have a name property, this parameter will be set to False.
include_symbols (dict; optional) – A dictionary mapping Nastran symbols to an associated path. These can be read from a file using
rdsymbols().encoding (string; optional) – Encoding to use when opening text file. This option will be passed to any files read in via the follow_includes option.
- Returns:
dct (dictionary) – Dictionary of TABLED1 (or similar) cards:
{ID1: [time, data], ID2: [time, data], ...}
Notes
This routine uses
rdcards()to load the data (can read 8 or 16 fixed field or comma-delimited).See also
Examples
>>> from pyyeti import nastran >>> import numpy as np >>> from io import StringIO >>> t = np.arange(0, 1, .05) >>> d = np.sin(2*np.pi*3*t) >>> with StringIO() as f: ... nastran.wttabled1(f, 4000, t, d, '3 Hz Sine Wave', ... form='{:8.2f}{:8.5f}') ... dct = nastran.rdtabled1(f) >>> np.allclose(t, dct[4000][:, 0]) True >>> np.allclose(d, dct[4000][:, 1]) True