Changeset 1694 for trunk


Ignore:
Timestamp:
Mar 10, 2015 11:35:24 AM (10 years ago)
Author:
vondreele
Message:

some missing stuff in PWDR[0] dictionary
add new fxn to G2img - meanAZm - calc effective azimuth for a azm range for correct polarization calc.
fix some FlexGridSizers? in G2phsGUI
fix '+'/'=' key response for Anaconda vs Enthought versions; one sees '=' the other sees '+'!
fix L/R shifting in waterfall plots.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/GSASII.py

    r1688 r1694  
    13251325                'Dummy':False,
    13261326                'ranId':ran.randint(0,sys.maxint),
     1327                'Offset':[0.0,0.0],'delOffset':0.02,'refOffset':-1.0,'refDelt':0.01,
     1328                'qPlot':False,'dPlot':False,'sqrtPlot':False
    13271329                }
    13281330            rd.Sample['ranId'] = valuesdict['ranId'] # this should be removed someday
     
    14981500            'Dummy':True,
    14991501            'ranId':ran.randint(0,sys.maxint),
     1502            'Offset':[0.0,0.0],'delOffset':0.02,'refOffset':-1.0,'refDelt':0.01,
     1503            'qPlot':False,'dPlot':False,'sqrtPlot':False
    15001504            }
    15011505        self.PatternTree.SetItemPyData(Id,[valuesdict,rd.powderdata])
  • TabularUnified trunk/GSASIIIO.py

    r1671 r1694  
    3535import GSASIIlattice as G2lat
    3636import GSASIIpwdGUI as G2pdG
     37import GSASIIimage as G2img
    3738import GSASIIElem as G2el
    3839import GSASIIstrIO as G2stIO
     
    10401041    else:
    10411042        for i,azm in enumerate(azms[:-1]):
    1042             Azms.append((azms[i+1]+azm)/2.)
     1043            Azms.append(G2img.meanAzm(azm,azms[i+1]))
    10431044    for i,azm in enumerate(azms[:-1]):
    10441045        Aname = name+" Azm= %.2f"%(Azms[i])
     
    10881089            'Dummy':False,
    10891090            'ranId':ran.randint(0,sys.maxint),
     1091            'Offset':[0.0,0.0],'delOffset':0.02,'refOffset':-1.0,'refDelt':0.01,
     1092            'qPlot':False,'dPlot':False,'sqrtPlot':False
    10901093            }
    10911094        G2frame.PatternTree.SetItemPyData(
  • TabularUnified trunk/GSASIIimage.py

    r1665 r1694  
    4949npatand = lambda x: 180.*np.arctan(x)/np.pi
    5050npatan2d = lambda y,x: 180.*np.arctan2(y,x)/np.pi
    51    
    5251debug = False
    5352   
     
    428427    'Give azimuth value for detector x,y position; calibration info in data'
    429428    return GetTthAzmDsp(x,y,data)[1]
     429   
     430def meanAzm(a,b):
     431    AZM = lambda a,b: npacosd(0.5*(npsind(2.*b)-npsind(2.*a))/(np.pi*(b-a)/180.))/2.
     432    azm = AZM(a,b)
     433    quad = int((a+b)/180.)
     434    if quad == 1:
     435        azm = 180.-azm
     436    elif quad == 2:
     437        azm += 180.
     438    elif quad == 3:
     439        azm = 360-azm
     440    return azm     
    430441       
    431442def ImageCompress(image,scale):
  • TabularUnified trunk/GSASIIphsGUI.py

    r1691 r1694  
    21822182                        else:
    21832183                            names = Names[:2]
    2184                         Waves = wx.FlexGridSizer(1,4,5,5)
     2184                        Waves = wx.FlexGridSizer(0,4,5,5)
    21852185                    elif Stype == 'Spos':
    21862186                        if waveType in ['ZigZag','Sawtooth'] and not iwave:
    21872187                            names = Names[6:]
    2188                             Waves = wx.FlexGridSizer(1,6,5,5)
     2188                            Waves = wx.FlexGridSizer(0,6,5,5)
    21892189                            waveName = waveType
    21902190                        else:
    21912191                            names = Names[:6]
    2192                             Waves = wx.FlexGridSizer(1,8,5,5)
     2192                            Waves = wx.FlexGridSizer(0,8,5,5)
    21932193                    else:
    21942194                        names = Names
    2195                         Waves = wx.FlexGridSizer(1,8,5,5)
     2195                        Waves = wx.FlexGridSizer(0,8,5,5)
    21962196                    waveSizer.Add(wx.StaticText(waveData,label=' %s  parameters: %s'%(waveName,str(names).rstrip(']').lstrip('[').replace("'",''))),0,WACV)
    21972197                    for ival,val in enumerate(wave[0]):
  • TabularUnified trunk/GSASIIplot.py

    r1672 r1694  
    340340        elif event.key == 'd':
    341341            Data['Scale'] /= 1.1
    342         elif event.key == '+':
     342        elif event.key in ['+','=']:
    343343            Data['Layer'] = min(Data['Layer']+1,HKLmax[i])
    344344        elif event.key == '-':
     
    592592        elif key in 'B':
    593593            ifBox = not ifBox
    594         elif key == '+':
     594        elif key in ['+','=']:
    595595            Data['Scale'] *= 1.25
    596596        elif key == '-':
     
    10471047            G2frame.SinglePlot = not G2frame.SinglePlot               
    10481048            newPlot = True
    1049         elif event.key == '+':
     1049        elif event.key in ['+','=']:
    10501050            if G2frame.PickId:
    10511051                G2frame.PickId = False
     
    14241424        Ymax = max(Ymax,max(xye[1]))
    14251425    if Ymax is None: return # nothing to plot
    1426     offset = Pattern[0]['Offset'][0]*Ymax/100.0
     1426    offsetX = Pattern[0]['Offset'][1]
     1427    offsetY = Pattern[0]['Offset'][0]
    14271428    if G2frame.logPlot:
    14281429        Title = 'log('+Title+')'
     
    15011502                np.seterr(invalid=olderr['invalid'])
    15021503            else:
    1503                 Y = xye[1]+offset*N
     1504                Y = xye[1]+offsetY*N*Ymax/100.0
    15041505        elif 'SASD' in plottype:
    15051506            B = xye[5]
    15061507            if G2frame.sqPlot:
    1507                 Y = xye[1]*Sample['Scale'][0]*(1.05)**(Pattern[0]['Offset'][0]*N)*X**4
     1508                Y = xye[1]*Sample['Scale'][0]*(1.05)**(offsetY*N)*X**4
    15081509            else:
    1509                 Y = xye[1]*Sample['Scale'][0]*(1.05)**(Pattern[0]['Offset'][0]*N)
     1510                Y = xye[1]*Sample['Scale'][0]*(1.05)**(offsetY*N)
    15101511        if LimitId and ifpicked:
    15111512            limits = np.array(G2frame.PatternTree.GetItemPyData(LimitId))
     
    15331534        else:
    15341535            if 'SASD' in plottype and G2frame.logPlot:
    1535                 X *= (1.01)**(Pattern[0]['Offset'][1]*N)
     1536                X *= (1.01)**(offsetX*N)
    15361537            else:
    1537                 X += Pattern[0]['Offset'][1]*.005*N
     1538                X += offsetX*.005*N
    15381539            Xum = ma.getdata(X)
    15391540            DifLine = ['']
     
    15441545                    np.seterr(invalid=olderr['invalid'])
    15451546                else:
    1546                     Z = xye[3]+offset*N
     1547                    Z = xye[3]+offsetY*N*Ymax/100.0
    15471548                if 'PWDR' in plottype:
    15481549                    if Pattern[0]['sqrtPlot']:
     
    15521553                        D = np.where(xye[5],(Y-Z),0.)-Ymax*Pattern[0]['delOffset']
    15531554                    else:
    1554                         W = xye[4]+offset*N
     1555                        W = xye[4]+offsetY*N*Ymax/100.0
    15551556                        D = xye[5]-Ymax*Pattern[0]['delOffset']  #powder background
    15561557                elif 'SASD' in plottype:
     
    28092810    def OnPlotKeyPress(event):
    28102811        global Off,Atom,Ax
    2811         newPlot = False       
     2812        newPlot = False
    28122813        if event.key == '0':
    28132814            Off = 0
    2814         elif event.key == '+':
     2815        elif event.key in ['+','=']:
    28152816            Off += 1
    28162817        elif event.key == '-':
     
    42374238            SetPeakRoll(dirDict[key])
    42384239            SetMapPeaksText(mapPeaks)
    4239         elif key in ['+','-','0'] and generalData['Type'] in ['modulated','magnetic']:
     4240        elif key in ['+','-','=','0'] and generalData['Type'] in ['modulated','magnetic']:
    42404241            if key == '0':
    42414242                G2frame.tau = 0.
    4242             elif key =='+':
     4243            elif key in ['+','=']:
    42434244                G2frame.tau += 0.05
    4244             elif key =='-':
     4245            elif key == '-':
    42454246                G2frame.tau -= 0.05
    42464247            G2frame.tau %= 1.   #force 0-1 range
Note: See TracChangeset for help on using the changeset viewer.