Skip to content

Commit e4d06f2

Browse files
committed
better fix for #4
1 parent 6a3ec1b commit e4d06f2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

phonopy_vibspec/phonons_analyzer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
from phonopy.units import VaspToCm # noqa
1414
except ImportError:
1515
from phonopy.physical_units import get_physical_units
16+
physical_units = get_physical_units()
17+
VaspToCm = physical_units.DefaultToTHz * physical_units.THzToCm
1618

1719
from phonopy_vibspec.spectra import RamanSpectrum, InfraredSpectrum
1820
from phonopy_vibspec.vesta import VestaVector, make_vesta_file
@@ -24,8 +26,6 @@
2426

2527
HUGE_MASS = 10000 # AMU
2628

27-
physical_units = get_physical_units()
28-
2929
l_logger = logger.getChild(__name__)
3030

3131

@@ -70,7 +70,7 @@ def __init__(
7070
self.N = self.structure.get_number_of_atoms()
7171
l_logger.info('Analyze {} modes (including acoustic)'.format(3 * self.N))
7272
self.frequencies = numpy.sqrt(numpy.abs(eigv.real)) * numpy.sign(eigv.real)
73-
self.frequencies *= physical_units.DefaultToTHz * physical_units.THzToCm # in [cm⁻¹]
73+
self.frequencies *= VaspToCm # in [cm⁻¹]
7474

7575
if self.frequencies[0] < -30:
7676
l_logger.warn('The first frequency is very small: {:.3f} cm⁻¹'.format(self.frequencies[0]))

0 commit comments

Comments
 (0)