rdf_output_file_writer

A module containing the classes for writing related to an RDF analysis to a file.

Summary

Classes:

RDFDataWriter

Class for writing the data of an RDF analysis to a file.

RDFLogWriter

Class for writing the log (setup parameters) of an RDF analysis to a file.

Reference

class RDFDataWriter(
filename: str,
export_files: Sequence[str] | None = None,
)[source]

Bases: AnalysisDataWriter

Class for writing the data of an RDF analysis to a file.

Each row contains five columns: bin-center distance in Angstrom, radial distribution function, cumulative coordination number, density-normalized shell population in Angstrom^3 and ideal-gas pair-count residual. See RDF output files for the exact definitions and normalization formulas.

Parameters:
  • filename (str) – The primary output filename. Its extension selects the format.

  • export_files (Sequence[str] | None, optional) – Additional output filenames, by default None.

write(
data: tuple[Np1DNumberArray, Np1DNumberArray, Np1DNumberArray, Np1DNumberArray, Np1DNumberArray],
)[source]

Writes the data to the file.

Parameters:

data (Tuple[Np1DNumberArray, Np1DNumberArray,) – Np1DNumberArray, Np1DNumberArray, Np1DNumberArray] The bin centers, radial distribution function, cumulative coordination number, density-normalized shell population and ideal-gas pair-count residual returned by run().

header = '# PQAnalysis: Radial distribution function\n# FIELDS r_i g_r_i N_r_i g_r_i_dV_i H_i_minus_E_i\n# SYMBOLS rᵢ g(rᵢ) N(rᵢ) g(rᵢ)ΔVᵢ Hᵢ−Eᵢ\n# UNITS Å 1 1 ų pairs'
schema: AnalysisSchema = AnalysisSchema(title='Radial distribution function', columns=(AnalysisColumn(field='r_i', symbol='rᵢ', unit='Å'), AnalysisColumn(field='g_r_i', symbol='g(rᵢ)', unit='1'), AnalysisColumn(field='N_r_i', symbol='N(rᵢ)', unit='1'), AnalysisColumn(field='g_r_i_dV_i', symbol='g(rᵢ)ΔVᵢ', unit='ų'), AnalysisColumn(field='H_i_minus_E_i', symbol='Hᵢ−Eᵢ', unit='pairs')), plot=AnalysisPlotPreset(x_field='r_i', y_fields=('g_r_i',), x_label='r [\\cE\\C]', y_label='g(r)', legends=('g(r)',)))
class RDFLogWriter(filename: str | None)[source]

Bases: BaseWriter

Class for writing the log (setup parameters) of an RDF analysis to a file.

Parameters:

filename (str | None) – the filename to write to if None, the output is printed to stdout

write_after_run(
rdf: RDF,
)[source]

Writes the log after the RDF run() method is called.

This includes the elapsed time of the RDF run() method.

Parameters:

rdf (RadialDistributionFunction) – the RDF analysis object

write_before_run(
rdf: RDF,
)[source]

Writes the log before the RDF run() method is called.

This includes the general header of PQAnalysis and the most important setup parameters of the RDF analysis.

Parameters:

rdf (RadialDistributionFunction) – the RDF analysis object