momentum_output_file_writer
A module containing the writer for the data of a
Momentum analysis.
Summary
Classes:
Class for writing the data of a |
Reference
- class MomentumDataWriter(
- filename: str | None = None,
- mode: str | FileWritingMode = 'w',
- export_files: Sequence[str] | None = None,
Bases:
AnalysisDataWriterClass for writing the data of a
Momentumanalysis to a file.Each row contains the one-based frame index and the scaled norm of the total linear momentum of that frame, reproducing the legacy
equipartition.jloutput layout.- Parameters:
filename (str | None, optional) – The filename to write to. If None, the output is printed to stdout, by default None.
mode (str | FileWritingMode, optional) – The writing mode, by default “w”.
export_files (Sequence[str] | None, optional) – Additional output filenames, by default None.
- write(
- data: Np1DNumberArray,
Writes the momentum norms to the file.
- Parameters:
data (Np1DNumberArray) – The scaled momentum norms as returned by the
run()method.
- header = '# PQAnalysis: Total linear momentum\n# FIELDS frame scaled_momentum_norm\n# SYMBOLS n s‖P(n)‖\n# UNITS 1 scale-dependent'
- schema: AnalysisSchema = AnalysisSchema(title='Total linear momentum', columns=(AnalysisColumn(field='frame', symbol='n', unit='1'), AnalysisColumn(field='scaled_momentum_norm', symbol='s‖P(n)‖', unit='scale-dependent')), plot=AnalysisPlotPreset(x_field='frame', y_fields=('scaled_momentum_norm',), x_label='Frame', y_label='Scaled momentum norm', legends=('Total momentum',)))