Changeset 3681


Ignore:
Timestamp:
Oct 17, 2018 1:37:42 PM (5 years ago)
Author:
vondreele
Message:

change Panalytical importer to read multi xrdMeasurement blocks - can each have multiple scans; all recorded as separate PWDR histograms.
Begin implementation of access to Bilbao SUBGROUPS routine
some work on incommensurate magnetic structure stuff
Add new option for PWDR contour plots to show temperature on y-axis

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIdataGUI.py

    r3674 r3681  
    27852785        self.ErrorBars = False
    27862786        self.Contour = False
     2787        self.TforYaxis = False
    27872788        self.Legend = False
    27882789        self.SinglePlot = True
     
    51235124        # PDR / Unit Cells List
    51245125        G2G.Define_wxId('wxID_INDEXPEAKS', 'wxID_REFINECELL', 'wxID_COPYCELL', 'wxID_MAKENEWPHASE',
    5125             'wxID_EXPORTCELLS','wxID_LOADCELL','wxID_IMPORTCELL','wxID_TRANSFORMCELL','wxID_RUNSUBMAG')
     5126            'wxID_EXPORTCELLS','wxID_LOADCELL','wxID_IMPORTCELL','wxID_TRANSFORMCELL','wxID_RUNSUB','wxID_RUNSUBMAG')
    51265127        self.IndexMenu = wx.MenuBar()
    51275128        self.PrefillDataMenu(self.IndexMenu)
     
    51305131        self.IndexPeaks = self.IndexEdit.Append(G2G.wxID_INDEXPEAKS,'Index Cell',
    51315132            'Find cells that index fitted peaks')
     5133        self.RunSubGroups = self.IndexEdit.Append(G2G.wxID_RUNSUB,'Run SUBGROUPS',
     5134            'If disabled, do Load Cell first')
    51325135        self.RunSubGroupsMag = self.IndexEdit.Append(G2G.wxID_RUNSUBMAG,'Run k-SUBGROUPMAG',
    51335136            'If disabled, do Load Cell first')
     
    51475150        self.PostfillDataMenu()
    51485151        self.IndexPeaks.Enable(False)
     5152        self.RunSubGroups.Enable(False)
    51495153        self.RunSubGroupsMag.Enable(False)
    51505154        self.CopyCell.Enable(False)
  • trunk/GSASIIphsGUI.py

    r3658 r3681  
    49744974                            if waveTyp in ['ZigZag','Block','SawTooth','Crenel']:
    49754975                                nx = 1
    4976                             CSI = G2spc.GetSSfxuinel(waveTyp,Stype,1,xyz,SGData,SSGData)
     4976                            CSI = G2spc.GetSSfxuinel(waveTyp,Stype,1,xyz,SGData,SSGData,debug=True)[0]
    49774977                        else:
    49784978                            CSI = G2spc.GetSSfxuinel('Fourier',Stype,iwave+1-nx,xyz,SGData,SSGData)
  • trunk/GSASIIplot.py

    r3652 r3681  
    16201620    global DifLine # BHT: probably does not need to be global
    16211621    global Ymax
    1622     global Pattern,mcolors,Plot,Page
     1622    global Pattern,mcolors,Plot,Page,imgAx,Temps
    16231623    plottype = plotType
    16241624   
     
    17661766                Page.plotStyle['sqPlot'] = not Page.plotStyle['sqPlot']
    17671767        elif event.key == 't' and 'PWDR' in plottype:
    1768             Page.plotStyle['dPlot'] = not Page.plotStyle['dPlot']
    1769             if Page.plotStyle['dPlot']:
    1770                 G2frame.Contour = False               
    1771                 G2frame.Weight = False
    1772             Page.plotStyle['qPlot'] = False
    1773             newPlot = True     
     1768            if G2frame.Contour:
     1769                G2frame.TforYaxis = not G2frame.TforYaxis
     1770            else:
     1771                Page.plotStyle['dPlot'] = not Page.plotStyle['dPlot']
     1772                if Page.plotStyle['dPlot']:
     1773                    G2frame.Contour = False               
     1774                    G2frame.Weight = False
     1775                Page.plotStyle['qPlot'] = False
     1776                newPlot = True     
    17741777        elif event.key == 'm':
    17751778            Page.plotStyle['sqrtPlot'] = False
     
    18171820       
    18181821    def OnMotion(event):
     1822        if event.button and G2frame.Contour and G2frame.TforYaxis:
     1823            ytics = imgAx.get_yticks()
     1824            ytics = np.where(ytics<len(Temps),ytics,-1)
     1825            ylabs = [np.where(0<=i ,Temps[int(i)],' ') for i in ytics]
     1826            imgAx.set_yticklabels(ylabs)           
    18191827        xpos = event.xdata
    18201828        if xpos is None: return  #avoid out of frame mouse position
     
    23862394    if G2frame.Contour:
    23872395        Page.Choice = (' key press','d: lower contour max','u: raise contour max','o: reset contour max',
    2388             'i: interpolation method','s: color scheme','c: contour off')
     2396            'i: interpolation method','s: color scheme','c: contour off','t: temperature for y-axis')
    23892397    else:
    23902398        if Page.plotStyle['logPlot']:
     
    24692477        ParmList = []
    24702478        SampleList = []
     2479        Temps = []
    24712480        if G2frame.selections is None:
    24722481            choices = G2gd.GetGPXtreeDataNames(G2frame,plotType)
     
    24912500            SampleList.append(G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,
    24922501                id, 'Sample Parameters')))
     2502            Temps.append('%.1fK'%SampleList[-1]['Temperature'])
    24932503        if not G2frame.Contour:
    24942504            PlotList.reverse()
     
    24972507    lenX = 0
    24982508    Ymax = None
    2499     for Pattern in PlotList:
     2509    for ip,Pattern in enumerate(PlotList):
    25002510        xye = Pattern[1]
    25012511        bxye = G2pdG.GetFileBackground(G2frame,xye,Pattern)
     
    26822692                    ContourX = range(lenX)
    26832693                Nseq += 1
    2684                 Plot.set_ylabel('Data sequence',fontsize=12)
     2694                if G2frame.TforYaxis:
     2695                    Plot.set_ylabel('Temperature',fontsize=14)
     2696                else:
     2697                    Plot.set_ylabel('Data sequence',fontsize=14)
    26852698        else:
    26862699            if G2frame.plusPlot:
     
    28992912        Img = Plot.imshow(ContourZ,cmap=acolor,vmin=0,vmax=Ymax*G2frame.Cmax,interpolation=G2frame.Interpolate,
    29002913            extent=[ContourX[0],ContourX[-1],ContourY[0],ContourY[-1]],aspect='auto',origin='lower')
     2914        if G2frame.TforYaxis:
     2915            imgAx = Img.axes
     2916            ytics = imgAx.get_yticks()
     2917            ylabs = [Temps[int(i)] for i in ytics[:-1]]
     2918            imgAx.set_yticklabels(ylabs)
    29012919        Page.figure.colorbar(Img)
    29022920    else:
  • trunk/GSASIIpwdGUI.py

    r3673 r3681  
    31173117            ssopt['SGData'] = SGData
    31183118        data = [controls,bravais,cells,dminx,ssopt,magcells]
     3119        G2frame.dataWindow.RunSubGroups.Enable(True)
    31193120        G2frame.GPXtree.SetItemPyData(UnitCellsId,data)
    31203121        OnHklShow(None)
     
    31623163            if not ssopt.get('Use',False):
    31633164                G2frame.dataWindow.RunSubGroupsMag.Enable(True)
     3165        G2frame.dataWindow.RunSubGroups.Enable(True)
    31643166        G2frame.GPXtree.SetItemPyData(UnitCellsId,data)
    31653167        G2frame.dataWindow.RefineCell.Enable(True)
     
    31873189        controls[13] = SGData['SpGrp']
    31883190#        G2frame.GPXtree.SetItemPyData(UnitCellsId,[controls,bravais,cells,dmin,ssopt])
     3191        G2frame.dataWindow.RunSubGroups.Enable(True)
    31893192        G2frame.dataWindow.RefineCell.Enable(True)
    31903193        OnHklShow(None)
     
    36273630            phase['Keep'] = False
    36283631        return uAtms
     3632
     3633    def OnRunSubs(event):
     3634#        import SUBGROUPS as kSUB
     3635        G2frame.dataWindow.RunSubGroupsMag.Enable(False)
     3636        pUCid = G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId, 'Unit Cells List')
     3637        controls,bravais,cells,dminx,ssopt,magcells = G2frame.GPXtree.GetItemPyData(pUCid)
     3638        E,SGData = G2spc.SpcGroup(controls[13])
     3639        kvec = ['0','0','0',' ',' ',' ',' ',' ',' ',' ']
     3640        Kx = [' ','0','1/2','-1/2','1/3','-1/3','2/3','1']
     3641        Ky = [' ','0','1/2','1/3','2/3','1']
     3642        Kz = [' ','0','1/2','3/2','1/3','2/3','1']
     3643        dlg = G2G.MultiDataDialog(G2frame,title='SUBGROUPS options',
     3644            prompts=[' kx1 as fr.',' ky1 as fr.',' kz1 as fr.',' kx2 as fr.',' ky2 as fr.',' kz2 as fr.', \
     3645                     ' kx3 as fr.',' ky3 as fr.',' kz3 as fr.', \
     3646                     ' Use whole star',' Filter by','preserve axes','max unique'],
     3647            values=kvec[:9]+[False,'',True,100],
     3648            limits=[Kx[1:],Ky[1:],Kz[1:],Kx,Ky,Kz,Kx,Ky,Kz,[True,False],['',' Landau transition',' Only maximal subgroups',],
     3649                [True,False],[1,100]],
     3650            formats=['choice','choice','choice','choice','choice','choice','choice','choice','choice','bool','choice',
     3651                    'bool','%d',])
     3652        if dlg.ShowModal() == wx.ID_OK:
     3653            subcells = []
     3654            newVals = dlg.GetValues()
     3655            kvec[:9] = newVals[:9]
     3656            nkvec = kvec.index(' ')
     3657            star = newVals[9]
     3658            filterby = newVals[10]
     3659            keepaxes = newVals[11]
     3660            maxequiv = newVals[12]
     3661            if 'maximal' in filterby:
     3662                maximal = True
     3663                Landau = False
     3664            elif 'Landau' in filterby:
     3665                maximal = False
     3666                Landau = True
     3667            else:
     3668                maximal = False
     3669                Landau = False           
     3670            if nkvec not in [0,3,6,9]:
     3671                wx.MessageBox('Error: check your propagation vector(s)',
     3672                    caption='Bilbao SUBGROUPS setup error',style=wx.ICON_EXCLAMATION)
     3673                return
     3674            if nkvec in [6,9] and Landau:
     3675                wx.MessageBox('Error, multi k-vectors & Landau not compatible',
     3676                    caption='Bilbao SUBGROUPS setup error',style=wx.ICON_EXCLAMATION)
     3677                return
     3678        print('run Bilbao SUBGROUPS - TBD')
    36293679       
    36303680    def OnRunSubsMag(event):
    36313681        import kSUBGROUPSMAG as kMAG
     3682        G2frame.dataWindow.RunSubGroups.Enable(False)
    36323683        pUCid = G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId, 'Unit Cells List')
    36333684        controls,bravais,cells,dminx,ssopt,magcells = G2frame.GPXtree.GetItemPyData(pUCid)
     
    37313782    G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.IndexMenu)
    37323783    G2frame.Bind(wx.EVT_MENU, OnIndexPeaks, id=G2G.wxID_INDEXPEAKS)
     3784    G2frame.Bind(wx.EVT_MENU, OnRunSubs, id=G2G.wxID_RUNSUB)
    37333785    G2frame.Bind(wx.EVT_MENU, OnRunSubsMag, id=G2G.wxID_RUNSUBMAG)
    37343786    G2frame.Bind(wx.EVT_MENU, CopyUnitCell, id=G2G.wxID_COPYCELL)
  • trunk/GSASIIspc.py

    r3676 r3681  
    28302830   
    28312831    def DoMag():
     2832        dM = []
     2833        dMTP = []
    28322834        CSI = [[1,0,0],[2,0,0],[3,0,0], [4,0,0],[5,0,0],[6,0,0]],6*[[1.,0.,0.],]
    28332835        if siteSym == '1':
     
    28362838            CSI = 3*[[0,0,0],]+[[1,0,0],[2,0,0],[3,0,0]],3*[[0.,0.,0.],]+3*[[1.,0.,0.],]
    28372839        else:
     2840            tau = np.linspace(0,1,49,True)
    28382841            delt6 = np.eye(6)*0.001
    28392842            dM = posFourier(tau,nH,delt6[:3],delt6[3:]) #+np.array(Mxyz)[:,nxs,nxs]
     
    29062909                    CSI[1][i][0] = 1.0
    29072910
    2908         return CSI,None,None
     2911        return list(CSI),dM,dMTP
    29092912       
    29102913    if debug: print ('super space group: '+SSGData['SSpGrp'])
     
    29482951    elif Stype == 'Smag':
    29492952        CSI,dF,dFTP = DoMag()
    2950        
     2953
    29512954    if debug:
    29522955        return CSI,dF,dFTP
     
    34813484        NA += len(SGOps)
    34823485    M,T = SGOps[nA]
    3483     if SGData['SGGray']:        #no nonzero moments for gray groups!
     3486    if SGData['SGGray']:
    34843487        newMom = -np.inner(Mom,M).T*nl.det(M)*SGData['SpnFlp'][NA+nC]
    34853488    else:
  • trunk/imports/G2pwd_Panalytical.py

    r3136 r3681  
    6262        sample = self.root.find(tag+'sample')
    6363        self.idstring = ospath.basename(filename) + ' Scan '+str(blockNum)
    64         data = self.root.find(tag+'xrdMeasurement')
     64        blks = self.root.findall(tag+'xrdMeasurement')
     65        scans = []
     66        for data in blks:
     67            scans += data.findall(tag+'scan')
     68        data = self.root.find(tag+'xrdMeasurement')       
    6569        wave = data.find(tag+'usedWavelength')
    6670        incident = data.find(tag+'incidentBeamPath')
    6771        radius = float(incident.find(tag+'radius').text)
    6872        tube = incident.find(tag+'xRayTube')
    69         scans = data.findall(tag+'scan')
    7073        if len(scans) > 1:
    7174            self.repeat = True
     
    108111            ]
    109112        conditions = scan.find(tag+'nonAmbientPoints')
    110         if conditions:
     113        if conditions is not None:
    111114            kind = conditions.attrib['type']
    112115            if kind == 'Temperature':
Note: See TracChangeset for help on using the changeset viewer.