Changeset 1917
- Timestamp:
- Jul 1, 2015 3:36:09 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASII.py
r1915 r1917 833 833 UseList[histoName] = SetDefaultDData(reflData['Type'],histoName) 834 834 G,g = G2lat.cell2Gmat(generalData['Cell'][1:7]) 835 UseList[histoName]['Twins'] = [[np.array([[1,0,0],[0,1,0],[0,0,1]]),[1.0,False]],] 836 for iT in range(reflData.get('TwMax',0)): 837 UseList[histoName]['Twins'].append([False,0.0]) 835 if 'TwMax' in reflData: #nonmerohedral twins present 836 UseList[histoName]['Twins'] = [] 837 for iT in range(reflData['TwMax'][0]+1): 838 if iT in reflData['TwMax'][1]: 839 UseList[histoName]['Twins'].append([False,0.0]) 840 else: 841 UseList[histoName]['Twins'].append([np.array([[1,0,0],[0,1,0],[0,0,1]]),[1.0,False]]) 842 else: #no nonmerohedral twins 843 UseList[histoName]['Twins'] = [[np.array([[1,0,0],[0,1,0],[0,0,1]]),[1.0,False]],] 838 844 for iref,ref in enumerate(reflData['RefList']): 839 845 hkl = ref[:3] -
trunk/GSASIIgrid.py
r1915 r1917 1577 1577 usrrej.Bind(wx.EVT_KILL_FOCUS,OnUsrRej) 1578 1578 LSSizer.Add(usrrej,0,WACV) 1579 Hfix = wx.CheckBox(G2frame.dataDisplay,-1,label='Regularize H atoms? ')1580 Hfix.SetValue(data['HatomFix'])1581 Hfix.Bind(wx.EVT_CHECKBOX,OnHatomFix)1579 # Hfix = wx.CheckBox(G2frame.dataDisplay,-1,label='Regularize H atoms? ') 1580 # Hfix.SetValue(data['HatomFix']) 1581 # Hfix.Bind(wx.EVT_CHECKBOX,OnHatomFix) 1582 1582 # LSSizer.Add(Hfix,0,WACV) #for now 1583 1583 return LSSizer -
trunk/GSASIIphsGUI.py
r1915 r1917 3913 3913 {'Tbar':0.1,'Cos2TM':0.955,'Eg':[1.e-7,False],'Es':[1.e-7,False],'Ep':[1.e-7,False]},], 3914 3914 'Flack':[0.0,False],'Twins':[[np.array([[1,0,0],[0,1,0],[0,0,1]]),[1.0,False]],]} 3915 for iT in range(reflData.get('TwMax',0)): 3916 UseList[histoName]['Twins'].append([False,0.0]) 3915 if 'TwMax' in reflData: #nonmerohedral twins present 3916 UseList[histoName]['Twins'] = [] 3917 for iT in range(reflData['TwMax'][0]): 3918 if iT in reflData['TwMax'][1]: 3919 UseList[histoName]['Twins'].append([False,0.0]) 3920 else: 3921 UseList[histoName]['Twins'].append([np.array([[1,0,0],[0,1,0],[0,0,1]]),[1.0,False]]) 3922 else: #no nonmerohedral twins 3923 UseList[histoName]['Twins'] = [[np.array([[1,0,0],[0,1,0],[0,0,1]]),[1.0,False]],] 3917 3924 UpdateHKLFdata(histoName) 3918 3925 data['Histograms'] = UseList -
trunk/GSASIIspc.py
r1873 r1917 69 69 SysSym = ('triclinic','monoclinic','orthorhombic','tetragonal','rhombohedral','trigonal','hexagonal','cubic') 70 70 SGData = {} 71 SGSymbol = SGSymbol.replace(':',' ') #get rid of ':' in R space group symbols from some cif files 71 72 SGInfo = pyspg.sgforpy(SGSymbol) 72 73 SGData['SpGrp'] = SGSymbol.strip().lower().capitalize() -
trunk/GSASIIstrIO.py
r1915 r1917 2264 2264 hapVary.append(pfx+'Flack') 2265 2265 sumTwFr = 0. 2266 controlDict[pfx+'TwinLaw'] = [] 2266 controlDict[pfx+'TwinLaw'] = [] 2267 controlDict[pfx+'TwinInv'] = [] 2267 2268 for it,twin in enumerate(Twins): 2268 2269 if 'bool' in str(type(twin[0])): 2270 controlDict[pfx+'TwinInv'].append(twin[0]) 2269 2271 controlDict[pfx+'TwinLaw'].append(np.zeros((3,3))) 2270 2272 else: 2273 controlDict[pfx+'TwinInv'].append(False) 2271 2274 controlDict[pfx+'TwinLaw'].append(twin[0]) 2272 2275 if it: … … 2298 2301 for it,twin in enumerate(Twins): 2299 2302 if 'bool' in str(type(twin[0])): 2300 print >>pFile,' Nonmerohedral twin fr.: %5.3f Refine? '%(hapDict[pfx+'TwinFr:'+str(it)]),Twins[0][1][1]2303 print >>pFile,' Nonmerohedral twin fr.: %5.3f Inv? %s Refine? '%(hapDict[pfx+'TwinFr:'+str(it)],str(controlDict[pfx+'TwinInv'][it])),Twins[0][1][1] 2301 2304 else: 2302 2305 print >>pFile,' Twin law: %s'%(str(twin[0]).replace('\n',',')),' Twin fr.: %5.3f Refine? '%(hapDict[pfx+'TwinFr:'+str(it)]),Twins[0][1][1] -
trunk/GSASIIstrMath.py
r1915 r1917 823 823 TwinLaw = calcControls[phfx+'TwinLaw'] 824 824 TwinFr = np.array([parmDict[phfx+'TwinFr:'+str(i)] for i in range(len(TwinLaw))]) 825 TwinInv = list(np.where(calcControls[phfx+'TwinInv'],-1,1)) 825 826 Tdata,Mdata,Fdata,Xdata,dXdata,IAdata,Uisodata,Uijdata = GetAtomFXU(pfx,calcControls,parmDict) 826 827 FF = np.zeros(len(Tdata)) … … 860 861 if iref in TwDict: 861 862 for i in TwDict[iref]: 862 H[ir][i] = TwDict[iref][i]863 H[ir][i] = np.array(TwDict[iref][i])*TwinInv[i] 863 864 TwMask = np.any(H,axis=-1) 864 865 SQ = 1./(2.*refl.T[4])**2 #array(blkSize) … … 924 925 TwinLaw = calcControls[phfx+'TwinLaw'] 925 926 TwinFr = np.array([parmDict[phfx+'TwinFr:'+str(i)] for i in range(len(TwinLaw))]) 927 TwinInv = list(np.where(calcControls[phfx+'TwinInv'],-1,1)) 926 928 nTwin = len(TwinLaw) 927 929 nRef = len(refDict['RefList']) … … 956 958 if iref in TwDict: 957 959 for i in TwDict[iref]: 958 H[i] = TwDict[iref][i]960 H[i] = np.array(TwDict[iref][i])*TwinInv[i] 959 961 TwMask = np.any(H,axis=-1) 960 962 SQ = 1./(2.*refl[4])**2 # or (sin(theta)/lambda)**2 -
trunk/imports/G2sfact.py
r1915 r1917 136 136 def __init__(self): 137 137 if 'linux' in sys.platform: # wx 3.0.0.0 on gtk does not like Unicode in menus 138 formatName = 'S HELXHKLF 5 F2 Tw/Incom'139 longFormatName = 'S HELXHKLF 5 [hklm, Fo2, sig(Fo2), Tind] Twin/incommensurate structure factor text file'138 formatName = 'Shelx HKLF 5 F2 Tw/Incom' 139 longFormatName = 'Shelx HKLF 5 [hklm, Fo2, sig(Fo2), Tind] Twin/incommensurate structure factor text file' 140 140 else: 141 formatName = u'S HELXHKLF 5 F\u00b2 Tw/Incom'142 longFormatName = u'S HELXHKLF 5 [hklm, Fo\u00b2, sig(Fo\u00b2), Tind] Twin/incommensurate structure factor text file'141 formatName = u'Shelx HKLF 5 F\u00b2 Tw/Incom' 142 longFormatName = u'Shelx HKLF 5 [hklm, Fo\u00b2, sig(Fo\u00b2), Tind] Twin/incommensurate structure factor text file' 143 143 super(self.__class__,self).__init__( # fancy way to self-reference 144 144 extensionlist=('.hkl','.HKL'), … … 168 168 TwDict = {} 169 169 TwSet = {} 170 TwMax = 0 170 TwMax = [-1,[]] 171 first = True 171 172 try: 172 173 for line,S in enumerate(filepointer): … … 184 185 break 185 186 if '-' in Tw: 187 if Tw == '-1': #fix reversed twin ids 188 Tw = '-2' 189 if first: 190 self.warnings += '\nPrimary twin id changed to 1' 191 first = False 186 192 TwId = -int(Tw)-1 187 TwMax = max(TwMax,TwId) 188 TwSet[TwId] = [h,k,l] 193 TwSet[TwId] = np.array([h,k,l]) 194 if TwId not in TwMax[1]: 195 TwMax[1].append(TwId) 189 196 else: 197 if Tw != '1': #fix reversed twin ids 198 Tw = '1' 199 TwId = int(Tw)-1 190 200 if TwSet: 191 201 TwDict[len(self.RefDict['RefList'])] = TwSet … … 198 208 elif self.Super == 1: 199 209 self.RefDict['RefList'].append([h,k,l,m1,int(Tw),0,Fo,sigFo,0,Fo,0,0,0]) 210 TwMax[0] = max(TwMax[0],TwId) 200 211 self.errors = 'Error after reading reflections (unexpected!)' 201 212 self.RefDict['RefList'] = np.array(self.RefDict['RefList'])
Note: See TracChangeset
for help on using the changeset viewer.