From abcc7f0ba45e6277f609414e491d4ffa8631bfc4 Mon Sep 17 00:00:00 2001 From: Saransh Singh Date: Mon, 31 Jan 2022 13:24:04 -0800 Subject: [PATCH 1/3] check if tThWidth is present in planeData before trying to convert to degrees. --- hexrd/material.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hexrd/material.py b/hexrd/material.py index 44d7f4503..028893aea 100644 --- a/hexrd/material.py +++ b/hexrd/material.py @@ -731,7 +731,10 @@ def dump_material(self, file, path=None): AtomInfo['stiffness'] = self.unitcell.stiffness AtomInfo['hkls'] = self.planeData.getHKLs() AtomInfo['dmin'] = self.unitcell.dmin - AtomInfo['tThWidth'] = numpy.degrees(self.planeData.tThWidth) + if self.planeData.tThWidth is None: + AtomInfo['tThWidth'] = Material.DFLT_TTH + else: + AtomInfo['tThWidth'] = numpy.degrees(self.planeData.tThWidth) ''' lattice parameters ''' From 822f9cf4ee3fe9b454e93508152361e403c3aa30 Mon Sep 17 00:00:00 2001 From: Patrick Avery Date: Tue, 1 Feb 2022 14:39:16 -0600 Subject: [PATCH 2/3] Remove trailing white space Signed-off-by: Patrick Avery --- hexrd/material.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hexrd/material.py b/hexrd/material.py index 028893aea..62939cea4 100644 --- a/hexrd/material.py +++ b/hexrd/material.py @@ -385,8 +385,8 @@ def compute_powder_overlay(self, scale=1.0): """ this function computes a simulated spectra - for using in place of lines for the powder - overlay. inputs are simplified as compared + for using in place of lines for the powder + overlay. inputs are simplified as compared to the typical LeBail/Rietveld computation. only a fwhm (in degrees) and scale are passed From a3b091aa4065a2029de1495020c575609bbe7141 Mon Sep 17 00:00:00 2001 From: Patrick Avery Date: Tue, 1 Feb 2022 14:39:54 -0600 Subject: [PATCH 3/3] Convert Material.DFLT_TTH to degrees before dump This needs to be in degrees. Signed-off-by: Patrick Avery --- hexrd/material.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hexrd/material.py b/hexrd/material.py index 62939cea4..e8b8f0ce1 100644 --- a/hexrd/material.py +++ b/hexrd/material.py @@ -732,7 +732,7 @@ def dump_material(self, file, path=None): AtomInfo['hkls'] = self.planeData.getHKLs() AtomInfo['dmin'] = self.unitcell.dmin if self.planeData.tThWidth is None: - AtomInfo['tThWidth'] = Material.DFLT_TTH + AtomInfo['tThWidth'] = numpy.degrees(Material.DFLT_TTH) else: AtomInfo['tThWidth'] = numpy.degrees(self.planeData.tThWidth) '''