Changeset 1633


Ignore:
Timestamp:
Jan 22, 2015 10:09:11 AM (7 years ago)
Author:
vondreele
Message:

fix wx 3.0.x problem with Size on Progress bars in G2phsGUI & G2pwdGUI
4D charge flipping fixes - allow shifting 4D contour map L/R

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIphsGUI.py

    r1629 r1633  
    20812081            waveSizer.Add(waveHead)
    20822082            if len(waveBlk):
    2083                 CSI = G2spc.GetSSfxuinel(xyz,uij,SGData,SSGData)
    20842083                for iwave,wave in enumerate(waveBlk):
     2084                    if not iwave:
     2085                        CSI = G2spc.GetSSfxuinel(waveType,xyz,uij,SGData,SSGData)
     2086                    else:
     2087                        CSI = G2spc.GetSSfxuinel('Fourier',xyz,uij,SGData,SSGData)
    20852088                    waveName = 'Fourier'
    20862089                    if Stype == 'Sfrac':
     
    21902193                        if generalData['Type'] != 'magnetic' and Stype == 'Smag':
    21912194                            break
    2192                         mainSizer.Add(WaveSizer(atom[-1][SS]['waveType'],atom[-1][SS][Stype],Stype,typeNames[Stype],Labels[Stype]))
    2193                        
     2195                        mainSizer.Add(WaveSizer(atom[-1][SS]['waveType'],atom[-1][SS][Stype],Stype,typeNames[Stype],Labels[Stype]))                       
    21942196        SetPhaseWindow(G2frame.dataFrame,waveData,mainSizer)
    21952197                       
     
    21982200        mapData = generalData['4DmapData']
    21992201        reflName = mapData['RefList']
     2202        generalData['Map']['Flip'] = False
    22002203        if not reflName:
    22012204            G2frame.ErrorDialog('Fourier map','No reflections defined for Fourier map')
     
    50345037            screenSize = wx.ClientDisplayRect()
    50355038            Size = pgbar.GetSize()
    5036             Size = (int(Size[0]*1.2),Size[1]) # increase size a bit along x
    5037             pgbar.SetPosition(wx.Point(screenSize[2]-Size[0]-305,screenSize[1]+5))
    5038             pgbar.SetSize(Size)
     5039            if 50 < Size[0] < 500: # sanity check on size, since this fails w/Win & wx3.0
     5040                pgbar.SetSize((int(Size[0]*1.2),Size[1])) # increase size a bit along x
     5041                pgbar.SetPosition(wx.Point(screenSize[2]-Size[0]-305,screenSize[1]+5))
    50395042        else:
    50405043            pgbar = None
     
    56265629        screenSize = wx.ClientDisplayRect()
    56275630        Size = pgbar.GetSize()
    5628         Size = (int(Size[0]*1.2),Size[1]) # increase size a bit along x
    5629         pgbar.SetPosition(wx.Point(screenSize[2]-Size[0]-305,screenSize[1]+5))
    5630         pgbar.SetSize(Size)
     5631        if 50 < Size[0] < 500: # sanity check on size, since this fails w/Win & wx3.0
     5632            pgbar.SetSize((int(Size[0]*1.2),Size[1])) # increase size a bit along x
     5633            pgbar.SetPosition(wx.Point(screenSize[2]-Size[0]-305,screenSize[1]+5))
    56315634        try:
    56325635            newMap,new4Dmap = G2mth.SSChargeFlip(data,reflDict,pgbar)
     
    56745677        screenSize = wx.ClientDisplayRect()
    56755678        Size = pgbar.GetSize()
    5676         Size = (int(Size[0]*1.2),Size[1]) # increase size a bit along x
    5677         pgbar.SetPosition(wx.Point(screenSize[2]-Size[0]-305,screenSize[1]+5))
    5678         pgbar.SetSize(Size)
     5679        if 50 < Size[0] < 500: # sanity check on size, since this fails w/Win & wx3.0
     5680            pgbar.SetSize((int(Size[0]*1.2),Size[1])) # increase size a bit along x
     5681            pgbar.SetPosition(wx.Point(screenSize[2]-Size[0]-305,screenSize[1]+5))
    56795682        try:
    56805683            mapData.update(G2mth.ChargeFlip(data,reflDict,pgbar))
  • trunk/GSASIIplot.py

    r1630 r1633  
    28532853                ccof.append(spos[0][3:])
    28542854        wave += G2mth.posFourier(tau,np.array(scof),np.array(ccof))
    2855     Title = MapType+' modulation map for atom '+atom[0]+    \
     2855    if mapData['Flip']:
     2856        Title = 'Charge flip'
     2857    else:
     2858        Title = MapType
     2859    Title += ' map for atom '+atom[0]+    \
    28562860        ' at %.4f %.4f %.4f'%(atxyz[0],atxyz[1],atxyz[2])
    28572861    ix = -np.array(np.rint(rhoSize[:3]*atxyz),dtype='i')
     
    28732877    Plot.set_xlabel('t')
    28742878    Plot.set_ylabel(r'$\mathsf{\Delta}$%s'%(Ax))
    2875     Slab = np.concatenate((slab,slab),axis=1)
    2876     Plot.contour(Slab,20,extent=(0.,2.,-.5+Off*.005,.5+Off*.005))
     2879    Slab = np.hstack((slab,slab,slab))
     2880    Plot.contour(Slab[:,:21],20,extent=(0.,2.,-.5+Off*.005,.5+Off*.005))
    28772881    Page.canvas.draw()
    28782882   
     
    40324036    B4mat = np.concatenate((np.concatenate((Bmat,[[0],[0],[0]]),axis=1),[[0,0,0,1],]),axis=0)
    40334037    SGData = generalData['SGData']
     4038    if generalData['Type'] in ['modulated','magnetic']:
     4039        SSGData = generalData['SSGData']
    40344040    Mydir = generalData['Mydir']
    40354041    atomData = data['Atoms']
     
    41084114    shiftDown = False
    41094115    ctrlDown = False
     4116    G2frame.tau = 0.
    41104117   
    41114118    def OnKeyBox(event):
     
    42154222            SetPeakRoll(dirDict[key])
    42164223            SetMapPeaksText(mapPeaks)
     4224        elif key in ['+','-','0'] and generalData['Type'] in ['modulated','magnetic']:
     4225            if key == '0':
     4226                G2frame.tau = 0.
     4227            elif key =='+':
     4228                G2frame.tau += 0.05
     4229            elif key =='-':
     4230                G2frame.tau -= 0.05
     4231            G2frame.tau %= 1.   #force 0-1 range
    42174232        Draw('key')
    42184233           
     
    49915006    else:
    49925007        choice = [' save as/key:','jpeg','tiff','bmp','c: center on 1/2,1/2,1/2','n: next','p: previous']
     5008    if generalData['Type'] in ['modulated','magnetic',] and len(drawAtoms):
     5009        choice += ['+: increase tau','-: decrease tau','0: set tau = 0']
     5010
    49935011    cb = wx.ComboBox(G2frame.G2plotNB.status,style=wx.CB_DROPDOWN|wx.CB_READONLY,choices=choice)
    49945012    cb.Bind(wx.EVT_COMBOBOX, OnKeyBox)
  • trunk/GSASIIpwdGUI.py

    r1623 r1633  
    452452                screenSize = wx.ClientDisplayRect()
    453453                Size = dlg.GetSize()
    454                 dlg2.SetPosition(wx.Point(screenSize[2]-Size[0]-305,screenSize[1]+5))
     454                if 50 < Size[0] < 500: # sanity check on size, since this fails w/Win & wx3.0
     455                    dlg2.SetSize((int(Size[0]*1.2),Size[1])) # increase size a bit along x
     456                    dlg2.SetPosition(wx.Point(screenSize[2]-Size[0]-305,screenSize[1]+5))
    455457                try:
    456458                    peaks['sigDict'],result,sig,Rvals,varyList,parmDict,fullvaryList,badVary = G2pwd.DoPeakFit(FitPgm,peaks['peaks'],
     
    511513        screenSize = wx.ClientDisplayRect()
    512514        Size = dlg.GetSize()
    513         dlg.SetPosition(wx.Point(screenSize[2]-Size[0]-305,screenSize[1]+5))
     515        if 50 < Size[0] < 500: # sanity check on size, since this fails w/Win & wx3.0
     516            dlg.SetSize((int(Size[0]*1.2),Size[1])) # increase size a bit along x
     517            dlg.SetPosition(wx.Point(screenSize[2]-Size[0]-305,screenSize[1]+5))
    514518        try:
    515519            peaks['sigDict'] = G2pwd.DoPeakFit(FitPgm,peaks['peaks'],background,limits,inst,inst2,data,[],oneCycle,controls,dlg)[0]
Note: See TracChangeset for help on using the changeset viewer.