示例#1
0
    def get_atomic_displacements(self, direction):

        number_of_bins = self.parameters.number_of_bins_histogram
        direction = np.array(direction)

        projections = trajdist.trajectory_projection(self.dynamic, direction)

        min_val = np.amin(projections)
        max_val = np.amax(projections)

        bins = None
        distributions = []
        for atom in range(projections.shape[0]):
            distribution, bins = np.histogram(projections[atom],
                                              bins=number_of_bins,
                                              range=(min_val, max_val),
                                              normed=True)

            distributions.append(distribution)

        distance = np.array([ i_bin - (bins[1]-bins[0])/2 for i_bin in bins ])

        return np.array(distributions), distance
示例#2
0
calculation.plot_velocity(atoms=[0], coordinates=[2])

#print(structure.get_cell())
#exit()

calculation.write_trajectory_distribution([0, 0, 1], 'distribution.out')

calculation.plot_trajectory_distribution([1, 0, 0])
calculation.plot_trajectory_distribution([0, 1, 0])
calculation.plot_trajectory_distribution([0, 0, 1])

exit()
import dynaphopy.analysis.coordinates as coortest

relative_trajectory = coortest.relativize_trajectory(trajectory)
coortest.trajectory_projection(relative_trajectory, trajectory, np.array([1,0,0]))
coortest.trajectory_projection(relative_trajectory, trajectory, np.array([0,1,0]))
coortest.trajectory_projection(relative_trajectory, trajectory, np.array([0,0,1]))

exit()

#calculation.plot_vc(atoms=[0,1])
#calculation.plot_vq(modes=[0,1,2,3,4])

#print(structure.get_number_of_atoms())

#calculation.print_phonon_dispersion_spectrum()
#calculation.get_phonon_dispersion_spectra()
#calculation.set_band_ranges([[[0.2,0.0,0.2],[0.5,0.5,0.5]], [[0.5, 0.5, 0.5], [0.2, 0.0, 0.2]]])

#spectrum = calculation.get_anharmonic_dispersion_spectra(band_resolution=15)