Changeset 939 for trunk/GSASIIstrMath.py
- Timestamp:
- Jun 2, 2013 11:07:35 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIstrMath.py
r934 r939 1 1 # -*- coding: utf-8 -*- 2 #GSASIIstrMath - structure computation math routines 2 ''' 3 *GSASIIstrMath - structure math routines* 4 ----------------------------------------- 5 ''' 3 6 ########### SVN repository information ################### 4 7 # $Date: 2013-05-17 12:13:15 -0500 (Fri, 17 May 2013) $ … … 134 137 135 138 def ApplyRBModelDervs(dFdvDict,parmDict,rigidbodyDict,Phase): 139 'Needs a doc string' 136 140 atxIds = ['dAx:','dAy:','dAz:'] 137 141 atuIds = ['AU11:','AU22:','AU33:','AU12:','AU13:','AU23:'] … … 293 297 294 298 def penaltyFxn(HistoPhases,parmDict,varyList): 299 'Needs a doc string' 295 300 Histograms,Phases,restraintDict,rigidbodyDict = HistoPhases 296 301 pNames = [] … … 389 394 390 395 def penaltyDeriv(pNames,pVal,HistoPhases,parmDict,varyList): 396 'Needs a doc string' 391 397 Histograms,Phases,restraintDict,rigidbodyDict = HistoPhases 392 398 pDerv = np.zeros((len(varyList),len(pVal))) … … 486 492 487 493 def GetAtomFXU(pfx,calcControls,parmDict): 494 'Needs a doc string' 488 495 Natoms = calcControls['Natoms'][pfx] 489 496 Tdata = Natoms*[' ',] … … 510 517 511 518 def getFFvalues(FFtables,SQ): 519 'Needs a doc string' 512 520 FFvals = {} 513 521 for El in FFtables: … … 516 524 517 525 def getBLvalues(BLtables): 526 'Needs a doc string' 518 527 BLvals = {} 519 528 for El in BLtables: … … 523 532 def StructureFactor(refList,G,hfx,pfx,SGData,calcControls,parmDict): 524 533 ''' Compute structure factors for all h,k,l for phase 534 puts the result, F^2, in each ref[8] in refList 525 535 input: 526 refList: [ref] where each ref = h,k,l,m,d,...,[equiv h,k,l],phase[equiv] 527 G: reciprocal metric tensor 528 pfx: phase id string 529 SGData: space group info. dictionary output from SpcGroup 530 calcControls: 531 ParmDict: 532 puts result F^2 in each ref[8] in refList 536 537 :param list refList: [ref] where each ref = h,k,l,m,d,...,[equiv h,k,l],phase[equiv] 538 :param np.array G: reciprocal metric tensor 539 :param str pfx: phase id string 540 :param dict SGData: space group info. dictionary output from SpcGroup 541 :param dict calcControls: 542 :param dict ParmDict: 543 533 544 ''' 534 545 twopi = 2.0*np.pi … … 584 595 585 596 def StructureFactorDerv(refList,G,hfx,pfx,SGData,calcControls,parmDict): 597 'Needs a doc string' 586 598 twopi = 2.0*np.pi 587 599 twopisq = 2.0*np.pi**2 … … 757 769 758 770 def GetNewCellParms(parmDict,varyList): 771 'Needs a doc string' 759 772 newCellDict = {} 760 773 Anames = ['A'+str(i) for i in range(6)] … … 769 782 770 783 def ApplyXYZshifts(parmDict,varyList): 771 ''' takes atom x,y,z shift and applies it to corresponding atom x,y,z value772 input:773 parmDict - parameter dictionary774 varyList - list of variables775 returns:776 newAtomDict - dictionary of new atomic coordinate names & values;777 key is parameter shift name 784 ''' 785 takes atom x,y,z shift and applies it to corresponding atom x,y,z value 786 787 :param dict parmDict: parameter dictionary 788 :param list varyList: list of variables 789 :returns: newAtomDict - dictionary of new atomic coordinate names & values; key is parameter shift name 790 778 791 ''' 779 792 newAtomDict = {} … … 786 799 787 800 def SHTXcal(refl,g,pfx,hfx,SGData,calcControls,parmDict): 788 #Spherical harmonics texture801 'Spherical harmonics texture' 789 802 IFCoup = 'Bragg' in calcControls[hfx+'instType'] 790 803 odfCor = 1.0 … … 805 818 806 819 def SHTXcalDerv(refl,g,pfx,hfx,SGData,calcControls,parmDict): 807 #Spherical harmonics texture derivatives820 'Spherical harmonics texture derivatives' 808 821 FORPI = 4.0*np.pi 809 822 IFCoup = 'Bragg' in calcControls[hfx+'instType'] … … 830 843 831 844 def SHPOcal(refl,g,phfx,hfx,SGData,calcControls,parmDict): 832 #sphericaql harmonics preferred orientation (cylindrical symmetry only)845 'spherical harmonics preferred orientation (cylindrical symmetry only)' 833 846 odfCor = 1.0 834 847 H = refl[:3] … … 851 864 852 865 def SHPOcalDerv(refl,g,phfx,hfx,SGData,calcControls,parmDict): 853 #spherical harmonics preferred orientation derivatives (cylindrical symmetry only)866 'spherical harmonics preferred orientation derivatives (cylindrical symmetry only)' 854 867 FORPI = 12.5663706143592 855 868 odfCor = 1.0 … … 875 888 876 889 def GetPrefOri(refl,G,g,phfx,hfx,SGData,calcControls,parmDict): 890 'Needs a doc string' 877 891 POcorr = 1.0 878 892 if calcControls[phfx+'poType'] == 'MD': … … 892 906 893 907 def GetPrefOriDerv(refl,G,g,phfx,hfx,SGData,calcControls,parmDict): 908 'Needs a doc string' 894 909 POcorr = 1.0 895 910 POderv = {} … … 912 927 913 928 def GetAbsorb(refl,hfx,calcControls,parmDict): 929 'Needs a doc string' 914 930 if 'Debye' in calcControls[hfx+'instType']: 915 931 return G2pwd.Absorb('Cylinder',parmDict[hfx+'Absorption'],refl[5],0,0) … … 918 934 919 935 def GetAbsorbDerv(refl,hfx,calcControls,parmDict): 936 'Needs a doc string' 920 937 if 'Debye' in calcControls[hfx+'instType']: 921 938 return G2pwd.AbsorbDerv('Cylinder',parmDict[hfx+'Absorption'],refl[5],0,0) … … 924 941 925 942 def GetIntensityCorr(refl,G,g,pfx,phfx,hfx,SGData,calcControls,parmDict): 943 'Needs a doc string' 926 944 Icorr = parmDict[phfx+'Scale']*parmDict[hfx+'Scale']*refl[3] #scale*multiplicity 927 945 if 'X' in parmDict[hfx+'Type']: … … 934 952 935 953 def GetIntensityDerv(refl,G,g,pfx,phfx,hfx,SGData,calcControls,parmDict): 954 'Needs a doc string' 936 955 dIdsh = 1./parmDict[hfx+'Scale'] 937 956 dIdsp = 1./parmDict[phfx+'Scale'] … … 956 975 957 976 def GetSampleSigGam(refl,wave,G,GB,phfx,calcControls,parmDict): 977 'Needs a doc string' 958 978 costh = cosd(refl[5]/2.) 959 979 #crystallite size … … 993 1013 994 1014 def GetSampleSigGamDerv(refl,wave,G,GB,phfx,calcControls,parmDict): 1015 'Needs a doc string' 995 1016 gamDict = {} 996 1017 sigDict = {} … … 1068 1089 1069 1090 def GetReflPos(refl,wave,G,hfx,calcControls,parmDict): 1091 'Needs a doc string' 1070 1092 h,k,l = refl[:3] 1071 1093 dsq = 1./G2lat.calc_rDsq2(np.array([h,k,l]),G) … … 1083 1105 1084 1106 def GetReflPosDerv(refl,wave,A,hfx,calcControls,parmDict): 1107 'Needs a doc string' 1085 1108 dpr = 180./np.pi 1086 1109 h,k,l = refl[:3] … … 1104 1127 1105 1128 def GetHStrainShift(refl,SGData,phfx,parmDict): 1129 'Needs a doc string' 1106 1130 laue = SGData['SGLaue'] 1107 1131 uniq = SGData['SGUniq'] … … 1132 1156 1133 1157 def GetHStrainShiftDerv(refl,SGData,phfx): 1158 'Needs a doc string' 1134 1159 laue = SGData['SGLaue'] 1135 1160 uniq = SGData['SGUniq'] … … 1163 1188 1164 1189 def GetFobsSq(Histograms,Phases,parmDict,calcControls): 1190 'Needs a doc string' 1165 1191 histoList = Histograms.keys() 1166 1192 histoList.sort() … … 1228 1254 1229 1255 def getPowderProfile(parmDict,x,varylist,Histogram,Phases,calcControls,pawleyLookup): 1256 'Needs a doc string' 1230 1257 1231 1258 def GetReflSigGam(refl,wave,G,GB,hfx,phfx,calcControls,parmDict): … … 1320 1347 1321 1348 def getPowderProfileDerv(parmDict,x,varylist,Histogram,Phases,rigidbodyDict,calcControls,pawleyLookup): 1349 'Needs a doc string' 1322 1350 1323 1351 def cellVaryDerv(pfx,SGData,dpdA): … … 1570 1598 1571 1599 def dervRefine(values,HistoPhases,parmDict,varylist,calcControls,pawleyLookup,dlg): 1600 'Needs a doc string' 1572 1601 parmDict.update(zip(varylist,values)) 1573 1602 G2mv.Dict2Map(parmDict,varylist) … … 1658 1687 1659 1688 def HessRefine(values,HistoPhases,parmDict,varylist,calcControls,pawleyLookup,dlg): 1689 'Needs a doc string' 1660 1690 parmDict.update(zip(varylist,values)) 1661 1691 G2mv.Dict2Map(parmDict,varylist) … … 1769 1799 1770 1800 def errRefine(values,HistoPhases,parmDict,varylist,calcControls,pawleyLookup,dlg): 1801 'Needs a doc string' 1771 1802 parmDict.update(zip(varylist,values)) 1772 1803 Values2Dict(parmDict, varylist, values)
Note: See TracChangeset
for help on using the changeset viewer.