Changeset 1506
- Timestamp:
- Sep 26, 2014 9:41:33 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASII.py
r1500 r1506 634 634 generalData = data['General'] 635 635 SGData = generalData['SGData'] 636 Super = generalData.get('Super',0) 637 SuperVec = [] 638 for i in range(Super): 639 SuperVec.append(generalData['SuperVec'][i][0]) 640 SuperVec = np.array(SuperVec) 636 641 UseList = data['Histograms'] 637 642 NShkl = len(G2spc.MustrainNames(SGData)) … … 644 649 refDict,reflData = self.PatternTree.GetItemPyData(Id) 645 650 G,g = G2lat.cell2Gmat(generalData['Cell'][1:7]) 651 Super = reflData.get('Super',0) 646 652 for iref,ref in enumerate(reflData['RefList']): 647 H = list(ref[:3]) 648 ref[4] = np.sqrt(1./G2lat.calc_rDsq2(H,G)) 649 iabsnt,ref[3],Uniq,phi = G2spc.GenHKLf(H,SGData) 653 hkl = ref[:3] 654 H = list(hkl+np.sum(SuperVec*ref[3:3+Super],axis=0)) 655 ref[4+Super] = np.sqrt(1./G2lat.calc_rDsq2(H,G)) 656 iabsnt,ref[3+Super],Uniq,phi = G2spc.GenHKLf(H,SGData) 650 657 UseList[histoName] = SetDefaultDData(reflData['Type'],histoName) 651 658 elif histoName in PWDRlist: … … 771 778 generalData = data['General'] 772 779 SGData = generalData['SGData'] 780 Super = generalData.get('Super',0) 781 SuperVec = [] 782 for i in range(Super): 783 SuperVec.append(generalData['SuperVec'][i][0]) 784 SuperVec = np.array(SuperVec) 773 785 UseList = data['Histograms'] 774 786 for histoName in newHistList: … … 779 791 G,g = G2lat.cell2Gmat(generalData['Cell'][1:7]) 780 792 for iref,ref in enumerate(reflData['RefList']): 781 H = list(ref[:3]) 782 ref[4] = np.sqrt(1./G2lat.calc_rDsq2(H,G)) 783 iabsnt,ref[3],Uniq,phi = G2spc.GenHKLf(H,SGData) 793 hkl = ref[:3] 794 H = list(hkl+np.sum(SuperVec*ref[3:3+Super],axis=0)) 795 ref[4+Super] = np.sqrt(1./G2lat.calc_rDsq2(H,G)) 796 iabsnt,ref[3+Super],Uniq,phi = G2spc.GenHKLf(H,SGData) 784 797 wx.EndBusyCursor() 785 798 … … 806 819 kind=wx.ITEM_NORMAL,text='Simulate a dataset') 807 820 self.Bind(wx.EVT_MENU, self.OnDummyPowder, id=item.GetId()) 808 809 def ReadPowderInstprm(self,instfile): #fix the write routine for [inst1,inst2] style821 822 def OpenPowderInstprm(self,instfile): 810 823 '''Read a GSAS-II (new) instrument parameter file 811 824 … … 818 831 return None 819 832 File = open(instfile,'r') 820 S = File.readline() 821 if not S.startswith('#GSAS-II'): # not a valid file 822 File.close() 833 lines = File.readlines() 834 File.close() 835 return lines 836 837 def ReadPowderInstprm(self,instLines): 838 '''Read lines from a GSAS-II (new) instrument parameter file 839 840 :param list instLines: strings from GSAs-II parameter file 841 842 ''' 843 if not instLines[0].startswith('#GSAS-II'): # not a valid file 823 844 return None 824 845 newItems = [] 825 846 newVals = [] 826 while S:847 for S in instLines: 827 848 if S[0] == '#': 828 S = File.readline()829 849 continue 830 850 [item,val] = S[:-1].split(':') … … 834 854 except ValueError: 835 855 newVals.append(val) 836 S = File.readline()837 File.close()838 856 return G2IO.makeInstDict(newItems,newVals,len(newVals)*[False,]),{} 839 857 … … 1071 1089 if os.path.exists(instfile): 1072 1090 #print 'debug: try read',instfile 1073 instParmList = self.ReadPowderInstprm(instfile) 1091 Lines = self.OpenPowderInstprm(instfile) 1092 instParmList = None 1093 if Lines is not None: 1094 instParmList = self.ReadPowderInstprm(Lines) 1074 1095 if instParmList is not None: 1075 1096 rd.instfile = instfile … … 1090 1111 for ext in '.instprm','.prm','.inst','.ins': 1091 1112 instfile = basename + ext 1092 instParmList = self.ReadPowderInstprm(instfile) 1113 Lines = self.OpenPowderInstprm(instfile) 1114 instParmList = None 1115 if Lines is not None: 1116 instParmList = self.ReadPowderInstprm(Lines) 1093 1117 if instParmList is not None: 1094 1118 rd.instfile = instfile … … 1115 1139 if instfile is not None and instfile != self.zipfile: 1116 1140 print 'debug:',instfile,'created from ',self.zipfile 1117 instParmList = self.ReadPowderInstprm(instfile) 1141 Lines = self.OpenPowderInstprm(instfile) 1142 instParmList = None 1143 if Lines is not None: 1144 instParmList = self.ReadPowderInstprm(Lines) 1118 1145 if instParmList is not None: 1119 1146 rd.instfile = instfile … … 1147 1174 dlg.Destroy() 1148 1175 if not instfile: break 1149 instParmList = self.ReadPowderInstprm(instfile) 1176 Lines = self.OpenPowderInstprm(instfile) 1177 instParmList = None 1178 if Lines is not None: 1179 instParmList = self.ReadPowderInstprm(Lines) 1150 1180 if instParmList is not None: 1151 1181 rd.instfile = instfile -
trunk/GSASIIgrid.py
r1503 r1506 3202 3202 help='Compute values of ISODISTORT modes from atom parameters') 3203 3203 self.PostfillDataMenu() 3204 3205 # Phase / Imcommensurate "waves" tab 3206 self.WavesData = wx.MenuBar() 3207 self.PrefillDataMenu(self.WavesData,helpType='Wave Data', helpLbl='Imcommensurate wave data') 3208 self.WavesData.Append(menu=wx.Menu(title=''),title='Select tab') 3209 self.PostfillDataMenu() 3204 3210 3205 3211 # Phase / Draw Options tab … … 4961 4967 def OnPlot3DHKL(event): 4962 4968 refList = data[1]['RefList'] 4963 phaseName = data[0].get('0::Name','no phase') 4964 FoMax = np.max(refList.T[8]) 4969 FoMax = np.max(refList.T[8+Super]) 4965 4970 Hmin = np.array([int(np.min(refList.T[0])),int(np.min(refList.T[1])),int(np.min(refList.T[2]))]) 4966 4971 Hmax = np.array([int(np.max(refList.T[0])),int(np.max(refList.T[1])),int(np.max(refList.T[2]))]) … … 4969 4974 'FoMax' : FoMax,'Scale' : 1.0,'Drawing':{'viewPoint':[Vpoint,[]],'default':Vpoint[:], 4970 4975 'backColor':[0,0,0],'depthFog':False,'Zclip':10.0,'cameraPos':10.,'Zstep':0.05, 4971 'Scale':1.0,'oldxy':[],'viewDir':[1,0,0]} }4976 'Scale':1.0,'oldxy':[],'viewDir':[1,0,0]},'Super':Super,'SuperVec':SuperVec} 4972 4977 G2plt.Plot3DSngl(G2frame,newPlot=True,Data=controls,hklRef=refList,Title=phaseName) 4973 4978 … … 5061 5066 G2plt.PlotPatterns(G2frame,plotType=kind,newPlot=True) 5062 5067 elif kind == 'HKLF': 5068 Name = G2frame.PatternTree.GetItemText(item) 5069 phaseName = G2pdG.IsHistogramInAnyPhase(G2frame,Name) 5070 if phaseName: 5071 pId = GetPatternTreeItemId(G2frame,G2frame.root,'Phases') 5072 phaseId = GetPatternTreeItemId(G2frame,pId,phaseName) 5073 General = G2frame.PatternTree.GetItemPyData(phaseId)['General'] 5074 Super = General.get('Super',0) 5075 SuperVec = General.get('SuperVec',[]) 5076 else: 5077 Super = 0 5078 SuperVec = [] 5063 5079 refList = data[1]['RefList'] 5064 5080 FoMax = np.max(refList.T[5+data[1].get('Super',0)]) 5065 controls = {'Type' : 'Fo sq','ifFc' : True,5081 controls = {'Type' : 'Fo','ifFc' : True, 5066 5082 'HKLmax' : [int(np.max(refList.T[0])),int(np.max(refList.T[1])),int(np.max(refList.T[2]))], 5067 5083 'HKLmin' : [int(np.min(refList.T[0])),int(np.min(refList.T[1])),int(np.min(refList.T[2]))], 5068 'FoMax' : FoMax,'Zone' : '001','Layer' : 0,'Scale' : 1.0, }5084 'FoMax' : FoMax,'Zone' : '001','Layer' : 0,'Scale' : 1.0,'Super':Super,'SuperVec':SuperVec} 5069 5085 G2plt.PlotSngl(G2frame,newPlot=True,Data=controls,hklRef=refList) 5070 5086 -
trunk/GSASIImath.py
r1474 r1506 188 188 vcov[i1][i2] = covMatrix[varyList.index(name1)][varyList.index(name2)] 189 189 except ValueError: 190 vcov[i1][i2] = 0.0 190 if i1 == i2: 191 vcov[i1][i2] = 1.0 192 else: 193 vcov[i1][i2] = 0.0 191 194 return vcov 192 195 … … 2942 2945 cosTable = np.array(cosTable)**2 2943 2946 nRef = len(refs) 2944 if generalData['doPawley'] and (covData['freshCOV'] or MCSA['newDmin']): 2947 # if generalData['doPawley'] and (covData['freshCOV'] or MCSA['newDmin']): 2948 if covData['freshCOV'] or MCSA['newDmin']: 2945 2949 vList = covData['varyList'] 2946 2950 covMatrix = covData['covMatrix'] -
trunk/GSASIIphsGUI.py
r1503 r1506 128 128 if generalData['Type'] =='macromolecular': 129 129 generalData['AtomPtrs'] = [6,4,10,12] 130 if generalData['Type'] in ['modulated','magnetic',] and ' modDim' not in generalData:131 generalData[' modDim'] = '4'132 generalData[' modVects'] = [{'mod':[0.01,False],'vect':[0,0,1],'maxInd':4},133 {'mod':[0.01,False],'vect':[0,0,1],'maxInd':4},{'mod':[0.01,False],'vect':[0,0,1],'maxInd':4}]130 if generalData['Type'] in ['modulated','magnetic',] and 'Super' not in generalData: 131 generalData['SuperSg'] = '' 132 generalData['Super'] = 0 133 generalData['SuperVec'] = [[[0,0,.1],False,4],[[0,0,.1],False,4],[[0,0,.1],False,4]] 134 134 # end of patches 135 135 cx,ct,cs,cia = generalData['AtomPtrs'] … … 511 511 def ModulatedSizer(name): 512 512 513 def OnSuperGp(event): #need a check on supersymmetry group rules here! 514 generalData['SuperSg'] = event.GetValue() 515 513 516 def OnDim(event): 514 generalData[' modDim'] = dim.GetValue()517 generalData['Super'] = dim.GetValue() 515 518 wx.CallAfter(UpdateGeneral) 516 519 … … 518 521 Obj = event.GetEventObject() 519 522 ind = Indx[Obj.GetId()] 520 axis= Obj.GetValue().split()523 vec = Obj.GetValue().split() 521 524 try: 522 hkl = [float(axis[i]) for i in range(3)]525 Vec = [float(vec[i]) for i in range(3)] 523 526 except (ValueError,IndexError): 524 hkl = generalData['modVects'][ind]['vect']525 if not np.any(np.array( hkl)):526 hkl = generalData['modVects'][ind]['vect']527 generalData['modVects'][ind][ 'vect'] = hkl528 h,k,l = hkl527 Vec = generalData['SuperVec'][ind][0] 528 if not np.any(np.array(Vec)): 529 Vec = generalData['SuperVec'][ind][0] 530 generalData['modVects'][ind][0] = hkl 531 h,k,l = Vec 529 532 Obj.SetValue('%.3f %.3f %.3f'%(h,k,l)) 530 533 531 def OnV al(event):534 def OnVecRef(event): 532 535 Obj = event.GetEventObject() 533 536 ind = Indx[Obj.GetId()] 534 try: 535 val = float(Obj.GetValue()) 536 generalData['modVects'][ind]['mod'][0] = val 537 except ValueError: 538 pass 539 Obj.SetValue('%.4f'%(generalData['modVects'][ind]['mod'][0])) 540 541 def OnValRef(event): 542 Obj = event.GetEventObject() 543 ind = Indx[Obj.GetId()] 544 generalData['modVects'][ind]['mod'][1] = Obj.GetValue() 537 generalData['SuperVec'][ind][1] = Obj.GetValue() 545 538 546 539 def OnMax(event): 547 540 Obj = event.GetEventObject() 548 541 ind = Indx[Obj.GetId()] 549 generalData[' modVects'][ind]['maxInd'] = int(Obj.GetValue())542 generalData['SuperVec'][ind][2] = int(Obj.GetValue()) 550 543 551 544 Indx = {} … … 554 547 dimSizer.Add(wx.StaticText(General,label=' '+name.capitalize()+' structure controls: '),0,WACV) 555 548 dimSizer.Add(wx.StaticText(General,label=' Modulated structure dimension: '),0,WACV) 556 dimChoice = [' 4','5','6']557 dim = wx.ComboBox(General, -1,value=generalData['modDim'],choices=dimChoice,549 dimChoice = ['1'] # restricted to (3+1) superlattices for now 550 dim = wx.ComboBox(General,value=str(generalData['Super']),choices=dimChoice, 558 551 style=wx.CB_READONLY|wx.CB_DROPDOWN) 559 552 dim.Bind(wx.EVT_COMBOBOX,OnDim) 560 553 dimSizer.Add(dim,0,WACV) 554 dimSizer.Add(wx.StaticText(General,label=' Superspace group: '+generalData['SGData']['SpGrp']),0,WACV) 555 superGp = wx.TextCtrl(General,value=generalData['SuperSg'],style=wx.TE_PROCESS_ENTER) 556 superGp.Bind(wx.EVT_TEXT_ENTER,OnSuperGp) 557 superGp.Bind(wx.EVT_KILL_FOCUS,OnSuperGp) 558 dimSizer.Add(superGp,0,WACV) 561 559 modSizer.Add(dimSizer) 562 vecSizer = wx.FlexGridSizer(1, 7,5,5)560 vecSizer = wx.FlexGridSizer(1,5,5,5) 563 561 indChoice = ['0','1','2','3','4','5','6','7'] 564 for i in range(int(generalData[' modDim'])-3):562 for i in range(int(generalData['Super'])): 565 563 vecSizer.Add(wx.StaticText(General,label=' Modulation vector #%d: '%(i+1)),0,WACV) 566 vec = generalData[' modVects'][i]564 vec = generalData['SuperVec'][i][0] 567 565 Vec = wx.TextCtrl(General, 568 value=' %.3f %.3f %.3f '%(vec[ 'vect'][0],vec['vect'][1],vec['vect'][2]),566 value=' %.3f %.3f %.3f '%(vec[0],vec[1],vec[2]), 569 567 style=wx.TE_PROCESS_ENTER) 570 568 Vec.Bind(wx.EVT_TEXT_ENTER,OnVec) … … 572 570 vecSizer.Add(Vec,0,WACV) 573 571 Indx[Vec.GetId()] = i 574 vecSizer.Add(wx.StaticText(General,label=' value: '),0,WACV)575 Val = wx.TextCtrl(General,value='%.4f'%(vec['mod'][0]),style=wx.TE_PROCESS_ENTER)576 Val.Bind(wx.EVT_TEXT_ENTER,OnVal)577 Val.Bind(wx.EVT_KILL_FOCUS,OnVal)578 vecSizer.Add(Val,0,WACV)579 Indx[Val.GetId()] = i580 572 Ref = wx.CheckBox(General,label='Refine?') 581 Ref.SetValue( vec['mod'][1])573 Ref.SetValue(generalData['SuperVec'][i][1]) 582 574 Indx[Ref.GetId()] = i 583 Ref.Bind(wx.EVT_CHECKBOX, OnV alRef)575 Ref.Bind(wx.EVT_CHECKBOX, OnVecRef) 584 576 vecSizer.Add(Ref,0,WACV) 585 577 vecSizer.Add(wx.StaticText(General,label=' max index: '),0,WACV) 586 Max = wx.ComboBox(General,-1,value='%d'%( vec['maxInd']),choices=indChoice,578 Max = wx.ComboBox(General,-1,value='%d'%(generalData['SuperVec'][i][2]),choices=indChoice, 587 579 style=wx.CB_READONLY|wx.CB_DROPDOWN) 588 580 Max.Bind(wx.EVT_TEXT_ENTER,OnMax) … … 1315 1307 Types += 7*[wg.GRID_VALUE_FLOAT+':10,5',] 1316 1308 colLabels = ['Name','Type','refine','x','y','z','frac','site sym','mult','I/A','Uiso','U11','U22','U33','U12','U13','U23'] 1317 if generalData['Type'] == 'magnetic': 1318 colLabels += ['Mx','My','Mz'] 1319 Types[2] = wg.GRID_VALUE_CHOICE+": ,X,XU,U,M,MX,MXU,MU,F,FX,FXU,FU,FM,FMX,FMU," 1320 Types += 3*[wg.GRID_VALUE_FLOAT+':10,4',] 1321 elif generalData['Type'] == 'macromolecular': 1309 if generalData['Type'] == 'macromolecular': 1322 1310 colLabels = ['res no','residue','chain'] + colLabels 1323 1311 Types = [wg.GRID_VALUE_STRING, 1324 1312 wg.GRID_VALUE_CHOICE+AAchoice, 1325 1313 wg.GRID_VALUE_STRING] + Types 1326 elif generalData['Type'] == 'modulated':1327 Types += []1328 colLabels += []1329 1314 SGData = data['General']['SGData'] 1330 1315 G2frame.dataFrame.SetStatusText('') … … 1370 1355 elif generalData['Type'] == 'nuclear': 1371 1356 atomData.append([Name,El,'',x,y,z,1,Sytsym,Mult,'I',0.01,0,0,0,0,0,0,atId]) 1372 elif generalData['Type'] == 'magnetic':1373 atomData.append([Name,El,'',x,y,z,1,Sytsym,Mult,0,'I',0.01,0,0,0,0,0,0, 0,0,0,atId])1357 elif generalData['Type'] in ['modulated','magnetic']: 1358 atomData.append([Name,El,'',x,y,z,1,Sytsym,Mult,0,'I',0.01,0,0,0,0,0,0,[],[],[],[],atId]) 1374 1359 SetupGeneral() 1375 1360 if 'Atoms' in data['Drawing']: … … 1446 1431 atom[6:9]+['1',]+['sticks',]+['',]+[[255,255,255],]+atom[12:]+[[],[]]][0] 1447 1432 ct,cs = [4,11] #type & color 1448 elif generalData['Type'] == 'magnetic':1449 if oldatom:1450 atomInfo = [atom[:2]+oldatom[3:]][0]1451 else:1452 atomInfo = [atom[:2]+atom[3:6]+['vdW balls',]+['',]+atom[9:]+[[],[]]][0]1453 ct,cs = [1,8] #type & color1454 # elif generalData['Type'] == 'modulated':1455 # ????? for future1456 1433 atNum = generalData['AtomTypes'].index(atom[ct]) 1457 1434 atomInfo[cs] = list(generalData['Color'][atNum]) … … 1472 1449 elif generalData['Type'] == 'nuclear': 1473 1450 atomData.insert(indx,['UNK','UNK','',x,y,z,1,Sytsym,Mult,'I',0.01,0,0,0,0,0,0,atId]) 1474 elif generalData['Type'] == 'magnetic':1475 atomData.insert(indx,['UNK','UNK','',x,y,z,1,Sytsym,Mult,0,'I',0.01,0,0,0,0,0,0, 0,0,0,atId])1451 elif generalData['Type'] in ['modulated','magnetic']: 1452 atomData.insert(indx,['UNK','UNK','',x,y,z,1,Sytsym,Mult,0,'I',0.01,0,0,0,0,0,0,[],[],[],[],atId]) 1476 1453 SetupGeneral() 1477 1454 … … 1507 1484 choice = ['F - site fraction','X - coordinates','U - thermal parameters'] 1508 1485 elif Type == 'magnetic': 1509 choice = ['F - site fraction','X - coordinates','U - thermal parameters' ,'M - magnetic moment']1486 choice = ['F - site fraction','X - coordinates','U - thermal parameters'] 1510 1487 dlg = wx.MultiChoiceDialog(G2frame,'Select','Refinement controls',choice) 1511 1488 if dlg.ShowModal() == wx.ID_OK: … … 1913 1890 print atom[:ct+1], 'not in Atom array; not updated' 1914 1891 wx.CallAfter(FillAtomsGrid,Atoms) 1915 1892 1893 ################################################################################ 1894 #### Wave Data page 1895 ################################################################################ 1896 1897 def UpdateWavesData(): 1898 1899 def AtomSizer(SS,atom): 1900 1901 def OnWaveType(event): 1902 atom[-2][SS]['waveType']=waveType.GetValue() 1903 1904 atomSizer = wx.BoxSizer(wx.HORIZONTAL) 1905 atomSizer.Add(wx.StaticText(waveData,label=' Modulation data for atom: '+atom[0]+' WaveType: '),0,WACV) 1906 waveType = wx.ComboBox(waveData,value=atom[-2][SS]['waveType'],choices=waveTypes, 1907 style=wx.CB_READONLY|wx.CB_DROPDOWN) 1908 waveType.Bind(wx.EVT_COMBOBOX,OnWaveType) 1909 atomSizer.Add(waveType,0,WACV) 1910 return atomSizer 1911 1912 def WaveSizer(waveBlk,Stype,typeName,Names): 1913 1914 def OnAddWave(event): 1915 Obj = event.GetEventObject() 1916 iatm,item = Indx[Obj.GetId()] 1917 atomData[iatm][-2][SS][item].append([[0.0 for i in range(numVals[Stype])],False]) 1918 UpdateWavesData() 1919 1920 def OnWaveVal(event): 1921 Obj = event.GetEventObject() 1922 iatm,item,iwave,ival = Indx[Obj.GetId()] 1923 try: 1924 val = float(Obj.GetValue()) 1925 except ValueError: 1926 val = atomData[iatm][-2][SS][item][iwave][0][ival] 1927 Obj.SetValue('%.4f'%val) 1928 atomData[iatm][-2][SS][item][iwave][0][ival] = val 1929 1930 def OnRefWave(event): 1931 Obj = event.GetEventObject() 1932 iatm,item,iwave = Indx[Obj.GetId()] 1933 atomData[iatm][-2][SS][item][iwave][1] = not atomData[iatm][-2][SS][item][iwave][1] 1934 1935 def OnDelWave(event): 1936 Obj = event.GetEventObject() 1937 iatm,item,iwave = Indx[Obj.GetId()] 1938 del atomData[iatm][-2][SS][item][iwave] 1939 UpdateWavesData() 1940 1941 waveSizer = wx.BoxSizer(wx.VERTICAL) 1942 waveHead = wx.BoxSizer(wx.HORIZONTAL) 1943 waveHead.Add(wx.StaticText(waveData,label=typeName+' modulation parameters: '),0,WACV) 1944 waveAdd = wx.CheckBox(waveData,label='Add wave?') 1945 waveAdd.Bind(wx.EVT_CHECKBOX, OnAddWave) 1946 Indx[waveAdd.GetId()] = [iatm,Stype] 1947 waveHead.Add(waveAdd,0,WACV) 1948 waveSizer.Add(waveHead) 1949 if len(waveBlk): 1950 waveSizer.Add(wx.StaticText(waveData,label=' Parameters: '+str(Names).rstrip(']').lstrip('[').replace("'",'')),0,WACV) 1951 if Stype == 'Sfrac': 1952 Waves = wx.FlexGridSizer(1,4,5,5) 1953 else: 1954 Waves = wx.FlexGridSizer(1,8,5,5) 1955 for iwave,wave in enumerate(waveBlk): 1956 for ival,val in enumerate(wave[0]): 1957 waveVal = wx.TextCtrl(waveData,value='%.4f'%(val),style=wx.TE_PROCESS_ENTER) 1958 waveVal.Bind(wx.EVT_TEXT_ENTER,OnWaveVal) 1959 waveVal.Bind(wx.EVT_KILL_FOCUS,OnWaveVal) 1960 Indx[waveVal.GetId()] = [iatm,Stype,iwave,ival] 1961 Waves.Add(waveVal,0,WACV) 1962 if len(wave[0]) > 6 and ival == 5: 1963 Waves.Add((5,5),0) 1964 Waves.Add((5,5),0) 1965 waveRef = wx.CheckBox(waveData,label='Refine?') 1966 waveRef.SetValue(wave[1]) 1967 Indx[waveRef.GetId()] = [iatm,Stype,iwave] 1968 waveRef.Bind(wx.EVT_CHECKBOX, OnRefWave) 1969 Waves.Add(waveRef,0,WACV) 1970 waveDel = wx.CheckBox(waveData,label='Delete?') 1971 Indx[waveDel.GetId()] = [iatm,Stype,iwave] 1972 waveDel.Bind(wx.EVT_CHECKBOX, OnDelWave) 1973 Waves.Add(waveDel,0,WACV) 1974 waveSizer.Add(Waves) 1975 return waveSizer 1976 1977 Indx = {} 1978 G2frame.dataFrame.SetStatusText('') 1979 generalData = data['General'] 1980 cx,ct,cs,cia = generalData['AtomPtrs'] 1981 atomData = data['Atoms'] 1982 if waveData.GetSizer(): 1983 waveData.GetSizer().Clear(True) 1984 mainSizer = wx.BoxSizer(wx.VERTICAL) 1985 typeNames = {'Sfrac':' Site fraction','Spos':' Position','Sadp':' Thermal motion','Smag':' Magnetic moment'} 1986 numVals = {'Sfrac':2,'Spos':6,'Sadp':12,'Smag':6} 1987 posNames = ['Xsin','Ysin','Zsin','Xcos','Ysin','Zsin'] 1988 adpNames = ['U11sin','U22sin','U33sin','U12sin','U13sin','U23sin', 1989 'U11cos','U22cos','U33cos','U12cos','U13cos','U23cos'] 1990 magNames = ['MXsin','MYsin','MZsin','MXcos','MYcos','MZcos'] 1991 fracNames = ['Flen','Fcent','Fsin','Fcos'] 1992 waveTypes = ['Fourier','Sawtooth','ZigZag','Crenel/Fourier'] 1993 Labels = {'Spos':posNames,'Sfrac':fracNames,'Sadp':adpNames,'Smag':magNames} 1994 mainSizer.Add(wx.StaticText(waveData,label=' Incommensurate propagation wave data:'),0,WACV) 1995 if generalData['Type'] in ['modulated','magnetic']: 1996 for iatm,atom in enumerate(atomData): 1997 for SS in ['SS1',]: #future SS2 & SS3 1998 G2gd.HorizontalLine(mainSizer,waveData) 1999 mainSizer.Add(AtomSizer(SS,atom)) 2000 for Stype in ['Sfrac','Spos','Sadp','Smag']: 2001 if generalData['Type'] == 'modulated' and Stype == 'Smag': 2002 break 2003 mainSizer.Add(WaveSizer(atom[-2][SS][Stype],Stype,typeNames[Stype],Labels[Stype])) 1916 2004 2005 SetPhaseWindow(G2frame.dataFrame,waveData,mainSizer) 2006 1917 2007 ################################################################################ 1918 2008 #Structure drawing GUI stuff … … 2787 2877 DATData['covData'] = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,G2frame.root, 'Covariance')) 2788 2878 G2stMn.DisAglTor(DATData) 2789 2879 2790 2880 ################################################################################ 2791 2881 #### Draw Options page … … 5400 5490 G2frame.dataFrame.Bind(wx.EVT_MENU, OnReImport, id=id) 5401 5491 FillAtomsGrid(Atoms) 5492 elif text == 'Wave Data' and data['General']['Type'] in ['modulated','magnetic']: 5493 G2gd.SetDataMenuBar(G2frame,G2frame.dataFrame.WavesData) 5494 FillSelectPageMenu(G2frame.dataFrame.WavesData) 5495 UpdateWavesData() 5496 wx.CallAfter(G2plt.PlotStructure,G2frame,data,firstCall=True) 5402 5497 elif text == 'Draw Options': 5403 5498 G2gd.SetDataMenuBar(G2frame,G2frame.dataFrame.DataDrawOptions) … … 5512 5607 G2frame.dataDisplay.AddPage(Atoms,'Atoms') 5513 5608 Pages.append('Atoms') 5609 if data['General']['Type'] in ['modulated','magnetic']: 5610 waveData = wx.ScrolledWindow(G2frame.dataDisplay) 5611 G2frame.dataDisplay.AddPage(waveData,'Wave Data') 5612 Pages.append('Wave Data') 5514 5613 drawOptions = wx.ScrolledWindow(G2frame.dataDisplay) 5515 5614 G2frame.dataDisplay.AddPage(drawOptions,'Draw Options') -
trunk/GSASIIplot.py
r1504 r1506 358 358 HKLmin = Data['HKLmin'] 359 359 FosqMax = Data['FoMax'] 360 Super = Data.get('Super',0) 360 Super = Data['Super'] 361 SuperVec = [] 362 for i in range(Super): 363 SuperVec.append(Data['SuperVec'][i][0]) 364 SuperVec = np.array(SuperVec) 361 365 FoMax = math.sqrt(FosqMax) 362 366 xlabel = ['k, h=','h, k=','h, l='] … … 370 374 time0 = time.time() 371 375 for refl in hklRef: 372 H = np.array(refl[:3]) 373 if Super and np.any(refl[3:3+Super]): #skip superlattice reflections for 2D plot 374 continue 376 H = refl[:3] 375 377 if 'HKLF' in Name: 376 378 Fosq,sig,Fcsq = refl[5+Super:8+Super] 377 379 else: 378 380 Fosq,sig,Fcsq = refl[8+Super],1.0,refl[9+Super] 379 HKL.append(H )381 HKL.append(H+np.sum(SuperVec*refl[3:3+Super],axis=0)) 380 382 HKLF.append([Fosq,sig,Fcsq]) 381 383 if H[izone] == Data['Layer']: … … 410 412 A = (Fosq-Fcsq)/(3*sig) 411 413 if abs(A) < 3.0: A = 0 412 B = 0 413 xy = (H[pzone[izone][0]],H[pzone[izone][1]]) 414 B = 0 415 h = H+np.sum(SuperVec*refl[3:3+Super],axis=0) 416 xy = (h[pzone[izone][0]],h[pzone[izone][1]]) 414 417 if Type in ['|DFsq|/sig','|DFsq|>sig','|DFsq|>3sig']: 415 418 if A > 0.0: … … 431 434 Plot.add_artist(Circle(xy,radius=radius,ec='r',fc='r')) 432 435 # print 'plot time: %.3f'%(time.time()-time0) 433 HKL = np.array(HKL ,dtype=np.int)436 HKL = np.array(HKL) 434 437 HKLF = np.array(HKLF) 435 438 Plot.set_xlabel(xlabel[izone]+str(Data['Layer']),fontsize=12) … … 525 528 cell = [10,10,10,90,90,90] 526 529 drawingData = Data['Drawing'] 527 Super = Data.get('Super',0) 530 Super = Data['Super'] 531 SuperVec = [] 532 for i in range(Super): 533 SuperVec.append(Data['SuperVec'][i][0]) 534 SuperVec = np.array(SuperVec) 528 535 defaultViewPt = copy.copy(drawingData['viewPoint']) 529 536 Amat,Bmat = G2lat.cell2AB(cell) #Amat - crystal to cartesian, Bmat - inverse … … 551 558 RC = [] 552 559 for i,refl in enumerate(hklRef): 553 H = np.array(refl[:3])560 H = refl[:3] 554 561 if 'HKLF' in Name: 555 562 Fosq,sig,Fcsq = refl[5+Super:8+Super] 556 563 else: 557 564 Fosq,sig,Fcsq = refl[8+Super],1.0,refl[9+Super] 558 HKL.append(H )565 HKL.append(H+np.sum(SuperVec*refl[3:3+Super],axis=0)) 559 566 if Data['Type'] == 'Unit': 560 567 R[i] = 0.1 … … 592 599 R /= np.max(R) 593 600 R *= Data['Scale'] 601 R = np.where(R<1.e-5,1.e-5,R) 594 602 if Data['Iscale']: 595 603 R = np.where(R<=1.,R,1.) 596 604 C = np.array(C) 597 605 C = (C.T*R).T 598 R = np.ones_like(R)*0. 1606 R = np.ones_like(R)*0.05 599 607 return HKL,zip(list(R),C) 600 608 -
trunk/GSASIIpwdGUI.py
r1503 r1506 64 64 histoList = data['Histograms'].keys() 65 65 if histoName in histoList: 66 return True66 return G2frame.PatternTree.GetItemText(item) 67 67 item, cookie = G2frame.PatternTree.GetNextChild(phases, cookie) 68 68 return False … … 2586 2586 '''respond to selection of PWDR Reflections data tree item. 2587 2587 ''' 2588 def OnPlotHKL(event): 2589 FoMax = np.max(refList.T[8+Super]) 2590 Hmin = np.array([int(np.min(refList.T[0])),int(np.min(refList.T[1])),int(np.min(refList.T[2]))]) 2591 Hmax = np.array([int(np.max(refList.T[0])),int(np.max(refList.T[1])),int(np.max(refList.T[2]))]) 2592 controls = {'Type' : 'Fo','ifFc' : True,'HKLmax' : Hmax,'HKLmin' : Hmin, 2593 'FoMax' : FoMax,'Zone' : '001','Layer' : 0,'Scale' : 1.0,'Super':Super,'SuperVec':SuperVec} 2594 G2plt.PlotSngl(G2frame,newPlot=True,Data=controls,hklRef=refList,Title=phaseName) 2595 2596 def OnPlot3DHKL(event): 2597 FoMax = np.max(refList.T[8+Super]) 2598 Hmin = np.array([int(np.min(refList.T[0])),int(np.min(refList.T[1])),int(np.min(refList.T[2]))]) 2599 Hmax = np.array([int(np.max(refList.T[0])),int(np.max(refList.T[1])),int(np.max(refList.T[2]))]) 2600 Vpoint = [int(np.mean(refList.T[0])),int(np.mean(refList.T[1])),int(np.mean(refList.T[2]))] 2601 controls = {'Type':'Fosq','Iscale':False,'HKLmax':Hmax,'HKLmin':Hmin, 2602 'FoMax' : FoMax,'Scale' : 1.0,'Drawing':{'viewPoint':[Vpoint,[]],'default':Vpoint[:], 2603 'backColor':[0,0,0],'depthFog':False,'Zclip':10.0,'cameraPos':10.,'Zstep':0.05, 2604 'Scale':1.0,'oldxy':[],'viewDir':[1,0,0]},'Super':Super,'SuperVec':SuperVec} 2605 G2plt.Plot3DSngl(G2frame,newPlot=True,Data=controls,hklRef=refList,Title=phaseName) 2606 2607 def OnSelectPhase(event): 2608 dlg = wx.SingleChoiceDialog(G2frame,'Select','Phase',phases) 2609 try: 2610 if dlg.ShowModal() == wx.ID_OK: 2611 sel = dlg.GetSelection() 2612 G2frame.RefList = phases[sel] 2613 UpdateReflectionGrid(G2frame,data) 2614 finally: 2615 dlg.Destroy() 2616 G2plt.PlotPatterns(G2frame) 2617 2588 2618 if not data: 2589 2619 print 'No phases, no reflections' … … 2591 2621 if HKLF: 2592 2622 G2frame.RefList = 1 2593 phaseName = Name2623 phaseName = IsHistogramInAnyPhase(G2frame,Name) 2594 2624 else: 2595 2625 phaseName = G2frame.RefList 2596 2626 phases = data.keys() 2597 2598 def OnSelectPhase(event):2599 dlg = wx.SingleChoiceDialog(G2frame,'Select','Phase',phases)2600 try:2601 if dlg.ShowModal() == wx.ID_OK:2602 sel = dlg.GetSelection()2603 G2frame.RefList = phases[sel]2604 UpdateReflectionGrid(G2frame,data)2605 finally:2606 dlg.Destroy()2607 G2plt.PlotPatterns(G2frame)2608 2609 def OnPlotHKL(event):2610 FoMax = np.max(refList.T[8])2611 Hmin = np.array([int(np.min(refList.T[0])),int(np.min(refList.T[1])),int(np.min(refList.T[2]))])2612 Hmax = np.array([int(np.max(refList.T[0])),int(np.max(refList.T[1])),int(np.max(refList.T[2]))])2613 controls = {'Type' : 'Fo','ifFc' : True,'HKLmax' : Hmax,'HKLmin' : Hmin,2614 'FoMax' : FoMax,'Zone' : '001','Layer' : 0,'Scale' : 1.0,}2615 G2plt.PlotSngl(G2frame,newPlot=True,Data=controls,hklRef=refList,Title=phaseName)2616 2617 def OnPlot3DHKL(event):2618 FoMax = np.max(refList.T[8])2619 Hmin = np.array([int(np.min(refList.T[0])),int(np.min(refList.T[1])),int(np.min(refList.T[2]))])2620 Hmax = np.array([int(np.max(refList.T[0])),int(np.max(refList.T[1])),int(np.max(refList.T[2]))])2621 Vpoint = [int(np.mean(refList.T[0])),int(np.mean(refList.T[1])),int(np.mean(refList.T[2]))]2622 controls = {'Type':'Fosq','Iscale':False,'HKLmax':Hmax,'HKLmin':Hmin,2623 'FoMax' : FoMax,'Scale' : 1.0,'Drawing':{'viewPoint':[Vpoint,[]],'default':Vpoint[:],2624 'backColor':[0,0,0],'depthFog':False,'Zclip':10.0,'cameraPos':10.,'Zstep':0.05,2625 'Scale':1.0,'oldxy':[],'viewDir':[1,0,0]}}2626 G2plt.Plot3DSngl(G2frame,newPlot=True,Data=controls,hklRef=refList,Title=phaseName)2627 2628 2627 if G2frame.dataDisplay: 2629 2628 G2frame.dataFrame.Clear() 2630 2629 Inst = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,G2frame.PatternId, 'Instrument Parameters'))[0] 2630 if phaseName: 2631 pId = G2gd.GetPatternTreeItemId(G2frame,G2frame.root,'Phases') 2632 phaseId = G2gd.GetPatternTreeItemId(G2frame,pId,phaseName) 2633 General = G2frame.PatternTree.GetItemPyData(phaseId)['General'] 2634 Super = General.get('Super',0) 2635 SuperVec = General.get('SuperVec',[]) 2636 else: 2637 Super = 0 2638 SuperVec = [] 2631 2639 rowLabels = [] 2632 2640 if HKLF: 2633 2641 G2gd.SetDataMenuBar(G2frame) 2634 refs = data[1]['RefList'] 2635 Super = data[1].get('Super',0) 2642 refList = data[1]['RefList'] 2643 G2gd.SetDataMenuBar(G2frame,G2frame.dataFrame.ReflMenu) 2644 if not G2frame.dataFrame.GetStatusBar(): 2645 Status = G2frame.dataFrame.CreateStatusBar() 2646 G2frame.Bind(wx.EVT_MENU, OnPlotHKL, id=G2gd.wxID_PWDHKLPLOT) 2647 G2frame.Bind(wx.EVT_MENU, OnPlot3DHKL, id=G2gd.wxID_PWD3DHKLPLOT) 2648 G2frame.dataFrame.SelectPhase.Enable(False) 2649 refs = refList 2636 2650 else: 2637 Super = 0 #for now2638 2651 G2gd.SetDataMenuBar(G2frame,G2frame.dataFrame.ReflMenu) 2639 2652 if not G2frame.dataFrame.GetStatusBar(): … … 2647 2660 try: #patch for old reflection lists 2648 2661 refList = np.array(data[G2frame.RefList]['RefList']) 2649 I100 = refList.T[8 ]*refList.T[11]2662 I100 = refList.T[8+Super]*refList.T[11+Super] 2650 2663 except TypeError: 2651 refList = np.array([refl[:11 ] for refl in data[G2frame.RefList]])2652 I100 = refList.T[8 ]*np.array([refl[11] for refl in data[G2frame.RefList]])2664 refList = np.array([refl[:11+Super] for refl in data[G2frame.RefList]]) 2665 I100 = refList.T[8+Super]*np.array([refl[11+Super] for refl in data[G2frame.RefList]]) 2653 2666 Imax = np.max(I100) 2654 2667 if Imax: 2655 2668 I100 *= 100.0/Imax 2656 2669 if 'C' in Inst['Type'][0]: 2657 refs = np.vstack((refList.T[:15 ],I100)).T2670 refs = np.vstack((refList.T[:15+Super],I100)).T 2658 2671 elif 'T' in Inst['Type'][0]: 2659 refs = np.vstack((refList.T[:18 ],I100)).T2672 refs = np.vstack((refList.T[:18+Super],I100)).T 2660 2673 2661 2674 for i in range(len(refs)): rowLabels.append(str(i)) … … 2679 2692 colLabels = ['H','K','L','mul','d','pos','sig','gam','Fosq','Fcsq','phase','Icorr','alp','bet','wave','Prfo','Abs','Ext','I100'] 2680 2693 Types += 7*[wg.GRID_VALUE_FLOAT+':10,3',] 2694 if Super: 2695 for i in range(Super): 2696 colLabels.insert(3+i,superLabels[i]) 2681 2697 2682 2698 G2frame.PeakTable = G2gd.Table(refs,rowLabels=rowLabels,colLabels=colLabels,types=Types) -
trunk/imports/G2phase.py
r1503 r1506 363 363 self.errors = 'no spgroup record found after cell record' 364 364 return False 365 365 366 def Reader(self,filename,filepointer, ParentFrame=None, **unused): 366 367 'Read a m50 file using :meth:`ReadJANAPhase`' … … 382 383 Title = os.path.basename(filename) 383 384 Compnd = '' 385 Type = 'nuclear' 384 386 Atoms = [] 385 387 Atypes = [] 388 SuperVec = [[[0,0,.1],False,4],[[0,0,.1],False,4],[[0,0,.1],False,4]] 386 389 S = file.readline() 387 390 line = 1 388 391 SGData = None 392 SuperSg = '' 389 393 cell = None 394 nqi = 0 390 395 while S: 391 396 self.errors = 'Error reading at line '+str(line) … … 398 403 Volume = G2lat.calc_V(G2lat.cell2A(cell)) 399 404 elif 'spgroup' in S: 405 if 'X' in S: 406 raise self.ImportException("Supersymmetry too high; GSAS-II limited to (3+1) supersymmetry") 400 407 SpGrp = S.split()[1] 408 if '(' in SpGrp: #supercell symmetry - split in 2 409 SuperStr = SpGrp.split('(') 410 SpGrp = SuperStr[0] 411 SuperSg = '('+SuperStr[1] 401 412 SpGrpNorm = G2spc.StandardizeSpcName(SpGrp) 402 413 E,SGData = G2spc.SpcGroup(SpGrp) 403 414 # space group processing failed, try to look up name in table 404 if E:405 SpGrpNorm = G2spc.StandardizeSpcName(SpGrp)406 if SpGrpNorm:407 E,SGData = G2spc.SpcGroup(SpGrpNorm)408 415 while E: 409 416 print G2spc.SGErrors(E) … … 421 428 SGlines = G2spc.SGPrint(SGData) 422 429 for l in SGlines: print l 430 elif 'qi' in S[:2]: 431 if nqi: 432 raise self.ImportException("Supersymmetry too high; GSAS-II limited to (3+1) supersymmetry") 433 Type = 'modulated' 434 vec = S.split()[1:] 435 SuperVec[nqi] = [[float(vec[i]) for i in range(3)],False,4] 436 nqi += 1 423 437 elif 'atom' in S[:4]: 424 438 Atypes.append(S.split()[1]) … … 431 445 self.warnings += "Change this in phase's General tab." 432 446 SGData = G2IO.SGData # P 1 447 waveTypes = ['Fourier','Sawtooth','ZigZag',] 433 448 filename2 = os.path.splitext(filename)[0]+'.m40' 434 449 file2 = open(filename2,'Ur') … … 439 454 for i in range(4): 440 455 S = file2.readline() 441 line = 5442 456 for i in range(nAtoms): 443 457 S1 = file2.readline() 444 S2 = file2.readline() 458 S1N = S1.split()[-3:] # no. occ, no. pos waves, no. ADP waves 459 S1N = [int(i) for i in S1N] 460 S1T = list(S1[60:63]) 461 waveType = waveTypes[int(S1T[1])] 462 crenelType = '' 463 Spos = [] 464 Sadp = [] 465 Sfrac = [] 466 Smag = [] 445 467 XYZ = [float(S1[27:36]),float(S1[36:45]),float(S1[45:54])] 446 468 SytSym,Mult = G2spc.SytSym(XYZ,SGData) 447 Type = Atypes[int(S1[9:11])-1]469 aType = Atypes[int(S1[9:11])-1] 448 470 Name = S1[:8].strip() 449 471 if S1[11:15].strip() == '1': 472 S2 = file2.readline() 450 473 Uiso = float(S2[:9]) 451 474 Uij = [0,0,0,0,0,0] 452 475 IA = 'I' 453 476 elif S1[11:15].strip() == '2': 477 S2 = file2.readline() 454 478 IA = 'A' 455 479 Uiso = 0. 456 480 Uij = [float(S2[:9]),float(S2[9:18]),float(S2[18:27]), 457 481 float(S2[27:36]),float(S2[36:45]),float(S2[45:54])] 458 Atom = [Name,Type,'',XYZ[0],XYZ[1],XYZ[2],1.0,SytSym,Mult,IA,Uiso, 459 Uij[0],Uij[1],Uij[2],Uij[3],Uij[4],Uij[5]] 482 for i in range(S1N[0]): 483 if not i: 484 FS = file2.readline() 485 Sfrac.append(FS[:9]) #'O' or 'delta' = 'length' for crenel 486 if int(S1T[0]): #"", "Legendre" or "Xharm" in 18:27 for "crenel"! 487 waveType = 'Crenel/Fourier' #all waves 'Fourier' no other choice 488 crenelType = FS[18:27] 489 Sfrac.append(file2.readline()[:18]) #if not crenel = Osin & Ocos 490 # else Osin & Ocos except last one is X40 = 'Center' 491 for i in range(S1N[1]): 492 Spos.append(file2.readline()[:54]) 493 for i in range(S1N[2]): 494 Sadp.append(file2.readline()[:54]+file2.readline()) 495 if sum(S1N): #if any waves: skip mystery line? 496 file2.readline() 497 for i,it in enumerate(Sfrac): 498 print i,it 499 if not i: 500 if 'Crenel' in waveType: 501 vals = [float(it),float(Sfrac[-1][:9])] 502 else: 503 vals = [float(it),] 504 else: 505 vals = [float(it[:9]),float(it[9:18])] 506 if 'Crenel' in waveType and i == len(Sfrac)-1: 507 del Sfrac[-1] 508 break 509 Sfrac[i] = [vals,False] 510 print Sfrac[i] 511 for i,it in enumerate(Spos): 512 vals = [float(it[:9]),float(it[9:18]),float(it[18:27]),float(it[27:36]),float(it[36:45]),float(it[45:54])] 513 Spos[i] = [vals,False] 514 for i,it in enumerate(Sadp): 515 vals = [float(it[:9]),float(it[9:18]),float(it[18:27]),float(it[27:36]),float(it[36:45]),float(it[45:54]), 516 float(it[54:63]),float(it[63:72]),float(it[72:81]),float(it[81:90]),float(it[90:99]),float(it[99:108])] 517 Sadp[i] = [vals,False] 518 Atom = [Name,aType,'',XYZ[0],XYZ[1],XYZ[2],1.0,SytSym,Mult,IA,Uiso] 519 Atom += Uij 520 Atom.append({'SS1':{'waveType':waveType,'crenelType':crenelType,'Sfrac':Sfrac,'Spos':Spos,'Sadp':Sadp,'Smag':Smag}}) #SS2 is for (3+2), etc. 460 521 Atom.append(ran.randint(0,sys.maxint)) 461 522 Atoms.append(Atom) 462 line += 2463 523 file2.close() 464 524 self.errors = 'Error after read complete' … … 468 528 raise self.ImportException("No cell found") 469 529 Phase = G2IO.SetNewPhase(Name=Title,SGData=SGData,cell=cell+[Volume,]) 470 Phase['General']['Type'] = 'nuclear' 530 Phase['General']['Type'] = Type 531 Phase['General']['Super'] = nqi 532 Phase['General']['SuperVec'] = SuperVec 533 Phase['General']['SuperSg'] = SuperSg 471 534 Phase['General']['AtomPtrs'] = [3,1,7,9] 472 535 Phase['Atoms'] = Atoms -
trunk/imports/G2pwd_fxye.py
r1476 r1506 161 161 if j < Nch: 162 162 x.append(xi) 163 y.append(yi) 164 w.append(1.0/vi) 163 if vi <= 0.: 164 y.append(0.) 165 w.append(0.) 166 else: 167 y.append(yi) 168 w.append(1.0/vi) 165 169 S = File.readline() 166 170 N = len(x) -
trunk/imports/G2sfact.py
r1503 r1506 191 191 self.errors = 'Error after reading reflections (unexpected!)' 192 192 self.RefDict['RefList'] = np.array(self.RefDict['RefList']) 193 print self.RefDict['RefList'].shape194 193 self.RefDict['Type'] = 'SXC' 195 194 self.RefDict['Super'] = self.Super
Note: See TracChangeset
for help on using the changeset viewer.