A dedicated Python script for making smeared C-K edge spectra from the hdf5 dataset of eigenvalues and dynamical structure factors
- Some functions for making Gaussiean smeared spectra database from the hdf5 dataset of eigenvalues and dynamical structure factors
- Commandline interface
ck_edge_maker - Dataset class for Pytorch Geometric
ck_edge_maker.dataset.CK
The hdf5 dataset of eigenvalues and dynamical structure factors will be available along with a data paper
Clone this repository and run pip install:
$ git clone https://github.com/nmdl-mizo/ck_edge_maker.git
$ cd ck_edge_maker
$ pip intall .or directry run pip install:
$ pip install git+https://github.com/nmdl-mizo/ck_edge_makerIf you use the dataset class for PyTorch Geometric, include extras_require pyg:
$ pip install "ck_edge_maker[pyg] @ git+https://github.com/nmdl-mizo/ck_edge_maker"To uninstall, use pip:
$ pip uninstall ck-edge-makerCalculate C-K edge spectra with Gaussian smearing from hdf5 spectral dataset
-
positional arguments:
{site,mol}calculation task, site or molinputpath to the input database hdf5 fileoutputpath to the output hdf5 file
-
optional arguments:
-h, --helpshow this help message and exit--sigma SIGMAGaussian smearing parameter in eV. default 0.3 eV--margin MARGINmargin in eV for sampling energy range. ignored when both min and max is specified. default 3.0 eV--res RESresolution in eV for sampling energy range, default 0.1 eV--min MINminimum energy in eV for sampling energy range--max MAXmaximum energy in eV for sampling energy range--sumcalculate sum of dynamic structure factors for molecular spectra if specified. calculate weighted average if not specified. only valid when task = mol--nototaldo not include total spectra if specified-f, --forceoverwriteOverwrite output file if specified
First, prepare the hdf5 dataset of eigenvalues and dynamical structure factors. The following is an example where the dataset is stored in the current directory with the name "site_eigen_dsf.hdf5".
# Create a hdf5 of molecular spectral dataset named "mol_spectra_0.5eV.hdf5" with 0.5eV Gaussian smearing, 0.1eV sampling step, and 5eV margin
ck_edge_maker mol site_eigen_dsf.hdf5 mol_spectra_0.5eV.hdf5 -f --sigma 0.5 --res 0.1 --margin 5# Create a hdf5 of site specific spectral dataset named "site_spectra_0.5eV.hdf5" with 0.5eV Gaussian smearing, 0.1eV sampling step, and 5eV margin
ck_edge_maker site site_eigen_dsf.hdf5 site_spectra_0.5eV.hdf5 -f --sigma 0.5 --res 0.1 --margin 5The dataset class for Pytorch Geometric is also available from ver.1.1.0.
- Install ck_edge_maker with pyg extras_require
pip install ck_edge_maker[pyg]
- Prepare site specific spectral dataset and place it in "dataset/raw" directory.
- Import CK class
from ck_edge_maker.dataset import CK dataset = CK( root="dataset", energies=(288, 310, 256), directional=True )
- python (=>3)
- h5py
- numpy
- tqdm
- scipy
- torch
- torch_geometric
- kiyou
- Mizoguchi Lab.
The source code is licensed MIT.