Changeset 1918
- Timestamp:
- Jul 2, 2015 12:30:08 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASII.py
r1917 r1918 839 839 UseList[histoName]['Twins'].append([False,0.0]) 840 840 else: 841 UseList[histoName]['Twins'].append([np.array([[1,0,0],[0,1,0],[0,0,1]]),[1.0,False ]])841 UseList[histoName]['Twins'].append([np.array([[1,0,0],[0,1,0],[0,0,1]]),[1.0,False,reflData['TwMax'][0]]]) 842 842 else: #no nonmerohedral twins 843 UseList[histoName]['Twins'] = [[np.array([[1,0,0],[0,1,0],[0,0,1]]),[1.0,False ]],]843 UseList[histoName]['Twins'] = [[np.array([[1,0,0],[0,1,0],[0,0,1]]),[1.0,False,0]],] 844 844 for iref,ref in enumerate(reflData['RefList']): 845 845 hkl = ref[:3] -
trunk/GSASIIddataGUI.py
r1915 r1918 783 783 twinVal = 0.0 784 784 UseList[G2frame.hist]['Twins'].append([twinMat,twinVal]) 785 nNonM = UseList[G2frame.hist]['Twins'][0][1][2] 786 for i in range(nNonM): 787 UseList[G2frame.hist]['Twins'].append([False,0.0]) 785 788 addtwin.SetValue(False) 786 789 wx.CallLater(100,RepaintHistogramInfo) … … 826 829 Obj = event.GetEventObject() 827 830 it = Indx[Obj.GetId()] 831 nNonM = UseList[G2frame.hist]['Twins'][0][1][2] 832 for i in range(nNonM): 833 del UseList[G2frame.hist]['Twins'][1+i+it] 828 834 del UseList[G2frame.hist]['Twins'][it] 829 835 sumTw = 0. … … 836 842 wx.CallLater(100,RepaintHistogramInfo) 837 843 844 nTwin = len(UseList[G2frame.hist]['Twins']) 838 845 twinsizer = wx.BoxSizer(wx.VERTICAL) 839 846 topsizer = wx.BoxSizer(wx.HORIZONTAL) 840 847 topsizer.Add(wx.StaticText(DData,wx.ID_ANY,' Merohedral twins: '),0,WACV) 841 addtwin = wx.CheckBox(DData,wx.ID_ANY,label=' Add Twin Law') 842 addtwin.Bind(wx.EVT_CHECKBOX, OnAddTwin) 843 topsizer.Add(addtwin,0,WACV) 848 #temporary - add twin not allowed if nonmerohedral twins present 849 if nTwin == 1 or 'bool' not in str(type(UseList[G2frame.hist]['Twins'][1][0])): 850 addtwin = wx.CheckBox(DData,wx.ID_ANY,label=' Add Twin Law') 851 addtwin.Bind(wx.EVT_CHECKBOX, OnAddTwin) 852 topsizer.Add(addtwin,0,WACV) 844 853 twinsizer.Add(topsizer) 845 854 Indx = {} 846 nTwin = len(UseList[G2frame.hist]['Twins'])847 855 if nTwin > 1: 848 856 for it,Twin in enumerate(UseList[G2frame.hist]['Twins']): -
trunk/GSASIIphsGUI.py
r1917 r1918 3912 3912 'Extinction':['Lorentzian','None', 3913 3913 {'Tbar':0.1,'Cos2TM':0.955,'Eg':[1.e-7,False],'Es':[1.e-7,False],'Ep':[1.e-7,False]},], 3914 'Flack':[0.0,False],'Twins':[[np.array([[1,0,0],[0,1,0],[0,0,1]]),[1.0,False ]],]}3914 'Flack':[0.0,False],'Twins':[[np.array([[1,0,0],[0,1,0],[0,0,1]]),[1.0,False,0]],]} 3915 3915 if 'TwMax' in reflData: #nonmerohedral twins present 3916 3916 UseList[histoName]['Twins'] = [] 3917 for iT in range(reflData['TwMax'][0] ):3917 for iT in range(reflData['TwMax'][0]+1): 3918 3918 if iT in reflData['TwMax'][1]: 3919 3919 UseList[histoName]['Twins'].append([False,0.0]) 3920 3920 else: 3921 UseList[histoName]['Twins'].append([np.array([[1,0,0],[0,1,0],[0,0,1]]),[1.0,False ]])3921 UseList[histoName]['Twins'].append([np.array([[1,0,0],[0,1,0],[0,0,1]]),[1.0,False,reflData['TwMax'][0]]]) 3922 3922 else: #no nonmerohedral twins 3923 UseList[histoName]['Twins'] = [[np.array([[1,0,0],[0,1,0],[0,0,1]]),[1.0,False ]],]3923 UseList[histoName]['Twins'] = [[np.array([[1,0,0],[0,1,0],[0,0,1]]),[1.0,False,0]],] 3924 3924 UpdateHKLFdata(histoName) 3925 3925 data['Histograms'] = UseList -
trunk/GSASIIstrIO.py
r1917 r1918 2258 2258 if hapData['Babinet'][bab][1]: 2259 2259 hapVary.append(pfx+bab) 2260 Twins = hapData.get('Twins',[[np.array([[1,0,0],[0,1,0],[0,0,1]]),[1.0,False ]],])2260 Twins = hapData.get('Twins',[[np.array([[1,0,0],[0,1,0],[0,0,1]]),[1.0,False,0]],]) 2261 2261 if len(Twins) == 1: 2262 2262 hapDict[pfx+'Flack'] = hapData.get('Flack',[0.,False])[0] -
trunk/GSASIIstrMath.py
r1917 r1918 856 856 H = np.squeeze(np.inner(H.T,TwinLaw)) #maybe array(blkSize,nTwins,3) or (blkSize,3) 857 857 TwMask = np.any(H,axis=-1) 858 if TwinLaw.shape[0] > 1 and TwDict: 858 if TwinLaw.shape[0] > 1 and TwDict: #need np.inner(TwinLaw[?],TwDict[iref][i])*TwinInv[i] 859 859 for ir in range(blkSize): 860 860 iref = ir+iBeg … … 1037 1037 dFdua[iref] = TwMask[:,np.newaxis,np.newaxis]*[SA[it]*(dfadua[it][0]+dfbdua[it][1])+SB[it]*(dfbdua[it][0]+dfadua[it][1]) for it in range(nTwin)] 1038 1038 dFdtw[iref] = TwMask*np.sum(fas,axis=0)**2+np.sum(fbs,axis=0)**2 1039 else: 1039 else: #these are good for no twin single crystals 1040 1040 dFdfr[iref] = 2.*SA*(dfadfr[0]+dfbdfr[1])*Mdata/len(Uniq)+ \ 1041 1041 2.*SB*(dfbdfr[0]+dfadfr[1])*Mdata/len(Uniq)
Note: See TracChangeset
for help on using the changeset viewer.