Changeset 529


Ignore:
Timestamp:
Apr 4, 2012 1:18:25 PM (11 years ago)
Author:
vondreele
Message:

fix rho min/max issues for contouring
fix errors in Fosq extraction in GSASIIstruct.py

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIElemGUI.py

    r528 r529  
    4343            El = wscs.ColourSelect(label=name[0], parent=self,colour=color,
    4444                pos=pos, size=wx.Size(self.butWid,23), style=wx.RAISED_BORDER)
    45 #            El.SetLabel(name)
    4645            El.Bind(wx.EVT_BUTTON, self.OnElButton)
    4746        else:
  • trunk/GSASIIphsGUI.py

    r527 r529  
    34413441        print 'Fourier map time: %.4f'%(time.time()-time0),'no. elements: %d'%(Fhkl.size)
    34423442        mapData['rho'] = np.real(rho)
    3443         mapData['rhoMax'] = np.max(np.real(rho))
     3443        mapData['rhoMax'] = max(np.max(mapData['rho']),-np.min(mapData['rho']))
    34443444        data['Drawing']['contourLevel'] = 1.
    34453445        data['Drawing']['mapSize'] = 10.
    3446         print mapData['MapType']+' computed: rhomax = %.3f rhomin = %.3f'%(mapData['rhoMax'],np.min(np.real(rho)))
     3446        print mapData['MapType']+' computed: rhomax = %.3f rhomin = %.3f'%(np.max(mapData['rho']),np.min(mapData['rho']))
    34473447        G2plt.PlotStructure(G2frame,data)                   
    34483448## map printing for testing purposes
  • trunk/GSASIIplot.py

    r526 r529  
    518518        if G2frame.PatternTree.GetItemText(PickId) in ['Peak List','Limits'] and xpos:
    519519            lines = []
    520             for line in G2frame.Lines: lines.append(line.get_xdata()[0])
     520            for line in G2frame.Lines:
     521                lines.append(line.get_xdata()[0])
     522#            print G2frame.itemPicked.get_xdata()
    521523            lineNo = lines.index(G2frame.itemPicked.get_xdata()[0])
    522524            if  lineNo in [0,1]:
  • trunk/GSASIIstruct.py

    r519 r529  
    23062306                kRatio = parmDict[hfx+'I(L2)/I(L1)']
    23072307            x,y,w,yc,yb,yd = Histogram['Data']
     2308            xB = np.searchsorted(x,Limits[0])
     2309            xF = np.searchsorted(x,Limits[1])
    23082310            ymb = np.array(y-yb)
    23092311            ycmb = np.array(yc-yb)
    23102312            ratio = np.where(ycmb!=0.,ymb/ycmb,0.0)           
    2311             xB = np.searchsorted(x,Limits[0])
    2312             xF = np.searchsorted(x,Limits[1])
    23132313            refLists = Histogram['Reflection Lists']
    23142314            for phase in refLists:
     
    23252325                        yp = np.zeros_like(yb)
    23262326                        Wd,fmin,fmax = G2pwd.getWidths(refl[5],refl[6],refl[7],shl)
    2327                         iBeg = np.searchsorted(x[xB:xF],refl[5]-fmin)
    2328                         iFin = np.searchsorted(x[xB:xF],refl[5]+fmax)
     2327                        iBeg = max(xB,np.searchsorted(x,refl[5]-fmin))
     2328                        iFin = min(np.searchsorted(x,refl[5]+fmax),xF)
    23292329                        iFin2 = iFin
    2330                         yp[iBeg:iFin] = refl[13]*refl[9]*G2pwd.getFCJVoigt3(refl[5],refl[6],refl[7],shl,x[iBeg:iFin])    #>90% of time spent here                           
     2330                        yp[iBeg:iFin] = refl[13]*refl[9]*G2pwd.getFCJVoigt3(refl[5],refl[6],refl[7],shl,x[iBeg:iFin])    #>90% of time spent here
    23312331                        if Ka2:
    23322332                            pos2 = refl[5]+lamRatio*tand(refl[5]/2.0)       # + 360/pi * Dlam/lam * tan(th)
    23332333                            Wd,fmin,fmax = G2pwd.getWidths(pos2,refl[6],refl[7],shl)
    2334                             iBeg2 = np.searchsorted(x,pos2-fmin)
    2335                             iFin2 = np.searchsorted(x,pos2+fmax)
     2334                            iBeg2 = max(xB,np.searchsorted(x[xB:xF],pos2-fmin))
     2335                            iFin2 = min(np.searchsorted(x[xB:xF],pos2+fmax),xF)
    23362336                            yp[iBeg2:iFin2] += refl[13]*refl[9]*kRatio*G2pwd.getFCJVoigt3(pos2,refl[6],refl[7],shl,x[iBeg2:iFin2])        #and here
    23372337                        refl[8] = np.sum(np.where(ratio[iBeg:iFin2]>0.,yp[iBeg:iFin2]*ratio[iBeg:iFin2]/(refl[13]*(1.+kRatio)),0.0))
Note: See TracChangeset for help on using the changeset viewer.