vacf_input_file_reader
A module containing a class to read input files to setup the
VACF class.
Summary
Classes:
A class to read input files to setup the |
Reference
- class VACFInputFileReader(filename: str)[source]
Bases:
PQAnalysisInputFileReaderA class to read input files to setup the
VACFclass.For the VACF analysis input file several keys are available of which some are required and some are optional. For more details on the grammar and syntax of the input file see Input File.
Required keys Key
Value
traj_files
The velocity trajectory files to read. This can be a single file or a list of files.
target_selection
The selection string to select the atoms for which the VACF is calculated. For more details see
Selection.out_file
The output file to write the VACF data to. It must not exist yet.
time_step
The time step between two frames in ps. It is used to build the time axis of the VACF and the frequency axis of the spectrum.
Optional keys Key
Value
window
The correlation window size in frames. Default is 1000. It has to be an integer multiple of the gap.
gap
The gap between two time origins in frames. Default is 1.
method
The VACF estimator, either “direct” (legacy-exact sliding origins, default) or “fft” (denser-origin Wiener-Khinchin estimator, ignores the gap).
charge_file
A static charge file for the charge-flux mode. The file consists of a header line with the number of atoms, a comment line and one “name charge” line per atom.
charge_files
Charge trajectory files (.chrg) for the charge-flux mode with time-dependent charges, read in lockstep with the velocity trajectory. Cannot be combined with charge_file.
spectrum_file
The output file for the cosine-transform spectrum of the VACF. If not given, no spectrum is calculated.
ftsize
The Fourier transform point size of the spectrum. The VACF is zero-padded (or truncated) to this size. Default is 2000.
window_function
The apodization window function of the spectrum, one of “none”, “exponential”, “hann” and “blackman”. Default is “none”.
window_param
The decay coefficient of the exponential window. Default is 4.0.
window_start
The time in ps at which the apodization window starts to decay. Default is 0.0.
window_stop
The time in ps at which the apodization window becomes zero. Default is 1000.0.
windowed_out_file
The output file for the windowed VACF. Can only be used together with spectrum_file.
log_file
The log file to write the log information to.
use_full_atom_info
Whether to use full atom information for the selections.
Note
The VACF output file follows the legacy FreqCalc format: one row per lag with the columns lag time in ps and normalized VACF. The spectrum output file follows the legacy ft.f format: one row per frequency index with the columns wavenumber in cm^-1 and amplitude.
- Parameters:
filename (str) – the filename of the input file
- read()[source]
Reads the input file and parses it. It also sets the raw_input_file and the dictionary. It checks if all required keys are set and if all keys are known.
- Raises:
InputFileError – if not all required keys are set in the input file
InputFileWarning – if unknown keys are set in the input file
InputFileError – if both a static charge file and charge trajectory files are given
InputFileError – if a windowed output file is requested without a spectrum file
InputFileError – if the window function is unknown
- property charge_file: str | None
The static charge file for the charge-flux mode.
- Type:
str | None
- charge_file_key = 'charge_file'
- property charge_files: list[str] | None
The charge trajectory files for the charge-flux mode.
- Type:
List[str] | None
- charge_files_key = 'charge_files'
- property ftsize: PositiveInt | None
The Fourier transform point size.
- Type:
PositiveInt | None
- ftsize_key = 'ftsize'
- property gap: PositiveInt | None
The gap between two time origins in frames.
- Type:
PositiveInt | None
- gap_key = 'gap'
- logger = <CustomLogger PQAnalysis.VACFInputFileReader (INFO)>
- property method: str | None
The VACF estimator method (direct or fft).
- Type:
str | None
- method_key = 'method'
- optional_keys = ['traj_files', 'target_selection', 'out_file', 'time_step', 'window', 'gap', 'method', 'charge_file', 'charge_files', 'spectrum_file', 'ftsize', 'window_function', 'window_param', 'window_start', 'window_stop', 'windowed_out_file', 'log_file', 'use_full_atom_info']
The optional keys of the input file
- Type:
List[str]
- required_keys = ['traj_files', 'target_selection', 'out_file', 'time_step']
The required keys of the input file
- Type:
List[str]
- property spectrum_file: str | None
The output file for the VACF spectrum.
- Type:
str | None
- spectrum_file_key = 'spectrum_file'
- property time_step: PositiveReal | None
The time step between two frames in ps.
- Type:
PositiveReal | None
- time_step_key = 'time_step'
- property window: PositiveInt | None
The correlation window size in frames.
- Type:
PositiveInt | None
- property window_function: str | None
The apodization window function of the spectrum.
- Type:
str | None
- window_function_key = 'window_function'
- window_key = 'window'
- property window_param: PositiveReal | None
The exponential window decay coefficient.
- Type:
PositiveReal | None
- window_param_key = 'window_param'
- property window_start: PositiveReal | None
The window start time in ps.
- Type:
PositiveReal | None
- window_start_key = 'window_start'
- property window_stop: PositiveReal | None
The window stop time in ps.
- Type:
PositiveReal | None
- window_stop_key = 'window_stop'
- property windowed_out_file: str | None
The output file for the windowed correlation function.
- Type:
str | None
- windowed_out_file_key = 'windowed_out_file'