diff --git a/hexrd/constants.py b/hexrd/constants.py index 409e4953a..fa92fbcc7 100644 --- a/hexrd/constants.py +++ b/hexrd/constants.py @@ -1159,6 +1159,9 @@ def is_writable_file(path): 'td': '2dm', 'oh': '3dgh' } +# The above dict must be in the correct order for this to work +SYM_PG_to_PGNUM = {pg: i + 1 for i, pg in enumerate(SYM_GL_PG)} +SYM_PGNUM_to_PG = {v: k for k, v in SYM_PG_to_PGNUM.items()} # Set the __version__ variable try: diff --git a/hexrd/material.py b/hexrd/material.py index ff2802edc..029cbe52b 100644 --- a/hexrd/material.py +++ b/hexrd/material.py @@ -852,6 +852,11 @@ def _set_sgnum(self, v): sgnum = property(_get_sgnum, _set_sgnum, None, "Space group number") + + @property + def pgnum(self): + return self.unitcell.pgnum + # property: beamEnergy def _get_beamEnergy(self): diff --git a/hexrd/unitcell.py b/hexrd/unitcell.py index 8dd72ff08..094981dc2 100644 --- a/hexrd/unitcell.py +++ b/hexrd/unitcell.py @@ -1661,6 +1661,14 @@ def sgnum(self, val): self.CalcDensity() self.calc_absorption_length() + @property + def pgnum(self): + return constants.SYM_PG_to_PGNUM[self.point_group] + + @property + def point_group(self): + return self._pointGroup + @property def atom_pos(self): return self._atom_pos