def test_calculate_dos_with_mode_widths(self, material, qpt_freqs_json,
                                         mode_widths_json,
                                         expected_dos_json, ebins):
     qpt_freqs = get_qpt_freqs(material, qpt_freqs_json)
     with open(os.path.join(get_fc_dir(), mode_widths_json), 'r') as fp:
         modw_dict = json.load(fp)
     mode_widths = modw_dict['mode_widths'] * ureg(
         modw_dict['mode_widths_unit'])
     dos = qpt_freqs.calculate_dos(ebins, mode_widths=mode_widths)
     expected_dos = get_expected_spectrum1d(expected_dos_json)
     check_spectrum1d(dos, expected_dos)
Beispiel #2
0
 def test_calculate_dos(self, material, qpt_ph_modes_file,
                        expected_dos_json, ebins):
     if qpt_ph_modes_file.endswith('.phonon'):
         qpt_ph_modes = QpointPhononModes.from_castep(
             get_castep_path(material, qpt_ph_modes_file))
     else:
         qpt_ph_modes = QpointPhononModes.from_phonopy(
             phonon_name=get_phonopy_path(material, qpt_ph_modes_file))
     dos = qpt_ph_modes.calculate_dos(ebins)
     expected_dos = get_expected_spectrum1d(expected_dos_json)
     check_spectrum1d(dos, expected_dos)
 def test_calculate_dos_with_mode_widths_min(self, material, qpt_freqs_json,
                                             mode_widths_json,
                                             mode_widths_min, ebins):
     qpt_freqs = get_qpt_freqs(material, qpt_freqs_json)
     with open(os.path.join(get_fc_dir(), mode_widths_json), 'r') as fp:
         modw_dict = json.load(fp)
     mode_widths = modw_dict['mode_widths'] * ureg(
         modw_dict['mode_widths_unit'])
     dos = qpt_freqs.calculate_dos(ebins,
                                   mode_widths=mode_widths,
                                   mode_widths_min=mode_widths_min)
     mode_widths = np.maximum(
         mode_widths.magnitude,
         mode_widths_min.to(
             mode_widths.units).magnitude) * mode_widths.units
     expected_dos = qpt_freqs.calculate_dos(ebins, mode_widths=mode_widths)
     check_spectrum1d(dos, expected_dos)
 def test_calculate_dos(self, material, qpt_freqs_json, expected_dos_json,
                        ebins):
     qpt_freqs = get_qpt_freqs(material, qpt_freqs_json)
     dos = qpt_freqs.calculate_dos(ebins)
     expected_dos = get_expected_spectrum1d(expected_dos_json)
     check_spectrum1d(dos, expected_dos)
 def test_calculate_dos(self, material, sf_json, expected_dos_json, ebins):
     sf = get_sf(material, sf_json)
     dos = sf.calculate_dos(ebins)
     expected_dos = get_expected_spectrum1d(expected_dos_json)
     check_spectrum1d(dos, expected_dos)
 def test_calculate_1d_average(self, material, sf_json, expected_1d_json,
                               ebins, kwargs):
     sf = get_sf(material, sf_json)
     sw = sf.calculate_1d_average(ebins, **kwargs)
     expected_sw = get_expected_spectrum1d(expected_1d_json)
     check_spectrum1d(sw, expected_sw)