# Changeset 1646

Ignore:
Timestamp:
Feb 11, 2015 1:33:27 PM (8 years ago)
Message:

allow search for negative density peaks in charge flip and Fourier maps
plot negative density in neutron maps & negative peaks in red

Location:
trunk
Files:
3 edited

Unmodified
Added
Removed
• ## trunk/GSASIImath.py

 r1645 return mapData,map4DData def SearchMap(generalData,drawingData): def SearchMap(generalData,drawingData,Neg=False): '''Does a search of a density map for peaks meeting the criterion of peak height is greater than mapData['cutOff']/100 of mapData['rhoMax'] where mapData is data['General']['mapData']; the map is also in mapData. :param data: the phase data structure :param generalData: the phase data structure; includes the map :param drawingData: the drawing data structure :param Neg:  if True then search for negative peaks (i.e. H-atoms & neutron data) :returns: (peaks,mags,dzeros) where mapData = generalData['Map'] contLevel = mapData['cutOff']*mapData['rhoMax']/100. rho = copy.copy(mapData['rho'])     #don't mess up original if Neg: rho = -copy.copy(mapData['rho'])     #flip +/- else: rho = copy.copy(mapData['rho'])     #don't mess up original mapHalf = np.array(rho.shape)/2 res = mapData['Resolution'] rho = rollMap(rho,-ind) dzeros = np.sqrt(np.sum(np.inner(Amat,peaks)**2,axis=0)) return np.array(peaks),np.array([mags,]).T,np.array([dzeros,]).T if Neg:     #want negative magnitudes for negative peaks return np.array(peaks),-np.array([mags,]).T,np.array([dzeros,]).T else: return np.array(peaks),np.array([mags,]).T,np.array([dzeros,]).T def sortArray(data,pos,reverse=False):
• ## trunk/GSASIIphsGUI.py

 r1639 try: peaks,mags,dzeros = G2mth.SearchMap(generalData,drawingData) if 'N' in mapData['Type']:      #look for negatives in neutron maps npeaks,nmags,ndzeros = G2mth.SearchMap(generalData,drawingData,Neg=True) peaks = np.concatenate((peaks,npeaks)) mags = np.concatenate((mags,nmags)) dzeros = np.concatenate((dzeros,ndzeros)) finally: wx.EndBusyCursor()
• ## trunk/GSASIIplot.py

 r1645 def OnKeyBox(event): #        Draw()                          #make sure plot is fresh!! mode = cb.GetValue() if mode in ['jpeg','bmp','tiff',]: def OnKey(event):           #on key UP!! #        Draw()                          #make sure plot is fresh!! try: keyCode = event.GetKeyCode() RenderMapPeak(x,y,z,Gr,1.0) else: RenderMapPeak(x,y,z,Wt,mag/peakMax) if mag > 0.: RenderMapPeak(x,y,z,Wt,mag/peakMax) else: RenderMapPeak(x,y,z,Rd,-mag/peakMax) if showBonds: RenderLines(x,y,z,mapBonds[ind],Wt)
Note: See TracChangeset for help on using the changeset viewer.