Changeset 1896
- Timestamp:
- Jun 18, 2015 1:25:47 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIstrIO.py
r1894 r1896 201 201 print G2mv.VarRemapShow(varyList,True) 202 202 return errmsg, warnmsg 203 204 def makeTwinFrConstr(Phases,Histograms,hapVary): 205 TwConstr = [] 206 TwFixed = [] 207 for Phase in Phases: 208 pId = Phases[Phase]['pId'] 209 for Histogram in Phases[Phase]['Histograms']: 210 hId = Histograms[Histogram]['hId'] 211 phfx = '%d:%d:'%(pId,hId) 212 if phfx+'TwinFr:0' in hapVary: 213 TwFixed.append('1.0') #constraint value 214 nTwin = len(Phases[Phase]['Histograms'][Histogram]['Twins']) 215 TwConstr.append({phfx+'TwinFr:'+str(i):'1.0' for i in range(nTwin)}) 216 return TwConstr,TwFixed 203 217 204 218 def GetRestraints(GPXfile): -
trunk/GSASIIstrMain.py
r1886 r1896 164 164 calcControls['maxSSwave'] = maxSSwave 165 165 hapVary,hapDict,controlDict = G2stIO.GetHistogramPhaseData(Phases,Histograms,pFile=printFile) 166 TwConstr,TwFixed = G2stIO.makeTwinFrConstr(Phases,Histograms,hapVary) 167 constrDict += TwConstr 168 fixedList += TwFixed 166 169 calcControls.update(controlDict) 167 170 histVary,histDict,controlDict = G2stIO.GetHistogramData(Histograms,pFile=printFile) -
trunk/GSASIIstrMath.py
r1895 r1896 1019 1019 dFdui[iref] = [SA[it]*(dfadui[0][it]+dfbdui[1][it])+SB[it]*(dfbdui[0][it]+dfadui[1][it]) for it in range(nTwin)] 1020 1020 dFdua[iref] = [SA[it]*(dfadua[it][0]+dfbdua[it][1])+SB[it]*(dfbdua[it][0]+dfadua[it][1]) for it in range(nTwin)] 1021 dFdtw[iref] = 2.*SA+2.*SB1021 dFdtw[iref] = np.sum(fas,axis=0)**2+np.sum(fbs,axis=0)**2 1022 1022 else: 1023 1023 dFdfr[iref] = 2.*SA*(dfadfr[0]+dfbdfr[1])*Mdata/len(Uniq)+ \ … … 1062 1062 if nTwin > 1: 1063 1063 for i in range(nTwin): 1064 dFdvDict[phfx+'TwinFr:'+str(i)] = dFdtw.T[i] 1064 dFdvDict[phfx+'TwinFr:'+str(i)] = dFdtw.T[i]/4. 1065 1065 return dFdvDict 1066 1066
Note: See TracChangeset
for help on using the changeset viewer.