Changeset 3254
- Timestamp:
- Feb 1, 2018 12:44:02 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIIO.py
r3246 r3254 799 799 return Id #last powder pattern generated 800 800 801 def XYsave(G2frame,XY,labelX='X',labelY='Y',names= None):801 def XYsave(G2frame,XY,labelX='X',labelY='Y',names=[]): 802 802 'Save XY table data' 803 803 pth = G2G.GetExportPath(G2frame) … … 817 817 return 818 818 for i in range(len(XY)): 819 if names != None:819 if len(names): 820 820 header = '%s,%s(%s)\n'%(labelX,labelY,names[i]) 821 821 else: -
trunk/GSASIIdataGUI.py
r3251 r3254 4289 4289 return 4290 4290 dlg = wx.ProgressDialog('Residual','All data Rw =',101.0, 4291 style = wx.PD_ELAPSED_TIME|wx.PD_AUTO_HIDE|wx.PD_CAN_ABORT ,4291 style = wx.PD_ELAPSED_TIME|wx.PD_AUTO_HIDE|wx.PD_CAN_ABORT|wx.STAY_ON_TOP, 4292 4292 parent=self) 4293 4293 Size = dlg.GetSize() … … 4295 4295 dlg.SetSize((int(Size[0]*1.2),Size[1])) # increase size a bit along x 4296 4296 dlg.CenterOnParent() 4297 dlg.Raise() 4297 4298 Rw = 100.00 4298 4299 self.SaveTreeSetting() -
trunk/GSASIImath.py
r3247 r3254 3455 3455 ang0 = np.angle(Fh0,deg=True)/360. 3456 3456 for H,phi in list(zip(Uniq,Phi))[1:]: 3457 H = np.array(H,dtype=int) 3457 3458 ang = (np.angle(Fhklm[H[0],H[1],H[2],H[3]],deg=True)/360.-phi) 3458 3459 dH = H-hklm -
trunk/GSASIIphsGUI.py
r3247 r3254 1485 1485 generalData['SuperSg'] = SetDefaultSSsymbol() 1486 1486 generalData['SSGData'] = G2spc.SSpcGroup(generalData['SGData'],generalData['SuperSg'])[1] 1487 if 'Super ' not in generalData:1487 if 'SuperVec' not in generalData: 1488 1488 generalData['Super'] = 1 1489 1489 generalData['SuperVec'] = [[0.,0.,0.],False,4] … … 1508 1508 wx.CallAfter(UpdateGeneral) 1509 1509 else: 1510 G2frame.ErrorDialog('Modulation type change error','Can change modulation only if there are no atoms') 1511 modulated.SetValue(generalData['Modulated']) 1510 if generalData['Type'] == 'magnetic': 1511 pages = [G2frame.phaseDisplay.GetPageText(PageNum) for PageNum in range(G2frame.phaseDisplay.GetPageCount())] 1512 generalData['Modulated'] = modulated.GetValue() 1513 if generalData['Modulated']: 1514 if 'SuperSg' not in generalData: 1515 generalData['SuperSg'] = SetDefaultSSsymbol() 1516 generalData['SSGData'] = G2spc.SSpcGroup(generalData['SGData'],generalData['SuperSg'])[1] 1517 if 'SuperVec' not in generalData: 1518 generalData['Super'] = 1 1519 generalData['SuperVec'] = [[0.,0.,0.],False,4] 1520 generalData['SSGData'] = {} 1521 if '4DmapData' not in generalData: 1522 generalData['4DmapData'] = mapDefault.copy() 1523 generalData['4DmapData'].update({'MapType':'Fobs'}) 1524 if 'Wave Data' not in pages: 1525 G2frame.waveData = wx.ScrolledWindow(G2frame.phaseDisplay) 1526 G2frame.phaseDisplay.InsertPage(3,G2frame.waveData,'Wave Data') 1527 Id = wx.NewId() 1528 TabSelectionIdDict[Id] = 'Wave Data' 1529 Atoms = data['Atoms'] 1530 for atom in Atoms: 1531 atom += [[],[],{'SS1':{'waveType':'Fourier','Sfrac':[],'Spos':[],'Sadp':[],'Smag':[]}}] 1532 wx.CallAfter(UpdateGeneral) 1533 else: 1534 G2frame.ErrorDialog('Modulation type change error','Can change modulation only if there are no atoms') 1535 modulated.SetValue(generalData['Modulated']) 1512 1536 1513 1537 nameSizer = wx.BoxSizer(wx.HORIZONTAL) … … 1860 1884 modSizer = wx.BoxSizer(wx.HORIZONTAL) 1861 1885 modSizer.Add(wx.StaticText(General,label=' '+name.capitalize()+' structure controls: '),0,WACV) 1862 SpGrp = generalData['SGData']['SpGrp'] 1863 if generalData['SGData']['SGGray']: 1886 SGData = generalData['SGData'] 1887 SpGrp = SGData['SpGrp'] 1888 if SGData['SGGray']: 1864 1889 SpGrp += " 1'" 1865 1890 modSizer.Add(wx.StaticText(General,label=' Superspace group: %s '%SpGrp),0,WACV) 1866 1891 Choice = [] 1867 if not generalData['SGData']['SGFixed']: 1868 SSChoice = G2spc.SSChoice(generalData['SGData']) 1869 if generalData['SGData']['SGGray']: 1870 SSChoice = [item+'s' for item in SSChoice] 1892 if not SGData['SGFixed']: 1893 SSChoice = G2spc.SSChoice(SGData) 1871 1894 for item in SSChoice: 1872 E,SSG = G2spc.SSpcGroup( generalData['SGData'],item)1895 E,SSG = G2spc.SSpcGroup(SGData,item) 1873 1896 if SSG: Choice.append(item) 1897 if SGData['SGGray']: 1898 Choice = [G2spc.fixGray(SGData,item) for item in Choice] 1874 1899 if len(Choice): 1875 1900 superGp = wx.ComboBox(General,value=generalData['SuperSg'],choices=Choice,style=wx.CB_DROPDOWN|wx.TE_PROCESS_ENTER) … … 4827 4852 if 'Plane' not in drawingData: 4828 4853 drawingData['Plane'] = [[0,0,1],False,False,0.0,[255,255,0]] 4854 if 'magMult' not in drawingData: 4855 drawingData['magMult'] = 1.0 4829 4856 cx,ct,cs,ci = [0,0,0,0] 4830 4857 if generalData['Type'] in ['nuclear','faulted',]: -
trunk/GSASIIplot.py
r3248 r3254 2983 2983 ################################################################################ 2984 2984 2985 def PlotXY(G2frame,XY,XY2= None,labelX='X',labelY='Y',newPlot=False,2985 def PlotXY(G2frame,XY,XY2=[],labelX='X',labelY='Y',newPlot=False, 2986 2986 Title='',lines=False,names=[],names2=[],vertLines=[]): 2987 2987 '''simple plot of xy data … … 3018 3018 if len(XY): 3019 3019 G2IO.XYsave(G2frame,XY,labelX,labelY,names) 3020 if XY2 != []:3020 if len(XY2): 3021 3021 G2IO.XYsave(G2frame,XY2,labelX,labelY,names2) 3022 3022 # else: … … 6254 6254 def Set4DMapRoll(newxy): 6255 6255 rho = generalData['4DmapData']['rho'] 6256 roll = GetRoll(newxy,rho.shape[:3]) 6257 generalData['4DmapData']['rho'] = np.roll(np.roll(np.roll(rho,roll[0],axis=0),roll[1],axis=1),roll[2],axis=2) 6256 if len(rho): 6257 roll = GetRoll(newxy,rho.shape[:3]) 6258 generalData['4DmapData']['rho'] = np.roll(np.roll(np.roll(rho,roll[0],axis=0),roll[1],axis=1),roll[2],axis=2) 6258 6259 6259 6260 def SetPeakRoll(newxy): -
trunk/GSASIIspc.py
r3247 r3254 1080 1080 1081 1081 """ 1082 1083 # def checkModSym(): 1084 # ''' 1085 # Checks to see if proposed modulation form is allowed for Laue group 1086 # ''' 1087 # if LaueId in [0,] and LaueModId in [0,]: 1088 # return True 1089 # elif LaueId in [1,]: 1090 # try: 1091 # if modsym.index('1/2') != ['A','B','C'].index(SGData['SGLatt']): 1092 # return False 1093 # if 'I'.index(SGData['SGLatt']) and modsym.count('1/2') not in [0,2]: 1094 # return False 1095 # except ValueError: 1096 # pass 1097 # if SGData['SGUniq'] == 'a' and LaueModId in [5,6,7,8,9,10,]: 1098 # return True 1099 # elif SGData['SGUniq'] == 'b' and LaueModId in [3,4,13,14,15,16,]: 1100 # return True 1101 # elif SGData['SGUniq'] == 'c' and LaueModId in [1,2,19,20,21,22,]: 1102 # return True 1103 # elif LaueId in [2,] and LaueModId in [i+7 for i in range(18)]: 1104 # try: 1105 # if modsym.index('1/2') != ['A','B','C'].index(SGData['SGLatt']): 1106 # return False 1107 # if SGData['SGLatt'] in ['I','F',] and modsym.index('1/2'): 1108 # return False 1109 # except ValueError: 1110 # pass 1111 # return True 1112 # elif LaueId in [3,4,] and LaueModId in [19,22,]: 1113 # try: 1114 # if SGData['SGLatt'] == 'I' and modsym.count('1/2'): 1115 # return False 1116 # except ValueError: 1117 # pass 1118 # return True 1119 # elif LaueId in [7,8,9,] and LaueModId in [19,25,]: 1120 # if (SGData['SGLatt'] == 'R' or SGData['SGPtGrp'] in ['3m1','-3m1']) and modsym.count('1/3'): 1121 # return False 1122 # return True 1123 # elif LaueId in [10,11,] and LaueModId in [19,]: 1124 # return True 1125 # return False 1126 1082 1127 1083 def fixMonoOrtho(): 1128 1084 mod = ''.join(modsym).replace('1/2','0').replace('1','0') … … 1147 1103 else: #orthorhombic 1148 1104 return [-SSGKl[i] if mod[i] in ['a','b','g'] else SSGKl[i] for i in range(3)] 1149 1105 1150 1106 def extendSSGOps(SSGOps): 1151 1107 for OpA in SSGOps: … … 1409 1365 return gensym 1410 1366 1411 # LaueModList = [1412 # 'abg','ab0','ab1/2','a0g','a1/2g', '0bg','1/2bg','a00','a01/2','a1/20',1413 # 'a1/21/2','a01','a10','0b0','0b1/2', '1/2b0','1/2b1/2','0b1','1b0','00g',1414 # '01/2g','1/20g','1/21/2g','01g','10g', '1/31/3g']1415 # LaueList = ['-1','2/m','mmm','4/m','4/mmm','3R','3mR','3','3m1','31m','6/m','6/mmm','m3','m3m']1416 # GenSymList = ['','s','0s','s0', '00s','0s0','s00','s0s','ss0','0ss','q00','0q0','00q','qq0','q0q', '0qq',1417 # 'q','qqs','s0s0','00ss','s00s','t','t00','t0','h','h00','000s','0000s']1418 1367 Fracs = {'1/2':0.5,'1/3':1./3,'1':1.0,'0':0.,'s':.5,'t':1./3,'q':.25,'h':1./6,'a':0.,'b':0.,'g':0.} 1419 # LaueId = LaueList.index(SGData['SGLaue'])1420 1368 if SGData['SGLaue'] in ['m3','m3m']: 1421 1369 return '(3+1) superlattices not defined for cubic space groups',None … … 1426 1374 except ValueError: 1427 1375 return 'Error in superspace symbol '+SSymbol,None 1428 # if ''.join(gensym) not in GenSymList:1429 # if SGData['SGGray'] and ''.join(gensym[:-1]) not in GenSymList:1430 # return 'unknown generator symbol '+''.join(gensym),None1431 # try:1432 # LaueModId = LaueModList.index(''.join(modsym))1433 # except ValueError:1434 # return 'Unknown modulation symbol '+''.join(modsym),None1435 # if not checkModSym():1436 # return 'Modulation '+''.join(modsym)+' not consistent with space group '+SGData['SpGrp'],None1437 1376 modQ = [Fracs[mod] for mod in modsym] 1438 1377 SSGKl = SGData['SSGKl'][:] … … 1519 1458 return ssChoice 1520 1459 1460 def fixGray(SGData,SSymbol): 1461 modsym,gensym = SSymbol.replace(' ','').split(')') 1462 modsym += ')' 1463 if gensym: 1464 gensym += 's' 1465 else: 1466 if SGData['SGPtGrp'] in ['1','2','m','3','4','6']: 1467 gensym += '0s' 1468 elif SGData['SGPtGrp'] in ['2/m','4/m','6/m']: 1469 gensym += '00s' 1470 elif SGData['SGPtGrp'] in ['4/mmm','6/mmm']: 1471 gensym += '0000s' 1472 else: 1473 gensym += '000s' 1474 return modsym+gensym 1475 1521 1476 def splitSSsym(SSymbol): 1522 1477 ''' -
trunk/GSASIIstrMath.py
r3245 r3254 4168 4168 if dlg: 4169 4169 dlg.Update(Histogram['Residuals']['wR'],newmsg='Hessian for histogram %d\nAll data Rw=%8.3f%s'%(hId,Histogram['Residuals']['wR'],'%')) 4170 dlg.Raise() 4170 4171 if len(Hess): 4171 4172 Hess += np.inner(dMdvh,dMdvh) … … 4190 4191 if dlg: 4191 4192 dlg.Update(Histogram['Residuals']['wR'],newmsg='Hessian for histogram %d Rw=%8.3f%s'%(hId,Histogram['Residuals']['wR'],'%'))[0] 4193 dlg.Raise() 4192 4194 if len(Hess): 4193 4195 Vec += wtFactor*np.sum(dMdvh*wdf,axis=1) … … 4270 4272 if dlg: 4271 4273 dlg.Update(Histogram['Residuals']['wR'],newmsg='For histogram %d Rw=%8.3f%s'%(hId,Histogram['Residuals']['wR'],'%'))[0] 4274 dlg.Raise() 4272 4275 M = np.concatenate((M,wdy)) 4273 4276 #end of PWDR processing … … 4413 4416 if dlg: 4414 4417 dlg.Update(Histogram['Residuals']['wR'],newmsg='For histogram %d Rw=%8.3f%s'%(hId,Histogram['Residuals']['wR'],'%'))[0] 4418 dlg.Raise() 4415 4419 M = np.concatenate((M,wtFactor*df)) 4416 4420 # end of HKLF processing -
trunk/imports/G2sfact.py
r3245 r3254 210 210 first = True 211 211 fp = open(filename,'r') 212 m1 = 0 212 213 for line,S in enumerate(fp): 213 214 self.errors = ' Error reading line '+str(line+1) … … 229 230 if Tw in ['','0']: 230 231 Tw = '1' 231 if not any([h,k,l ]):232 if not any([h,k,l,m1]): 232 233 break 233 234 if '-' in Tw:
Note: See TracChangeset
for help on using the changeset viewer.