Changeset 4839 for trunk


Ignore:
Timestamp:
Mar 4, 2021 12:42:09 PM (4 years ago)
Author:
vondreele
Message:

change formatting for scale/phase fraction in G2ddataGUI & G2strIO now 'g' format
fix array problem in G2math/findOffset
missed a DrawAtomsReplaceByID reference to G2mth
add progress bar to Map eaks move peaks & remove the BusyCursor? in OnPeaksUnique?

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/GSASIIddataGUI.py

    r4819 r4839  
    123123        scaleSizer.Add(scaleRef,0,WACV|wx.LEFT,5)
    124124        scaleVal = G2G.ValidatedTxtCtrl(DData,UseList[G2frame.hist]['Scale'],0,
    125             xmin=0.,nDig=(10,4),typeHint=float,OnLeave=onChangeFraction)
     125            xmin=0.,nDig=(10,4,'g'),typeHint=float,OnLeave=onChangeFraction)
    126126        scaleSizer.Add(scaleVal,0,WACV)
    127127        if 'PWDR' in G2frame.hist and generalData['Type'] != 'magnetic':
  • TabularUnified trunk/GSASIImath.py

    r4838 r4839  
    36293629        return [0,0,0]   
    36303630    hklShape = Fhkl.shape
    3631     hklHalf = np.array(hklShape)/2
     3631    hklHalf = np.array(hklShape)//2
    36323632    sortHKL = np.argsort(Fhkl.flatten())
    36333633    Fdict = {}
     
    36683668    Dphi = np.array(Dphi)
    36693669    steps = np.array(hklShape)
    3670     X,Y,Z = np.mgrid[0:1:1./steps[0],0:1:1./steps[1],0:1:1./steps[2]]
     3670    X,Y,Z = np.meshgrid(np.linspace(0,1,steps[0]),np.linspace(0,1,steps[1]),np.linspace(0,1,steps[2]))
    36713671    XYZ = np.array(list(zip(X.flatten(),Y.flatten(),Z.flatten())))
    36723672    Dang = (np.dot(XYZ,DH.T)+.5)%1.-Dphi
  • TabularUnified trunk/GSASIIphsGUI.py

    r4838 r4839  
    32353235                                atomData[r][c] = parms
    32363236                        if 'Atoms' in data['Drawing']:
    3237                             DrawAtomsReplaceByID(data,ui+6,atomData[r],ID)
     3237                            G2mth.DrawAtomsReplaceByID(data,ui+6,atomData[r],ID)
    32383238                    wx.CallAfter(Paint)
    32393239                   
     
    1236012360            peakMax = np.amax(mapPeaks.T[0])
    1236112361            Ind = getAtomSelections(MapPeaks)
     12362            pgbar = wx.ProgressDialog('Move peaks','Map peak no. 0 processed',len(Ind)+1,
     12363                style = wx.PD_ELAPSED_TIME|wx.PD_AUTO_HIDE)
    1236212364            for ind in Ind:
    1236312365                mag,x,y,z = mapPeaks[ind][:4]
    1236412366                AtomAdd(x,y,z,'H',Name='M '+'%d'%(int(100*mag/peakMax)))
     12367                pgbar.Update(ind,'Map peak no. %d processed'%ind)
     12368            pgbar.Destroy()
    1236512369            G2plt.PlotStructure(G2frame,data)
    1236612370   
     
    1249012494                    dlg.Destroy()
    1249112495                    return
    12492                 wx.BeginBusyCursor()
    1249312496                pgbar = wx.ProgressDialog('Unique peaks','Map peak no. 0 processed',len(Ind)+1,
    1249412497                    style = wx.PD_ELAPSED_TIME|wx.PD_AUTO_HIDE)
    1249512498
    12496                 try:
    12497                     Ind = G2mth.PeaksUnique(data,Ind,sel,pgbar)
    12498                     print (' No. unique peaks: %d Unique peak fraction: %.3f'%(len(Ind),float(len(Ind))/len(mapPeaks)))
    12499                     tbl = MapPeaks.GetTable().data
    12500                     tbl[:] = [t for i,t in enumerate(tbl) if i in Ind] + [
    12501                         t for i,t in enumerate(tbl) if i not in Ind]         
    12502                     for r in range(MapPeaks.GetNumberRows()):
    12503                         if r < len(Ind):
    12504                             MapPeaks.SelectRow(r,addToSelected=True)
    12505                         else:
    12506                             MapPeaks.DeselectRow(r)
    12507                 finally:
    12508                     wx.EndBusyCursor()
     12499                Ind = G2mth.PeaksUnique(data,Ind,sel,pgbar)
     12500                print (' No. unique peaks: %d Unique peak fraction: %.3f'%(len(Ind),float(len(Ind))/len(mapPeaks)))
     12501                tbl = MapPeaks.GetTable().data
     12502                tbl[:] = [t for i,t in enumerate(tbl) if i in Ind] + [
     12503                    t for i,t in enumerate(tbl) if i not in Ind]         
     12504                for r in range(MapPeaks.GetNumberRows()):
     12505                    if r < len(Ind):
     12506                        MapPeaks.SelectRow(r,addToSelected=True)
     12507                    else:
     12508                        MapPeaks.DeselectRow(r)
    1250912509                MapPeaks.ForceRefresh()
    1251012510                G2plt.PlotStructure(G2frame,data)
  • TabularUnified trunk/GSASIIstrIO.py

    r4834 r4839  
    25962596                        pFile.write(' Perform LeBail extraction\n')                     
    25972597                    else:
    2598                         pFile.write(' Phase fraction  : %10.4f Refine? %s\n'%(hapData['Scale'][0],hapData['Scale'][1]))
     2598                        pFile.write(' Phase fraction  : %10.4g Refine? %s\n'%(hapData['Scale'][0],hapData['Scale'][1]))
    25992599                        pFile.write(' Extinction coeff: %10.4f Refine? %s\n'%(hapData['Extinction'][0],hapData['Extinction'][1]))
    26002600                        if hapData['Pref.Ori.'][0] == 'MD':
     
    27522752                    pFile.write('\n Phase: %s in histogram: %s\n'%(phase,histogram))
    27532753                    pFile.write(135*'='+'\n')
    2754                     pFile.write(' Scale factor     : %10.4f Refine? %s\n'%(hapData['Scale'][0],hapData['Scale'][1]))
     2754                    pFile.write(' Scale factor     : %10.4g Refine? %s\n'%(hapData['Scale'][0],hapData['Scale'][1]))
    27552755                    if extType != 'None':
    27562756                        pFile.write(' Extinction  Type: %15s approx: %10s\n'%(extType,extApprox))
     
    31063106                            wtFr = hapData['Scale'][0]*General['Mass']/wtFrSum[hId]
    31073107                            sigwtFr = PhFrExtPOSig[pfx+'Scale']*wtFr/hapData['Scale'][0]
    3108                             pFile.write(' Phase fraction  : %10.5f, sig %10.5f Weight fraction  : %8.5f, sig %10.5f\n'%
     3108                            pFile.write(' Phase fraction  : %10.5g, sig %10.5g Weight fraction  : %8.5f, sig %10.5f\n'%
    31093109                                (hapData['Scale'][0],PhFrExtPOSig[pfx+'Scale'],wtFr,sigwtFr))
    31103110                        if pfx+'Extinction' in PhFrExtPOSig:
     
    31353135                    pFile.write(' HKLF histogram weight factor = %.3f\n'%(Histogram['wtFactor']))
    31363136                    if pfx+'Scale' in ScalExtSig:
    3137                         pFile.write(' Scale factor : %10.4f, sig %10.4f\n'%(hapData['Scale'][0],ScalExtSig[pfx+'Scale']))
     3137                        pFile.write(' Scale factor : %10.4g, sig %10.4g\n'%(hapData['Scale'][0],ScalExtSig[pfx+'Scale']))
    31383138                    if hapData['Extinction'][0] != 'None':
    31393139                        PrintExtAndSig(pfx,hapData['Extinction'],ScalExtSig)
Note: See TracChangeset for help on using the changeset viewer.