Radial Distribution Function (RDF) Parser

Handles parsing and validation of RDF files.

class kbkit.io.rdf.RdfParser(path: str | Path)[source]

Bases: object

Class to handle RDF (Radial Distribution Function) data.

Reads RDF data from a file provides methods to plot the RDF and extract molecular information.

Parameters:

filepath (str) – Path to the RDF text file.

Variables:
  • fname (str) – File name.

  • r (np.ndarray) – Array of radial distances (nm).

  • gr (np.ndarray) – Array of radial distribution function values.

static extract_molecules(text: str, mol_list: list[str]) list[str][source]

Extract molecule names used in RDF from the RDF file name.

Parameters:
  • rdf_file (str) – Path to the RDF file.

  • mol_list (list of str) – List of molecule names to search for in the file name.

Returns:

List of molecule names found in the RDF file name.

Return type:

list[str]

plotRDF(axhandle, **kwargs) None[source]

Add rdf to plt.axes.