Skip to content

Commit cf06e58

Browse files
committed
Merge remote-tracking branch 'remotes/origin/main'
2 parents 6808f9d + 656b7f9 commit cf06e58

File tree

3 files changed

+30
-24
lines changed

3 files changed

+30
-24
lines changed

GSASII/GSASIIddataGUI.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,9 @@ def OnHstrainRef(event):
464464
for txt,fmt,ifEdit,Id in zip(*useGUI[2:]):
465465
if cellstr: cellstr += ", "
466466
cellstr += txt+fmt.format(cell[Id])
467-
cellstr += ', Vol = {:.3f}'.format(G2lat.calc_V(newA))
467+
cellstr += f', Vol = {G2lat.calc_V(newA):.3f}'
468+
den = G2mth.getDensity(data['General'],G2frame.hist,data)[0]
469+
cellstr += f', \u03C1 = {den:.3f}'
468470
hSizer.Add(wx.StaticText(DData,wx.ID_ANY,' '+cellstr),0)
469471
return hSizer
470472

GSASII/GSASIImath.py

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,16 +1551,31 @@ def getMass(generalData):
15511551
mass += generalData['NoAtoms'][elem]*generalData['AtomMass'][i]
15521552
return max(mass,1.0)
15531553

1554-
def getDensity(generalData):
1555-
'''calculate crystal structure density
1554+
def getDensity(generalData,hist=None,data=None):
1555+
'''Calculate crystal structure density. Uses cell values only,
1556+
unless hist & data are supplied. In that case it uses
1557+
the Dij terms as well.
15561558
15571559
:param dict generalData: The General dictionary in Phase
1558-
1559-
:returns: float density: crystal density in gm/cm^3
1560-
1560+
:param str hist: optional name of a histogram. When not None,
1561+
the volume adjusted bt the Dij (hydrostatic strain terms) is
1562+
used to compute the density.
1563+
:parm dict data: reference to entire phase data array. Required
1564+
if hist is specified. Ignored otherwise.
1565+
:returns: crystal density in gm/cm^3 (float) and Matthews Coeff.
1566+
(Vm or Volume/mass, float)
15611567
'''
15621568
mass = getMass(generalData)
15631569
Volume = generalData['Cell'][7]
1570+
if hist is not None: # recompute the density using Dij terms
1571+
if data is None:
1572+
print('called getDensity with hist and without data')
1573+
raise Exception('Called getDensity with hist and without data')
1574+
A = G2lat.cell2A(data['General']['Cell'][1:7])
1575+
DijVals = data['Histograms'][hist]['HStrain'][0][:]
1576+
# apply the Dij values to the reciprocal cell
1577+
newA = G2lat.AplusDij(A,DijVals,data['General']['SGData'])
1578+
Volume = G2lat.calc_V(newA)
15641579
density = mass/(0.6022137*Volume)
15651580
return density,Volume/mass
15661581

GSASII/git_verinfo.py

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
# -*- coding: utf-8 -*-
22
# git_verinfo.py - GSAS-II version info from git
3-
<<<<<<< Updated upstream
4-
# Do not edit, generated by 'GSASII/install/incr-version.py minor' script
5-
# Created 2025-07-31 16:37:58.847433-05:00
3+
# Do not edit, generated by 'install/incr-version.py' script
4+
# Created 2025-08-18 10:06:40.316083-05:00
65

7-
git_version = '90f789a9efa659dd571ed0e0477f50d1ced278b6'
8-
git_tags = ['5818']
9-
git_prevtaggedversion = 'ff0a44f7798ce1024c75f4cbc02e5281ef726a83'
10-
git_prevtags = ['5817']
11-
git_versiontag = 'v5.5.0'
12-
=======
13-
# Do not edit, generated by 'GSASII/install/incr-version.py' script
14-
# Created 2025-07-11 11:47:43.046289-05:00
15-
16-
git_version = 'ff0a44f7798ce1024c75f4cbc02e5281ef726a83'
17-
git_tags = ['5817']
18-
git_prevtaggedversion = '0ea8a2dd0eddc87da8f6494f19a5023b41af5daa'
19-
git_prevtags = ['5816']
20-
git_versiontag = 'v5.4.10'
21-
>>>>>>> Stashed changes
6+
git_version = '5cff9c42e599d42707f6051d5e3b8cadc7de7a4c'
7+
git_tags = ['5819']
8+
git_prevtaggedversion = '90f789a9efa659dd571ed0e0477f50d1ced278b6'
9+
git_prevtags = ['5818']
10+
git_versiontag = 'v5.5.1'

0 commit comments

Comments
 (0)