cape.pycart.databook: pyCart data book module

Databook module for cape.pycart

This module contains functions for reading and processing forces, moments, and other statistics from cases in a trajectory.

# Read Cart3D control instance
cntl = cape.pycart.cntl.Cntl("pyCart.json")
# Read the data book
cntl.ReadDataBook()
# Get a handle
db = cntl.DataBook

Data book modules are also invoked during update and reporting command-line calls.

$ pycart --aero
$ pycart --ll
$ pycart --report
See Also:
class cape.pycart.databook.CaseFM(comp: str, **kw)

Cart3D iterative force & moment class

This class contains methods for reading data about an the history of an individual component for a single casecntl. It reads the file {comp}.dat where comp is the name of the component. From this file it determines which coefficients are recorded automatically. If some of the comment lines from the Cart3D output file have been deleted, it guesses at the column definitions based on the number of columns.

Call:
>>> fm = CaseFM(comp)
Inputs:
comp: str

Name of component to process

Outputs:
fm: cape.pycart.databook.CaseFM

Instance of the force and moment class

fm.coeffs: list[str]

List of coefficients

get_filelist() list

Get ordered list of files to read to build iterative history

Call:
>>> filelist = h.get_filelist()
Inputs:
h: CaseData

Single-case iterative history instance

Outputs:
filelist: list[str]

List of files to read

Versions:
  • 2024-01-22 @ddalle: v1.0

readfile(fname: str) dict

Read cart3D {COMP}.dat file

Call:
>>> data = h.readfile(fname)
Inputs:
h: CaseData

Single-case iterative history instance

fname: str

Name of file to read

Outputs:
data: tsvfile.TSVSimple

Data to add to or append to keys of h

Versions:
  • 2024-01-22 @ddalle: v1.0

class cape.pycart.databook.CaseResid(meta: bool = False, **kw)

Iterative history class

This class provides an interface to residuals, CPU time, and similar data for a given run directory

Call:
>>> hist = CaseResid()
Outputs:
hist: cape.pycart.databook.CaseResid

Instance of the run history class

get_filelist() list

Get ordered list of files to read to build iterative history

Call:
>>> filelist = h.get_filelist()
Inputs:
h: CaseResid

Single-case iterative history instance

Outputs:
filelist: list[str]

List of files to read

Versions:
  • 2024-01-23 @ddalle: v1.0

readfile(fname: str) dict

Read cart3D history.dat file

Call:
>>> data = h.readfile(fname)
Inputs:
h: CaseData

Single-case iterative history instance

fname: str

Name of file to read

Outputs:
data: tsvfile.TSVSimple

Data to add to or append to keys of h

Versions:
  • 2024-01-23 @ddalle: v1.0