Support for parsing check and castep_bin files would be very useful. Some properties are not printed in the text .castep output or at least for a high precision (e.g. forces).
We can search through the Fortran records inside the binary files for certain header contains (CHAR of length < 256), record the position of the headers in the first pass and read required properties in a second pass.
This would probably require us to implement a FortranRecord class for handling the record markers and contents.
The immediate use case would be for parsing high-quality forces for external finite-difference phonons using tools such as phonopy and when integrated with AiiDA (for aiida-castep and aiida-phononpy).
Many more quantities can also be extracted and opening up more post-processing opportunities.
c2x, but it is written in C, and only for certain properties.
There is a useful Fortran file parsing package implemented for Julia: https://traktofon.github.io/FortranFiles.jl/v0.4/. We can use similar concepts (e.g. similar to the Record type). Sub-record support can be useful but not mandatory as a single record size from CASTEP is not expected to exceed 2GB.
NOTE: castep binary files are big-endian (enforced at compile time).
Support for parsing
check
andcastep_bin
files would be very useful. Some properties are not printed in the text.castep
output or at least for a high precision (e.g. forces).We can search through the Fortran records inside the binary files for certain header contains (CHAR of length < 256), record the position of the headers in the first pass and read required properties in a second pass.
This would probably require us to implement a
FortranRecord
class for handling the record markers and contents.The immediate use case would be for parsing high-quality forces for external finite-difference phonons using tools such as phonopy and when integrated with AiiDA (for aiida-castep and aiida-phononpy).
Many more quantities can also be extracted and opening up more post-processing opportunities.
Existing binary parsing utilities:
c2x
, but it is written in C, and only for certain properties.There is a useful Fortran file parsing package implemented for Julia: https://traktofon.github.io/FortranFiles.jl/v0.4/. We can use similar concepts (e.g. similar to the
Record
type). Sub-record support can be useful but not mandatory as a single record size from CASTEP is not expected to exceed 2GB.NOTE: castep binary files are
big-endian
(enforced at compile time).