energy_file_header

Column names and units from the header of PQ energy files.

The header starts the .en file and ends with the column line directly above the data:

# PQ energy file v1.1.0
# timestep = 0.5 fs
#STEP[-] TEMPERATURE[K] PRESSURE[bar] ...

The column line has one NAME[unit] token per data column; comment lines such as the timestep may sit between the first and the last line. The step column STEP[-] is read as the older SIMULATION-TIME[step].

Summary

Functions:

read_energy_header

Read the column names and units from a PQ energy-file header.

Reference

read_energy_header(
filename: str,
) → tuple[dict[str, int], dict[str, str]] | None[source]

Read the column names and units from a PQ energy-file header.

Parameters:

filename (str) – Energy file.

Returns:

Column index and unit per name, in the form of read(), or None if the first line is not # PQ energy file.

Return type:

tuple[dict[str, int], dict[str, str]] | None

Raises:

EnergyFileReaderError – If the column line is missing or malformed.