Index Module Index Search Page

qnd.pdbparse module

Pure python PDB file format parsing.

Parse PDB metadata. The PDB file format was designed by Stewart Brown at Lawrence Livermore National Laboratory in the 1990s.

PDB is widely used at LLNL for restart and post-processing data produced by large radiation-hydrodynamics simulation codes. The PDB format can describe and store named arrays of any data type representable in the C programming language that is derived from one of the primitive C data types char, short, int, long, float, or double or pointer to a representable type. The format was extended to handle primitive integer or floating point numbers of any size, such as long long or long double or 16 bit floating point data. The format was also extended to organize the named arrays into groups like HDF5. The metadata is text with a few embedded ASCII control characters, written at the end of the file, and intended to be parsed and held in memory when the file is opened.

class qnd.pdbparse.PDBChart(root)[source]

Bases: object

PDB structure chart contains all information about data types.

add_primitive(name, desc)[source]

desc is (size, order, align) or (size, order, align, fpbits)

add_struct(name, members)[source]

members is OrderedDict, name –> typename, shape

find_or_create(dtype)[source]

Find or create stype –> (stype, align, typename).

read_special(f, typename, value)[source]

Recursively read pointer values.

use(dtype)[source]

Find or create stype –> (stype, align, typename, nopartial).

qnd.pdbparse.parser(handle, root, index=0)[source]

Parse PDB file with the given MultiFile handle and PDBGroup group.