postmd.avetime package
Submodules
postmd.avetime.avetime module
- class postmd.avetime.avetime.AveTime(path=None, timestep: float = 1.0)[source]
Bases:
MDFile
process the data generated from “fix ave/time” command in LAMMPS (see https://docs.lammps.org/fix_ave_time.html).
- Parameters:
path (str, optional) – path to the file. Defaults to
None
.timestep (float, optional) – temperature you set in LAMMPS input file. Defaults to
1.0
[fs].
- read_file(header: list | None = None, header_line: int = 2, **kwargs) DataFrame [source]
read file generated from
fix ave/time
command.- Parameters:
header (list, optional) – a list of data headers. Defaults to
None
, means extracting headers fromheader_line
.header_line (int, optional) – when
header=None
, the content inline=<header_line>
will be used as the headers. Defaults to2
.**kwargs – received parameters of pd.read_csv().
- Returns:
DataFrame object read from the file.
- Return type:
pd.DataFrame
Notes
There are some default setting in read files: -
comment="#"
in the files generated byfix ave/time``command in LAMMPS. - ``sep="\s+"
set the separator to\s+
, matching one or more whitespace characters.
- class postmd.avetime.avetime.GreenKubo(path=None, timestep: float = 1.0)[source]
Bases:
AveTime
calculate the auto-correlation function (acf) and corresponding integration for Green-Kubo formula. But you need to pay attention to the true equation of Green-Kubo formula, because this script just do the integration of acf, not including other parts, like multiply or divide by some properties.
process the data generated from “fix ave/time” command in LAMMPS (see https://docs.lammps.org/fix_ave_time.html).
- Parameters:
path (str, optional) – path to the file. Defaults to
None
.timestep (float, optional) – temperature you set in LAMMPS input file. Defaults to
1.0
[fs].
- calc_acf(data_type='raw', col: int | None = None, nlag: int | None = None, nlag_col: int = 1, unit_trans=1.0) ndarray [source]
calculate the acf from data file and store in
self.nlag
andself.acf
.- Parameters:
data_type (str, optional) – the data type of self.data (raw or acf). Defaults to
"raw"
.col (int or str, optional) – the column number(start from 0) of data to process in self.data. Defaults to
None
.nlag (int, optional) – Limit the number of autocovariances returned. Size of returned array is nlag + 1. Defaults to
None
.nlag_col (int, optional) – the column number(start from
0
) of nlag in data, usually named “TimeDelta”. Defaults to1
.unit_trans (float, optional) – transform the unit of property to SI unit. Defaults to
1.0
.
- Returns:
None
- integrate_acf(nlag=None, acf=None, *, method='trap')[source]
Integrate the acf data to the Green-Kubo formula and store in
self.int_acf
.- Parameters:
nlag (np.ndarray, optional) – the nlag data. Defaults to
None
.acf (np.ndarray, optional) – the acf data. Defaults to
None
.method (str, optional) – the integration method (
"simpson"
or"trap"
). Defaults to"trap"
.