Changeset 1646 for trunk/GSASIImath.py


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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r1645 r1646  
    20802080    return mapData,map4DData
    20812081   
    2082 def SearchMap(generalData,drawingData):
     2082def SearchMap(generalData,drawingData,Neg=False):
    20832083    '''Does a search of a density map for peaks meeting the criterion of peak
    20842084    height is greater than mapData['cutOff']/100 of mapData['rhoMax'] where
    20852085    mapData is data['General']['mapData']; the map is also in mapData.
    20862086
    2087     :param data: the phase data structure
     2087    :param generalData: the phase data structure; includes the map
     2088    :param drawingData: the drawing data structure
     2089    :param Neg:  if True then search for negative peaks (i.e. H-atoms & neutron data)
    20882090
    20892091    :returns: (peaks,mags,dzeros) where
     
    21582160        mapData = generalData['Map']
    21592161        contLevel = mapData['cutOff']*mapData['rhoMax']/100.
    2160         rho = copy.copy(mapData['rho'])     #don't mess up original
     2162        if Neg:
     2163            rho = -copy.copy(mapData['rho'])     #flip +/-
     2164        else:
     2165            rho = copy.copy(mapData['rho'])     #don't mess up original
    21612166        mapHalf = np.array(rho.shape)/2
    21622167        res = mapData['Resolution']
     
    21932198        rho = rollMap(rho,-ind)       
    21942199    dzeros = np.sqrt(np.sum(np.inner(Amat,peaks)**2,axis=0))
    2195     return np.array(peaks),np.array([mags,]).T,np.array([dzeros,]).T
     2200    if Neg:     #want negative magnitudes for negative peaks
     2201        return np.array(peaks),-np.array([mags,]).T,np.array([dzeros,]).T
     2202    else:
     2203        return np.array(peaks),np.array([mags,]).T,np.array([dzeros,]).T
    21962204   
    21972205def sortArray(data,pos,reverse=False):
Note: See TracChangeset for help on using the changeset viewer.