Changeset 569


Ignore:
Timestamp:
Apr 23, 2012 4:17:29 PM (12 years ago)
Author:
vondreele
Message:

change image default to 'Paired'
fix mismatch for 'rotation'

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r567 r569  
    671671                        else:
    672672                            Data['type'] = 'PWDR'
    673                             Data['color'] = 'binary'
     673                            Data['color'] = 'Paired'
    674674                            Data['tilt'] = 0.0
    675675                            Data['rotation'] = 0.0
  • trunk/GSASIIimgGUI.py

    r536 r569  
    182182                    'IOtth','outAzimuths']
    183183                for key in keys:
    184                     File.write(key+':'+str(data[key])+'\n')
     184                    if key in ['rotation']:
     185                        File.write(key+':'+str(data[key]-90.)+'\n')                       
     186                    else:
     187                        File.write(key+':'+str(data[key])+'\n')
    185188                File.close()
    186189        finally:
     
    205208                    if key in ['type','calibrant',]:
    206209                        save[key] = val
     210                    elif key in ['rotation']:
     211                        save[key] = val+90.
    207212                    elif key in ['center',]:
    208213                        if ',' in val:
  • trunk/GSASIImath.py

    r568 r569  
    581581    return mapData
    582582   
    583 def findRoll(SGData,rho,Fhkl):
     583def findOffset(SGData,rho,Fhkl):
    584584    mapShape = rho.shape
    585585    hklShape = Fhkl.shape
    586586    mapHalf = np.array(mapShape)/2
     587    Fmax = np.max(np.absolute(Fhkl))
    587588    hklHalf = np.array(hklShape)/2
    588     mapMax = np.unravel_index(np.argmax(rho),mapShape)
    589     print mapMax,rho[mapMax],mapHalf
    590     hklMax = np.unravel_index(np.argmax(Fhkl),hklShape)
    591     print hklMax,Fhkl[hklMax],hklMax-hklHalf,hklHalf
     589    sortHKL = np.argsort(Fhkl.flatten())
     590    Fdict = {}
     591    for hkl in sortHKL:
     592        HKL = np.unravel_index(hkl,hklShape)
     593        F = Fhkl[HKL[0]][HKL[1]][HKL[2]]
     594        if F == 0.:
     595            break
     596        Fdict['%.6f'%(np.absolute(F))] = hkl
     597    Flist = np.flipud(np.sort(Fdict.keys()))
     598    F = str(1.e6)
     599    i = 0
     600    while float(F) > 0.5*Fmax:
     601        F = Flist[i]
     602        hkl = np.unravel_index(Fdict[F],hklShape)
     603        iabsnt,mulp,Uniq,phi = G2spc.GenHKLf(list(hkl-hklHalf),SGData)
     604        Uniq = np.array(Uniq,dtype='i')
     605        Uniq = np.concatenate((Uniq,-Uniq))+hklHalf
     606        phi = np.concatenate((phi,-phi))
     607        print hkl-hklHalf
     608        for j,H in enumerate(Uniq):
     609            Fh = Fhkl[H[0],H[1],H[2]]
     610            h,k,l = H-hklHalf
     611            print '(%3d,%3d,%3d) %5.2f %9.5f'%(h,k,l,phi[j],np.angle(Fh,deg=True))       
     612        i += 1
     613       
     614       
    592615   
    593616    return [0,0,0]
     
    663686    print 'No.cycles = ',Ncyc,'Residual Rcf =%8.3f%s'%(Rcf,'%')
    664687    CErho = np.real(fft.fftn(fft.fftshift(CEhkl)))
    665     roll = findRoll(SGData,CErho,CEhkl)
     688    roll = findOffset(SGData,CErho,CEhkl)
    666689    mapData['rho'] = np.roll(np.roll(np.roll(CErho,roll[0],axis=0),roll[1],axis=1),roll[2],axis=2)
    667690    mapData['rhoMax'] = max(np.max(mapData['rho']),-np.min(mapData['rho']))
Note: See TracChangeset for help on using the changeset viewer.