cube module¶
cube.py
Read a cube file to an array for manipulation. Use the translational symmtry of a supercell to average a cube file into a smaller subsection, eg the unit cell. The number of grid points must be exactly divisible by the folding factors, FX FY FZ.
Modified version for faps, provides Cube object.
-
class
cube.Cube(filename=None, fold=None, debug=False)[source]¶ Bases:
objectContainer for a .cube file. Very specific for folding symmetry.
-
error_name¶ File name with _folded inserted for output.
-
folded_name¶ File name with _folded inserted for output.
-
maxima(sigma=2.0, radius=0.31, cutoff=0.0, write=False)[source]¶ Smooth with gaussian blur then use the spacing to determine nearest neighbours to estimate positions of maxima. Return the cartesian positions of maxima in a tuple with their magnitudes from the smoothed data.
-
read_file(filename=None, fold=None, trim_atoms=True, crop_atoms=False)[source]¶ Read the gridded cubedata and fold
-
smoothed_name¶ File name with _smooth inserted for output.
-
-
cube.compressed_open(filename)[source]¶ Return file objects for either compressed and uncompressed files