コード例 #1
0
    def set_powder():
        material = HexrdConfig().material(overlay['material'])
        prev_lparms = material.lparms
        material.latticeParameters = values
        lparms = material.lparms

        # Indicate whether the data was modified
        return any(not are_close(x, y) for x, y in zip(prev_lparms, lparms))
コード例 #2
0
    def write_lattice_params_to_materials(self):
        for name, wppf_mat in self.wppf_object.phases.phase_dict.items():
            mat = HexrdConfig().material(name)

            # Convert units from nm to angstroms
            lparms = copy.deepcopy(wppf_mat.lparms)
            for i in range(3):
                lparms[i] *= 10.0

            mat.latticeParameters = lparms
            make_new_pdata(mat)
            HexrdConfig().flag_overlay_updates_for_material(name)

            if mat is HexrdConfig().active_material:
                HexrdConfig().active_material_modified.emit()

        HexrdConfig().overlay_config_changed.emit()
コード例 #3
0
ファイル: wppf_runner.py プロジェクト: HEXRD/hexrdgui
    def write_lattice_params_to_materials(self):
        for name, wppf_mat in self.wppf_object.phases.phase_dict.items():
            mat = HexrdConfig().material(name)

            # Work around differences in WPPF objects
            if isinstance(self.wppf_object, Rietveld):
                lparms = wppf_mat['synchrotron'].lparms
            else:
                lparms = wppf_mat.lparms

            # Convert units from nm to angstroms
            lparms = copy.deepcopy(lparms)
            for i in range(3):
                lparms[i] *= 10.0

            mat.latticeParameters = lparms
            HexrdConfig().flag_overlay_updates_for_material(name)

            if mat is HexrdConfig().active_material:
                HexrdConfig().active_material_modified.emit()

        HexrdConfig().overlay_config_changed.emit()