histogram module

class pyIsoP.histo.histo(nbins=50, E_max=1, normed_flag=True)

Bases: object

  • Functions to calculate or read the energy histogram of amaterial

cube2histo(hist_obj)

Convert cube file to histogram, .cube file maybe generated using Prof. Cory Simon’s code in Julia.

Parameters
  • cube_filename (str) – path to the cube file generated by Prof. Cory Simon’s code

  • hist_obj (instance of the histo class) – contains all the info regarding the energy histogram of sites for a given material

Raises

One has to initialize the histogram object before calling this function.

pandas could throw up if the file is not formatted correctly. Refer documentation page

Return type

instance of the histo class.

file2histo(hist_obj)

Read the histogram in from a file with no header and two columns

Parameters
  • histo_filename (str) – path to the histogram text file with two columns, keep the energy dimensionless to avoid confusion.

  • hist_obj (instance of the histo class) – contains all the info regarding the energy histogram of sites for a given material

Raises

One has to initialize the histogram object before calling this function.

pandas could throw up if the file is not formatted correctly. Refer examples section in the documentation.

Return type

histogram object with the energies and their densities updated

grid2histo(hist_obj)

Calculate histogram from PyIsoP grid object

Parameters
  • grid_obj (An instance of the grid3D class) – Contains energy info on a 3D grid

  • hist_obj (An instance of the histo class) – Will be modified and overwritten with energy and density of sites info

Raises

Return type

Modified histogram object with E and RhoE.

gridtotal2histo(hist_obj)

Calculate histogram from PyIsoP grid object using the total energy (bead + sphere sampling + disc sampling)

Parameters
  • grid_obj (An instance of the grid3D class) – Contains energy info on a 3D grid

  • hist_obj (An instance of the histo class) – Will be modified and overwritten with energy and density of sites info

Raises

Return type

Modified histogram object with E and RhoE.

raspa2histo(hist_obj)

Calculate histogtram from the RASPA generated grid file, Ben Bucior’s version find it here:

:type grid_file:str :param grid_file: Path to the grid file generated by RASPA. Grid file format x y z energy dE/dx dE/dy dE/dz.

Parameters

hist_obj (instance of the histo class.) – contains all the info regarding the energy distribution of sites for a given material.

Raises

One has to initialize the histogram object before calling this function

shouldn’t raise any error if the .grid file is from the RASPA version published along with PyIsoP which is x y z E dEx dEy dEz (last three optional), no header lines.

Return type

histogram object with the energies and their densities updated