zhubonan / castepxbin Goto Github PK
View Code? Open in Web Editor NEWReading binary files generated by CASTEP in Python
License: MIT License
Reading binary files generated by CASTEP in Python
License: MIT License
These should be trivial to read, but knowledge of the number of bands/kpoints/spins are needed in the first place. One can parse the <seed>.bands
file first to get those in the first place.
I can copy the bands parser from aiida-castep into this package to do this.
Hi Bonan Zhu,
First of all Happy New and stay blessed. I am a PhD student and using CASTEP interface in Materials Studio for my research. I want to study the projected band structure of heterostructures but unfortunately there is no such option in Materials Studio. Although, I can calculate the pdos by using OptaDOS of Materials Studio files ( .bands, .cell and .pdos_bin). In a similar way, I tried to use the .band and .cell (from spectral band structure calculation) and .pdos_bin (from pdos calculation because CASTEP interface in Materials Studio doesn't generate the .pdos_bin in spectral band structure calculation). But i got the following error.
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
May be there is some error while reading the .pdos_bin file. Then, I come to know with castepxbin we can read the .pdos_bin file. I am not much familiar with coding. So, i don't know how to use castepxbin to read the .pdos_bin file. Could you please help me in this regards? Thank you in advance.
Looking forward to your kind response.
Best Wishes
Sajid
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.
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).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.