Changeset 2754
- Timestamp:
- Mar 14, 2017 10:19:59 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASII.py
r2753 r2754 381 381 :class:`GSASIIIO.ImportStructFactor`, 382 382 :class:`GSASIIIO.ImportPowderData`, 383 :class:`GSASIIIO.ImportSmallAngleData` or 383 :class:`GSASIIIO.ImportSmallAngleData` 384 :class:`GSASIIIO.ImportReflectometryData` or 384 385 :class:`GSASIIIO.ImportImage`. 385 386 If a specific reader is specified, only that method will be called, … … 1945 1946 'Dummy':False, 1946 1947 'ranId':ran.randint(0,sys.maxint), 1948 'Offset':[0.0,0.0], 1947 1949 } 1948 1950 rd.Sample['ranId'] = valuesdict['ranId'] # this should be removed someday … … 2059 2061 'Dummy':False, 2060 2062 'ranId':ran.randint(0,sys.maxint), 2063 'Offset':[0.0,0.0], 2061 2064 } 2062 2065 rd.Sample['ranId'] = valuesdict['ranId'] # this should be removed someday … … 2501 2504 self.undofile = '' 2502 2505 self.TreeItemDelete = False 2503 self.plotStyle = {'qPlot':False,'dPlot':False,'sqrtPlot':False }2506 self.plotStyle = {'qPlot':False,'dPlot':False,'sqrtPlot':False,'sqPlot':False} 2504 2507 self.Weight = False 2505 2508 self.IfPlot = False … … 2523 2526 self.logPlot = False 2524 2527 self.plusPlot = True 2525 self.sqPlot = False2526 2528 self.ErrorBars = False 2527 2529 self.Contour = False -
trunk/GSASIIIO.py
r2721 r2754 1750 1750 1751 1751 ###################################################################### 1752 class ImportReflectometryData(ImportBaseclass): 1753 '''Defines a base class for the reading of files with small angle data. 1754 See :ref:`Writing a Import Routine<Import_Routines>` 1755 for an explanation on how to use this class. 1756 ''' 1757 def __init__(self,formatName,longFormatName=None,extensionlist=[], 1758 strictExtension=False,): 1759 1760 ImportBaseclass.__init__(self,formatName,longFormatName,extensionlist, 1761 strictExtension) 1762 self.ReInitialize() 1763 1764 def ReInitialize(self): 1765 'Reinitialize the Reader to initial settings' 1766 ImportBaseclass.ReInitialize(self) 1767 self.reflectometryentry = ['',None,None] # (filename,Pos,Bank) 1768 self.reflectometrydata = [] # SASD dataset 1769 '''A small angle data set is a list with items [x,y,w,yc,yd]: 1770 np.array(x), # x-axis values 1771 np.array(y), # powder pattern intensities 1772 np.array(w), # 1/sig(intensity)^2 values (weights) 1773 np.array(yc), # calc. intensities (zero) 1774 np.array(yd), # obs-calc profiles 1775 np.array(yb), # preset bkg 1776 ''' 1777 self.comments = [] 1778 self.idstring = '' 1779 self.Sample = G2pdG.SetDefaultSample() 1780 self.GSAS = None # used in TOF 1781 self.clockWd = None # used in TOF 1782 self.numbanks = 1 1783 self.instdict = {} # place items here that will be transferred to the instrument parameters 1784 1785 ###################################################################### 1752 1786 class ImportImage(ImportBaseclass): 1753 1787 '''Defines a base class for the reading of images -
trunk/GSASIIgrid.py
r2747 r2754 4454 4454 if G2frame.dataDisplay: 4455 4455 G2frame.dataDisplay.Destroy() 4456 if kind in ['PWDR','SASD' ]:4456 if kind in ['PWDR','SASD','REFD']: 4457 4457 SetDataMenuBar(G2frame,G2frame.dataFrame.PWDRMenu) 4458 4458 G2frame.dataFrame.Bind(wx.EVT_MENU, OnErrorAnalysis, id=wxID_PWDANALYSIS) … … 4532 4532 G2frame.PatternTree.SetItemPyData(item,data) 4533 4533 G2frame.PatternId = item 4534 if kind in ['PWDR','SASD' ]:4534 if kind in ['PWDR','SASD','REFD',]: 4535 4535 NewPlot = True 4536 4536 if 'xylim' in dir(G2frame): … … 4744 4744 if G2frame.EnablePlot: 4745 4745 UpdatePWHKPlot(G2frame,'SASD',item) 4746 elif G2frame.PatternTree.GetItemText(item).startswith('REFD '): 4747 G2frame.PatternId = item 4748 #for i in G2frame.ExportPattern: i.Enable(True) 4749 if G2frame.EnablePlot: 4750 UpdatePWHKPlot(G2frame,'REFD',item) 4746 4751 elif G2frame.PatternTree.GetItemText(item).startswith('HKLF '): 4747 4752 G2frame.Sngl = True … … 4843 4848 G2frame.PatternId = G2frame.PatternTree.GetItemParent(item) 4844 4849 data = G2frame.PatternTree.GetItemPyData(item) 4845 G2pdG.UpdateModelsGrid(G2frame,data) 4846 G2plt.PlotPatterns(G2frame,plotType='SASD') 4847 if len(data['Size']['Distribution']): 4850 if prfx1 == 'SASD': 4851 G2pdG.UpdateModelsGrid(G2frame,data) 4852 elif prfx1 == 'REFD': 4853 G2pdG.UpdateREFDModelsGrid(G2frame,data) 4854 G2plt.PlotPatterns(G2frame,plotType=prfx1) 4855 if prfx1 == 'SASD' and len(data['Size']['Distribution']): 4848 4856 G2plt.PlotSASDSizeDist(G2frame) 4849 4857 elif G2frame.PatternTree.GetItemText(item) == 'Substances': -
trunk/GSASIIplot.py
r2740 r2754 1219 1219 #patch 1220 1220 data = G2frame.PatternTree.GetItemPyData(G2frame.PatternId) 1221 if 'Offset' not in data[0] and plotType in ['PWDR','SASD' ]: #plot offset data1221 if 'Offset' not in data[0] and plotType in ['PWDR','SASD','REFD']: #plot offset data 1222 1222 Ymax = max(data[1][1]) 1223 1223 data[0].update({'Offset':[0.0,0.0],'delOffset':0.02*Ymax,'refOffset':-0.1*Ymax, … … 1237 1237 G2frame.SinglePlot = True 1238 1238 newPlot = True 1239 elif event.key == 'e' and 'SASD' in plottype:1239 elif event.key == 'e' and plottype in ['SASD','REFD']: 1240 1240 G2frame.ErrorBars = not G2frame.ErrorBars 1241 1241 elif event.key == 'b': … … 1304 1304 G2frame.plotStyle['qPlot'] = not G2frame.plotStyle['qPlot'] 1305 1305 G2frame.plotStyle['dPlot'] = False 1306 elif 'SASD' in plottype:1306 elif plottype in ['SASD','REFD']: 1307 1307 newPlot = True 1308 1308 G2frame.plotStyle['sqPlot'] = not G2frame.plotStyle['sqPlot'] … … 1364 1364 except ValueError: #avoid bad value in asin beyond upper limit 1365 1365 pass 1366 elif 'SASD' in plottype:1366 elif plottype in ['SASD','REFD']: 1367 1367 q = xpos 1368 1368 dsp = 2.*np.pi/q … … 1390 1390 else: 1391 1391 G2frame.G2plotNB.status.SetStatusText('2-theta =%9.3f d =%9.5f q = %9.5f Intensity =%9.2f'%(xpos,dsp,q,ypos),1) 1392 elif 'SASD' in plottype:1392 elif plottype == 'SASD': 1393 1393 G2frame.G2plotNB.status.SetStatusText('q =%12.5g Intensity =%12.5g d =%9.1f'%(q,ypos,dsp),1) 1394 elif plottype == 'REFD': 1395 G2frame.G2plotNB.status.SetStatusText('q =%12.5g Reflectivity =%12.5g d =%9.1f'%(q,ypos,dsp),1) 1394 1396 else: 1395 1397 if G2frame.plotStyle['sqrtPlot']: … … 1808 1810 G2frame.xylim = limits 1809 1811 else: 1810 if plottype == 'SASD':1812 if plottype in ['SASD','REFD']: 1811 1813 G2frame.logPlot = True 1812 1814 G2frame.ErrorBars = True … … 1855 1857 'c: contour on','q: toggle q plot','t: toggle d-spacing plot','f: select data', 1856 1858 'm: toggle multidata plot','w: toggle divide by sig','+: toggle selection') 1857 elif 'SASD' in plottype:1859 elif plottype in ['SASD','REFD']: 1858 1860 if G2frame.SinglePlot: 1859 1861 Page.Choice = (' key press','b: toggle subtract background file','n: semilog on', … … 1875 1877 'q: toggle q plot','t: toggle d-spacing plot','m: toggle multidata plot','f: select data', 1876 1878 'w: toggle divide by sig','+: no selection') 1877 elif 'SASD' in plottype:1879 elif plottype in ['SASD','REFD']: 1878 1880 if G2frame.SinglePlot: 1879 1881 Page.Choice = (' key press','b: toggle subtract background file','n: loglog on','e: toggle error bars', … … 1935 1937 Title = 'log('+Title+')' 1936 1938 Plot.set_title(Title) 1937 if G2frame.plotStyle['qPlot'] or 'SASD' in plottypeand not G2frame.Contour:1939 if G2frame.plotStyle['qPlot'] or plottype in ['SASD','REFD'] and not G2frame.Contour: 1938 1940 Plot.set_xlabel(r'$Q, \AA^{-1}$',fontsize=16) 1939 1941 elif G2frame.plotStyle['dPlot'] and 'PWDR' in plottype and not G2frame.Contour: … … 1950 1952 if 'PWDR' in plottype: 1951 1953 Plot.set_ylabel(r'$\mathsf{I/\sigma(I)}$',fontsize=16) 1952 elif 'SASD' in plottype:1954 elif plottype in ['SASD','REFD']: 1953 1955 Plot.set_ylabel(r'$\mathsf{\Delta(I)/\sigma(I)}$',fontsize=16) 1954 1956 else: … … 1959 1961 else: 1960 1962 Plot.set_ylabel(r'$Intensity$',fontsize=16) 1961 elif 'SASD' in plottype:1962 if G2frame. sqPlot:1963 elif plottype == 'SASD': 1964 if G2frame.plotStyle['sqPlot']: 1963 1965 Plot.set_ylabel(r'$S(Q)=I*Q^{4}$',fontsize=16) 1964 1966 else: 1965 1967 Plot.set_ylabel(r'$Intensity,\ cm^{-1}$',fontsize=16) 1966 else: 1968 elif plottype == 'REFD': 1969 if G2frame.plotStyle['sqPlot']: 1970 Plot.set_ylabel(r'$S(Q)=R*Q^{4}$',fontsize=16) 1971 else: 1972 Plot.set_ylabel(r'$Reflectivity$',fontsize=16) 1973 else: #neutron TOF 1967 1974 if G2frame.plotStyle['sqrtPlot']: 1968 1975 Plot.set_ylabel(r'$\sqrt{Normalized\ intensity}$',fontsize=16) … … 2002 2009 else: 2003 2010 Y = xye[1]+offsetY*N*Ymax/100.0 2004 elif 'SASD' in plottype:2011 elif plottype in ['SASD','REFD']: 2005 2012 B = xye[5] 2006 if G2frame. sqPlot:2013 if G2frame.plotStyle['sqPlot']: 2007 2014 Y = xye[1]*Sample['Scale'][0]*(1.05)**(offsetY*N)*X**4 2008 2015 else: … … 2036 2043 else: 2037 2044 pP = '' 2038 if 'SASD' in plottypeand G2frame.logPlot:2045 if plottype in ['SASD','REFD'] and G2frame.logPlot: 2039 2046 X *= (1.01)**(offsetX*N) 2040 2047 else: … … 2059 2066 W = xye[4]+offsetY*N*Ymax/100.0 2060 2067 D = xye[5]-Pattern[0]['delOffset'] #powder background 2061 elif 'SASD' in plottype:2062 if G2frame. sqPlot:2068 elif plottype in ['SASD','REFD']: 2069 if G2frame.plotStyle['sqPlot']: 2063 2070 W = xye[4]*X**4 2064 2071 Z = xye[3]*X**4 … … 2083 2090 Plot.plot(X,Z,colors[(N+1)%6],picker=False) 2084 2091 Plot.plot(X,W,colors[(N+2)%6],picker=False) #background 2085 elif 'SASD' in plottype:2092 elif plottype in ['SASD','REFD']: 2086 2093 Plot.set_xscale("log",nonposx='mask') 2087 2094 Ibeg = np.searchsorted(X,limits[1][0]) … … 2096 2103 Plot.set_yscale("log",nonposy='mask') 2097 2104 if G2frame.ErrorBars: 2098 if G2frame. sqPlot:2105 if G2frame.plotStyle['sqPlot']: 2099 2106 Plot.errorbar(X,YB,yerr=X**4*Sample['Scale'][0]*np.sqrt(1./(Pattern[0]['wtFactor']*xye[2])), 2100 2107 ecolor=colors[N%6],picker=3.,clip_on=Clip_on) … … 2166 2173 if 'PWDR' in plottype: 2167 2174 Plot.semilogy(X,Y,colors[N%6],picker=False,nonposy='mask') 2168 elif 'SASD' in plottype:2175 elif plottype in ['SASD','REFD']: 2169 2176 Plot.semilogy(X,Y,colors[N%6],picker=False,nonposy='mask') 2170 2177 else: 2171 2178 if 'PWDR' in plottype: 2172 2179 Plot.plot(X,Y,colors[N%6],picker=False) 2173 elif 'SASD' in plottype:2180 elif plottype in ['SASD','REFD']: 2174 2181 Plot.loglog(X,Y,colors[N%6],picker=False,nonposy='mask') 2175 2182 Plot.set_ylim(bottom=np.min(np.trim_zeros(Y))/2.,top=np.max(Y)*2.) -
trunk/GSASIIpwd.py
r2740 r2754 337 337 qLimits = data['QScaleLim'] 338 338 minQ = np.searchsorted(Qpoints,qLimits[0]) 339 maxQ = np.searchsorted(Qpoints,qLimits[1]) 339 maxQ = np.searchsorted(Qpoints,qLimits[1])+1 340 340 newdata = [] 341 341 if len(IofQ) < 3: … … 427 427 newpeaks = copy.copy(peaks) 428 428 iBeg = np.searchsorted(data[1][0],newpeaks['Limits'][0]) 429 iFin = np.searchsorted(data[1][0],newpeaks['Limits'][1]) 429 iFin = np.searchsorted(data[1][0],newpeaks['Limits'][1])+1 430 430 X = data[1][0][iBeg:iFin] 431 431 Y = data[1][1][iBeg:iFin] … … 477 477 nR = len(Qdata) 478 478 R = 0.5*np.pi*np.linspace(0,nR,nR)/(4.*maxQ) 479 iFin = np.searchsorted(R,RDFcontrols['maxR']) 479 iFin = np.searchsorted(R,RDFcontrols['maxR'])+1 480 480 bBut,aBut = signal.butter(4,0.01) 481 481 Qsmooth = signal.filtfilt(bBut,aBut,Qdata) … … 1773 1773 cw = x[1:]-x[:-1] 1774 1774 xBeg = np.searchsorted(x,Limits[0]) 1775 xFin = np.searchsorted(x,Limits[1]) 1775 xFin = np.searchsorted(x,Limits[1])+1 1776 1776 bakType,bakDict,bakVary = SetBackgroundParms(Background) 1777 1777 dataType,insDict,insVary = SetInstParms(Inst) … … 1980 1980 x0 = profile[0] 1981 1981 iBeg = np.searchsorted(x0,limits[0]) 1982 iFin = np.searchsorted(x0,limits[1]) 1982 iFin = np.searchsorted(x0,limits[1])+1 1983 1983 if iFin-iBeg > 20000: 1984 1984 iFin = iBeg+20000 … … 2117 2117 x0 = profile[0] 2118 2118 iBeg = np.searchsorted(x0,limits[0]) 2119 iFin = np.searchsorted(x0,limits[1]) 2119 iFin = np.searchsorted(x0,limits[1])+1 2120 2120 if iFin-iBeg > 20000: 2121 2121 iFin = iBeg+20000 … … 2243 2243 profile[5] = np.zeros(len(profile[0])) 2244 2244 iBeg = np.searchsorted(x0,limits[0]) 2245 iFin = np.searchsorted(x0,limits[1]) 2245 iFin = np.searchsorted(x0,limits[1])+1 2246 2246 if iFin-iBeg > 20000: 2247 2247 iFin = iBeg+20000 -
trunk/GSASIIpwdGUI.py
r2753 r2754 44 44 VERY_LIGHT_GREY = wx.Colour(235,235,235) 45 45 WACV = wx.ALIGN_CENTER_VERTICAL 46 GkDelta = unichr(0x0394) 46 47 Pwr10 = unichr(0x0b9)+unichr(0x0b0) 47 48 Pwr20 = unichr(0x0b2)+unichr(0x0b0) … … 209 210 210 211 def SetDefaultREFDModel(): 211 'Fills in default items for the SASD Models dictionary' 212 return {'Back':[0.0,False],'Layers':[{'Thickness':[1000.,False],'Name':'vacuum'},],'BackFile':'',} 212 '''Fills in default items for the REFD Models dictionary 213 Defined as follows for each layer: 214 Name: name of substance 215 Thick: thickness of layer in Angstroms 216 Rough: upper surface roughness for layer 217 Penetration: mixing of layer substance into layer above 218 DenMul: multiplier for layer scattering density (default = 1.0) 219 Top layer defaults to vacuum (or air/any gas); can be substituted for some other substance 220 Bottom layer default: infinitely thisck Silicon; can be substituted for some other substance 221 ''' 222 return {'Layers':[{'Name':'vacuum','DenMul':[1.0,False],}, 223 {'Name':'vacuum','Thick':[1.e6,False],'Rough':[0.,False],'Penetration':[0.,False],'DenMul':[1.0,False]},], 224 'Zero':'Top','DualFitFile':'','FltBack':[0.0,False],'DualFltBack':[0.0,False], 225 'Scale':[1.0,False],'DualScale':[1.0,False],'Minimizer':'LMLS','Resolution':[0.,'Const dq/q'],'Recomb':0.5,'Toler':0.001} 213 226 214 227 def SetDefaultSubstances(): … … 1375 1388 1376 1389 def UpdateInstrumentGrid(G2frame,data): 1377 '''respond to selection of PWDR/SASD Instrument Parameters1390 '''respond to selection of PWDR/SASD/REFD Instrument Parameters 1378 1391 data tree item. 1379 1392 ''' … … 1912 1925 else: #time of flight (neutrons) 1913 1926 pass #for now 1914 elif 'L' in insVal['Type']:1927 elif insVal['Type'][0] in ['L','R',]: 1915 1928 if 'C' in insVal['Type']: 1916 1929 instSizer.Add(wx.StaticText(G2frame.dataDisplay,-1,u' Lam (\xc5): (%10.6f)'%(insDef['Lam'])), … … 2452 2465 mainSizer.Add(parmSizer,1,wx.EXPAND) 2453 2466 mainSizer.Add((0,5),0) 2454 if 'SASD' in histName:2467 if histName[:4] in ['SASD',]: 2455 2468 rho = [0.,0.] 2456 2469 anomrho = [0.,0.] … … 3604 3617 3605 3618 ################################################################################ 3606 ##### SASD Substances3619 ##### SASD/REFD Substances 3607 3620 ################################################################################ 3608 3621 3609 3622 def UpdateSubstanceGrid(G2frame,data): 3610 '''respond to selection of SASD Substance data tree item.3623 '''respond to selection of SASD/REFD Substance data tree item. 3611 3624 ''' 3612 3625 import Substances as substFile … … 4605 4618 4606 4619 ################################################################################ 4620 ##### REFD Models 4621 ################################################################################ 4622 4623 def UpdateREFDModelsGrid(G2frame,data): 4624 '''respond to selection of REFD Models data tree item. 4625 ''' 4626 4627 def ControlSizer(): 4628 4629 def OnRefPos(event): 4630 data['Zero'] = refpos.GetValue() 4631 4632 def OnMinSel(event): 4633 data['Minimizer'] = minSel.GetValue() 4634 4635 controlSizer = wx.BoxSizer(wx.VERTICAL) 4636 resol = wx.BoxSizer(wx.HORIZONTAL) 4637 resol.Add(wx.StaticText(G2frame.dataDisplay,label=' Instrument resolution (%'+GkDelta+'Q/Q): '),0,WACV) 4638 resol.Add(G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data['Resolution'],0,nDig=(10,2),typeHint=float),0,WACV) 4639 resol.Add(wx.StaticText(G2frame.dataDisplay,label=' Zero position location: '),0,WACV) 4640 poslist = ['Top','Bottom'] 4641 refpos = wx.ComboBox(G2frame.dataDisplay,value=data['Zero'],choices=poslist, 4642 style=wx.CB_READONLY|wx.CB_DROPDOWN) 4643 refpos.Bind(wx.EVT_COMBOBOX, OnRefPos) 4644 resol.Add(refpos,0,WACV) 4645 controlSizer.Add(resol,0,WACV) 4646 minimiz = wx.BoxSizer(wx.HORIZONTAL) 4647 minimiz.Add(wx.StaticText(G2frame.dataDisplay,label=' Minimizer: '),0,WACV) 4648 minlist = ['LMLS','Global','BFGS',] 4649 minSel = wx.ComboBox(G2frame.dataDisplay,value=data['Minimizer'],choices=minlist, 4650 style=wx.CB_READONLY|wx.CB_DROPDOWN) 4651 minSel.Bind(wx.EVT_COMBOBOX, OnMinSel) 4652 minimiz.Add(minSel,0,WACV) 4653 minimiz.Add(wx.StaticText(G2frame.dataDisplay,label=' Tolerance: '),0,WACV) 4654 minimiz.Add(G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'Toler',nDig=(10,1,'g'),typeHint=float),0,WACV) 4655 #Recomb':0.5, needed?? 4656 controlSizer.Add(minimiz,0,WACV) 4657 return controlSizer 4658 4659 def OverallSizer(): 4660 #'DualFitFile':'', 'DualFltBack':[0.0,False],'DualScale':[1.0,False] future for neutrons - more than one? 4661 4662 def OnScaleRef(event): 4663 data['Scale'][1] = scaleref.GetValue() 4664 4665 def OnBackRef(event): 4666 data['FltBack'][1] = backref.GetValue() 4667 4668 overall = wx.BoxSizer(wx.HORIZONTAL) 4669 overall.Add(wx.StaticText(G2frame.dataDisplay,label=' Scale: '),0,WACV) 4670 overall.Add(G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data['Scale'],0,nDig=(10,2),typeHint=float),0,WACV) 4671 scaleref = wx.CheckBox(G2frame.dataDisplay,label=' Refine? ') 4672 scaleref.SetValue(data['Scale'][1]) 4673 scaleref.Bind(wx.EVT_CHECKBOX, OnScaleRef) 4674 overall.Add(scaleref,0,WACV) 4675 overall.Add(wx.StaticText(G2frame.dataDisplay,label=' Flat bkg.: '),0,WACV) 4676 overall.Add(G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data['FltBack'],0,nDig=(10,2),typeHint=float),0,WACV) 4677 backref = wx.CheckBox(G2frame.dataDisplay,label=' Refine? ') 4678 backref.SetValue(data['FltBack'][1]) 4679 backref.Bind(wx.EVT_CHECKBOX, OnBackRef) 4680 overall.Add(backref,0,WACV) 4681 return overall 4682 4683 def LayerSizer(): 4684 #'Layers':[{'Name':'vacuum','DenMul':[1.0,False],}, 4685 # {'Name':'vacuum','Thick':[1.e6,False],'Rough':[0.,False],'Penetration':[0.,False],'DenMul':[1.0,False]} 4686 layerSizer = wx.BoxSizer(wx.VERTICAL) 4687 4688 4689 return layerSizer 4690 4691 4692 Sample = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,G2frame.PatternId, 'Sample Parameters')) 4693 Limits = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,G2frame.PatternId, 'Limits')) 4694 Inst = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,G2frame.PatternId, 'Instrument Parameters')) 4695 Substances = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,G2frame.PatternId, 'Substances')) 4696 ProfDict,Profile,Name = G2frame.PatternTree.GetItemPyData(G2frame.PatternId)[:3] 4697 if G2frame.dataDisplay: 4698 G2frame.dataFrame.DestroyChildren() # is this a ScrolledWindow? If so, bad! 4699 G2gd.SetDataMenuBar(G2frame,G2frame.dataFrame.ModelMenu) 4700 if not G2frame.dataFrame.GetStatusBar(): 4701 G2frame.dataFrame.CreateStatusBar() 4702 G2frame.dataFrame.SetLabel('Modelling') 4703 G2frame.dataDisplay = wxscroll.ScrolledPanel(G2frame.dataFrame) 4704 mainSizer = wx.BoxSizer(wx.VERTICAL) 4705 4706 mainSizer.Add(wx.StaticText(G2frame.dataDisplay,label=' Reflectometry fitting for: '+Name),0,WACV) 4707 mainSizer.Add(wx.StaticText(G2frame.dataDisplay,label=' Controls:'),0,WACV) 4708 mainSizer.Add(ControlSizer()) 4709 G2G.HorizontalLine(mainSizer,G2frame.dataDisplay) 4710 mainSizer.Add(wx.StaticText(G2frame.dataDisplay,label=' Global parameters:'),0,WACV) 4711 mainSizer.Add(OverallSizer()) 4712 G2G.HorizontalLine(mainSizer,G2frame.dataDisplay) 4713 mainSizer.Add(wx.StaticText(G2frame.dataDisplay,label=' Layers:'),0,WACV) 4714 mainSizer.Add(LayerSizer()) 4715 mainSizer.Layout() 4716 G2frame.dataDisplay.SetSizer(mainSizer) 4717 G2frame.dataDisplay.SetAutoLayout(1) 4718 G2frame.dataDisplay.SetupScrolling() 4719 Size = mainSizer.Fit(G2frame.dataFrame) 4720 Size[0] += 25 4721 G2frame.dataFrame.setSizePosLeft(Size) 4722 4723 ################################################################################ 4607 4724 ##### PDF controls 4608 4725 ################################################################################ -
trunk/GSASIIstrMath.py
r2753 r2754 3633 3633 x,y,w,yc,yb,yd = Histogram['Data'] 3634 3634 xB = np.searchsorted(x,Limits[0]) 3635 xF = np.searchsorted(x,Limits[1]) 3635 xF = np.searchsorted(x,Limits[1])+1 3636 3636 dMdvh = np.sqrt(w[xB:xF])*getPowderProfileDerv(parmDict,x[xB:xF], 3637 3637 varylist,Histogram,Phases,rigidbodyDict,calcControls,pawleyLookup) … … 3691 3691 dy = y-yc 3692 3692 xB = np.searchsorted(x,Limits[0]) 3693 xF = np.searchsorted(x,Limits[1]) 3693 xF = np.searchsorted(x,Limits[1])+1 3694 3694 dMdvh = getPowderProfileDerv(parmDict,x[xB:xF], 3695 3695 varylist,Histogram,Phases,rigidbodyDict,calcControls,pawleyLookup) … … 3767 3767 yd *= 0.0 3768 3768 xB = np.searchsorted(x,Limits[0]) 3769 xF = np.searchsorted(x,Limits[1]) 3769 xF = np.searchsorted(x,Limits[1])+1 3770 3770 yc[xB:xF],yb[xB:xF] = getPowderProfile(parmDict,x[xB:xF], 3771 3771 varylist,Histogram,Phases,calcControls,pawleyLookup)
Note: See TracChangeset
for help on using the changeset viewer.