cape.pykes.dataBook: Kestrel data book module

This module provides Kestrel-specific interfaces to the various CFD outputs tracked by the cape package.

class cape.pykes.dataBook.CaseFM(comp: str, **kw)

Iterative force & moment history for one component, one case

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

Name of component

Outputs:
fm: CaseFM

One-case iterative history

Versions:
  • 2021-11-08 @ddalle: v1.0

  • 2024-05-20 @ddalle: v2.0; min code; CAPE 1.2 conventions

get_filelist() list

Get list of files to read

Call:
>>> filelist = fm.get_filelist()
Inputs:
prop: CaseFM

Component iterative history instance

Outputs:
filelist: list[str]

List of files to read to construct iterative history

Versions:
  • 2024-05-20 @ddalle: v1.0

readfile(fname: str) dict

Read a Tecplot iterative history file

Call:
>>> db = fm.readfile(fname)
Inputs:
fm: CaseFM

Single-component iterative history instance

fname: str

Name of file to read

Outputs:
db: tsvfile.TSVTecDatFile

Data read from fname

Versions:
  • 2024-05-20 @ddalle: v1.0

class cape.pykes.dataBook.CaseProp(comp: str, **kw)

Iterative property history

Call:
>>> prop = CaseProp(fname)
Inputs:
fname: str

Name of file relative to outputs/ folder

Outputs:
prop: CaseProp

Iterative history of properties in fname

Versions:
  • 2022-01-28 @ddalle: v1.0

  • 2024-05-20 @ddalle: v2.0; min code; CAPE 1.2 conventions

get_filelist() list

Get list of files to read

Call:
>>> filelist = prop.get_filelist()
Inputs:
prop: CaseProp

Component iterative history instance

Outputs:
filelist: list[str]

List of files to read to construct iterative history

Versions:
  • 2024-05-20 @ddalle: v1.0

readfile(fname: str) dict

Read a Tecplot iterative history file

Call:
>>> db = fm.readfile(fname)
Inputs:
fm: CaseFM

Single-component iterative history instance

fname: str

Name of file to read

Outputs:
db: tsvfile.TSVTecDatFile

Data read from fname

Versions:
  • 2024-05-20 @ddalle: v1.0

class cape.pykes.dataBook.CaseResid(comp: str = 'body1')

Iterative residual history for one component, one case

Call:
>>> hist = CaseResid(comp=None)
Inputs:
comp: {None} | str

Name of component

Outputs:
hist: CaseResid

One-case iterative history

Versions:
  • 2021-11-08 @ddalle: v1.0

  • 2024-05-21 @ddalle: v2.0; code reduction for CAPE 1.2

get_filelist() list

Get list of files to read

Call:
>>> filelist = fm.get_filelist()
Inputs:
prop: CaseFM

Component iterative history instance

Outputs:
filelist: list[str]

List of files to read to construct iterative history

Versions:
  • 2024-05-20 @ddalle: v1.0

readfile(fname: str) dict

Read a Tecplot iterative history file

Call:
>>> db = fm.readfile(fname)
Inputs:
fm: CaseFM

Single-component iterative history instance

fname: str

Name of file to read

Outputs:
db: tsvfile.TSVTecDatFile

Data read from fname

Versions:
  • 2024-05-20 @ddalle: v1.0

class cape.pykes.dataBook.CaseTurbResid(comp: str = 'body1')

Iterative turbulence model residual history

Call:
>>> hist = CaseTurbResid(comp=None)
Inputs:
comp: {None} | str

Name of component

Outputs:
hist: CaseResid

One-case iterative history

Versions:
  • 2024-05-21 @ddalle: v1.0

get_filelist() list

Get list of files to read

Call:
>>> filelist = fm.get_filelist()
Inputs:
prop: CaseFM

Component iterative history instance

Outputs:
filelist: list[str]

List of files to read to construct iterative history

Versions:
  • 2024-05-20 @ddalle: v1.0

readfile(fname: str) dict

Read a Tecplot iterative history file

Call:
>>> db = fm.readfile(fname)
Inputs:
fm: CaseFM

Single-component iterative history instance

fname: str

Name of file to read

Outputs:
db: tsvfile.TSVTecDatFile

Data read from fname

Versions:
  • 2024-05-20 @ddalle: v1.0

class cape.pykes.dataBook.DBComp(comp, cntl, targ=None, check=False, lock=False, **kw)
class cape.pykes.dataBook.DBTarget(targ, x, opts, RootDir=None)
class cape.pykes.dataBook.DataBook(cntl, RootDir=None, targ=None, **kw)

Primary databook class for Kestrel

Call:
>>> db = DataBook(x, opts)
Inputs:
x: RunMatrix

Current run matrix

opts: Options

Global CAPE options instance

Outputs:
db: DataBook

Databook instance

Versions:
  • 21-11-08 @ddalle: v1.0

GetCurrentIter()

Determine iteration number of current folder

Call:
>>> n = db.GetCurrentIter()
Inputs:
db: DataBook

Databook for one run matrix

Outputs:
n: int | None

Iteration number

Versions:
  • 2021-11-08 @ddalle: v1.0

ReadCaseFM(comp)

Read a CaseFM object

Call:
>>> fm = db.ReadCaseFM(comp)
Inputs:
db: DataBook

Databook for one run matrix

comp: str

Name of component

Outputs:
fm: CaseFM

Force and moment history

Versions:
  • 2021-11-08 @ddalle: v1.0

ReadCaseProp(comp)

Read a CaseProp object

Call:
>>> fm = db.ReadCaseProp(comp)
Inputs:
db: DataBook

Databook for one run matrix

comp: str

Name of component

Outputs:
fm: CaseFM

Force and moment history

Versions:
  • 2022-04-08 @ddalle: v1.0

ReadCaseResid()

Read a CaseResid object

Call:
>>> H = DB.ReadCaseResid()
Inputs:
db: DataBook

Databook for one run matrix

Outputs:
H: CaseResid

Residual history

Versions:
  • 2021-11-08 @ddalle: v1.0

ReadDBComp(comp, check=False, lock=False)

Initialize data book for one component

Call:
>>> db.ReadDBComp(comp, check=False, lock=False)
Inputs:
db: DataBook

Databook for one run matrix

comp: str

Name of component

check: True | {False}

Whether or not to check LOCK status

lock: True | {False}

If True, wait if the LOCK file exists

Versions:
  • 2021-11-08 @ddalle: v1.0

cape.pykes.dataBook.normalize_colname(colname)

Normalize a Kestrel column name, removing special chars

Call:
>>> col = normalize_colname(colname)
Inputs:
colname: str

Raw column name from Kestrel output file

Outputs:
col: str

Normalized column name

Versions:
  • 2021-11-08 @ddalle: v1.0