# Changeset 428

Ignore:
Timestamp:
Nov 22, 2011 3:59:22 PM (11 years ago)
Message:

begin something for plotting size & PO figures as well as mustrain
allow sorting of the indexing result by volume
fix weights for "STD" GSAS powder data files

Location:
trunk
Files:
6 edited

Unmodified
Removed
• ## trunk/GSASII.py

 r427 'Cell':[False,10.,10.,10.,90.,90.,90,1000.], 'Pawley dmin':1.0, 'Data plot type':'Microstrain', 'SH Texture':{ 'Order':0,
• ## trunk/GSASIIIO.py

 r400 yi = max(sfloat(S[i+2:i+8]),0.0) if yi: ei = math.sqrt(yi*ni) ei = yi/ni else: yi = 0.0 x.append(xi) y.append(yi) w.append(1.0/ei**2) w.append(1.0/ei) S = File.readline() File.close()
• ## trunk/GSASIIindex.py

 r342 return X def sortVolume(cells): #cells is M20,X20,Bravais,a,b,c,alp,bet,gam,volume #sort smallest volume 1st T = [] for i,M in enumerate(cells): T.append((M[9],i)) D = dict(zip(T,cells)) T.sort() X = [] for key in T: X.append(D[key]) return X def IndexPeaks(peaks,HKL): import bisect pos = N-i                                       # reverse the order if dp > dm: pos += 1                            # closer to upper than lower if pos >= N: print pos,N break hkl = HKL[pos]                                 # put in hkl if hkl[4] >= 0:                                 # peak already assigned - test if this one better try: Peaks[8] = 1./np.sqrt(G2lat.calc_rDsq(H,A)) peaks = Peaks.T except FloatingPointError: print G2lat.calc_rDsq(H,A) Peaks[8] = 1.0 peaks = Peaks.T A = oldA M20,X20 = calc_M20(peaks,HKL)
• ## trunk/GSASIIphsGUI.py

 r416 if 'Isotope' not in generalData: generalData['Isotope'] = {} if 'Data plot type' not in generalData: generalData['Data plot type'] = 'Microstrain' generalData['NoAtoms'] = {} generalData['BondRadii'] = [] Indx = {} def OnPlotSel(event): generalData['Data plot type'] = plotSel.GetStringSelection() def OnShowData(event): Obj = event.GetEventObject() mainSizer = wx.BoxSizer(wx.VERTICAL) mainSizer.Add(wx.StaticText(dataDisplay,-1,'Histogram data for '+PhaseName+':'),0,wx.ALIGN_CENTER_VERTICAL) plotSizer = wx.BoxSizer(wx.HORIZONTAL) choice = ['Microstrain','Size','Preferred orientation'] plotSel = wx.RadioBox(dataDisplay,-1,'Select plot type:',choices=choice, majorDimension=3,style=wx.RA_SPECIFY_COLS) plotSel.SetStringSelection(generalData['Data plot type']) plotSel.Bind(wx.EVT_RADIOBOX,OnPlotSel) plotSizer.Add(plotSel) mainSizer.Add(plotSizer) for item in keyList: histData = UseList[item]
• ## trunk/GSASIIplot.py

 r426 Phases = self.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(self,PatternId,'Reflection Lists')) HKL = [] for peak in Phases[self.RefList]: HKL.append(peak[:6]) HKL = np.array(HKL) if Phases: for peak in Phases[self.RefList]: HKL.append(peak[:6]) HKL = np.array(HKL) else: HKL = np.array(self.HKL) else: Plot.plot(X,Y,colors[N%6],picker=False) if PickId: if PickId and not self.Contour: Values,Names = self.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(self,PatternId, 'Instrument Parameters'))[1::2] Parms = dict(zip(Names,Values)) Z = np.outer(np.ones(np.size(PHI)),npcosd(PSI)) if muStrain[0] == 'isotropic': muiso = muStrain[1][0]*math.pi/0.018      #centidegrees to radians! #                muiso = muStrain[1][0]*math.pi/0.018      #centidegrees to radians! muiso = muStrain[1][0] X *= muiso Y *= muiso R = muiso*muaniso/np.sqrt((muiso*cp)**2+(muaniso*sp)**2) #                    S = muiso+muaniso*cp           #old GSAS - wrong math!! return R*xyz*math.pi/0.018      #centidegrees to radians! #                    return R*xyz*math.pi/0.018      #centidegrees to radians! return R*xyz muiso,muaniso = muStrain[1][:2] axes = np.inner(A,np.array(muStrain[3]))
• ## trunk/GSASIIpwdGUI.py

 r416 else: G2plt.PlotPatterns(self) def OnSortCells(event): controls,bravais,cells,dmin = self.PatternTree.GetItemPyData(UnitCellsId) c =  event.GetCol() if colLabels[c] == 'M20': cells = G2indx.sortM20(cells) elif colLabels[c] == 'Volume': cells = G2indx.sortVolume(cells) else: return data = [controls,bravais,cells,dmin] self.PatternTree.SetItemPyData(UnitCellsId,data) UpdateUnitCellsGrid(self,data) def CopyUnitCell(event): self.dataFrame.CopyCell.Enable(True) gridDisplay.Bind(wg.EVT_GRID_CELL_LEFT_CLICK,RefreshUnitCellsGrid) gridDisplay.Bind(wg.EVT_GRID_LABEL_LEFT_DCLICK,OnSortCells) gridDisplay.SetMargins(0,0) gridDisplay.SetRowLabelSize(0)
Note: See TracChangeset for help on using the changeset viewer.