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:
-
-
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:
-
-
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:
-
-
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:
-
-
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:
-
-
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:
-
-
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:
-
-
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:
-
-
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:
-
-
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:
-
-
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:
-
-
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:
-
-
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: str | None = None, targ: str | None = 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:
-
-
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:
-
-
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:
-
-
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:
-
-
ReadCaseResid()
Read a CaseResid object
- Call:
>>> H = DB.ReadCaseResid()
- Inputs:
- db:
DataBook Databook for one run matrix
- Outputs:
- H:
CaseResid Residual history
- Versions:
-
-
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:
-
-
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:
-