Utility functions

Utility functions#

Utility functions for handling ALF HDF5 files.

py_alf.utils.bin_count(filename)#

Count number of bins in the given ALF HDF5 file.

Assumes all observables have the same number of bins.

Parameters:
filename: str

Name of HDF5 file.

py_alf.utils.del_bins(filename, N0, N)#

Delete N bins in all observables of the specified HDF5-file.

Parameters:
filename: str

Name of HDF5 file.

N0: int

Number of first N0 bins to keep.

N: int

Number of bins to remove after first N0 bins.

py_alf.utils.find_sim_dirs(root_in='.')#

Find directories containing a file named ‘data.h5’.

Parameters:
root_inpath-like object, default=’.’

Root directory from where to start searching.

Returns:
list of directory names.
py_alf.utils.show_obs(filename)#

Show observables and their number of bins in the given ALF HDF5 file.

Parameters:
filename: str

Name of HDF5 file.

\(\phantom{\xi}\)