Changeset 3521


Ignore:
Timestamp:
Jul 31, 2018 2:57:22 PM (3 years ago)
Author:
vondreele
Message:

fix In neutron scattering length info
add MAXMAGN.py
minor changes to testXNFF & GSASIItestplot.py
work on transform some more

Location:
trunk
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIdataGUI.py

    r3519 r3521  
    50025002        # PDR / Unit Cells List
    50035003        G2G.Define_wxId('wxID_INDEXPEAKS', 'wxID_REFINECELL', 'wxID_COPYCELL', 'wxID_MAKENEWPHASE',
    5004             'wxID_EXPORTCELLS','wxID_LOADCELL','wxID_IMPORTCELL','wxID_TRANSPOSECELL')
     5004            'wxID_EXPORTCELLS','wxID_LOADCELL','wxID_IMPORTCELL','wxID_TRANSFORMCELL')
    50055005        self.IndexMenu = wx.MenuBar()
    50065006        self.PrefillDataMenu(self.IndexMenu)
     
    50145014        self.ImportCell = self.IndexEdit.Append(G2G.wxID_IMPORTCELL,'Import Cell',
    50155015            'Import unit cell from file')
    5016         self.TransposeCell = self.IndexEdit.Append(G2G.wxID_TRANSPOSECELL,'Transform Cell',
     5016        self.TransposeCell = self.IndexEdit.Append(G2G.wxID_TRANSFORMCELL,'Transform Cell',
    50175017            'Transform unit cell')
    50185018        self.RefineCell = self.IndexEdit.Append(G2G.wxID_REFINECELL,'Refine Cell',
  • trunk/GSASIIimgGUI.py

    r3478 r3521  
    4040import GSASIIobj as G2obj
    4141import GSASIIpy3 as G2py3
     42import ImageCalibrants as calFile
    4243
    4344VERY_LIGHT_GREY = wx.Colour(235,235,235)
     
    149150    data tree entry
    150151    '''
    151     import ImageCalibrants as calFile
    152152#patch
    153153    if 'Flat Bkg' not in data:
  • trunk/GSASIIphsGUI.py

    r3511 r3521  
    310310        self.ifConstr = True
    311311        self.Mtrans = False
     312        self.kvec = [0.,0.,0.]
     313        self.Bilbao = ''
    312314        self.Draw()
    313315
     
    371373                    Nops *= 2
    372374                self.SGData['SpnFlp'] = Nops*[1,]
     375                del self.oldSGdata['MAXMAGN']
    373376            wx.CallAfter(self.Draw)
    374377
     
    401404            Obj = event.GetEventObject()
    402405            self.Mtrans = Obj.GetValue()
    403 
    404 #        self.SGData = self.Phase['General']['SGData']
     406           
     407        def OnBilbao(event):
     408            import MAXMAGN
     409            oldkvec = self.kvec
     410            SGNo = G2spc.SpaceGroupNumber(self.SGData['SpGrp'])
     411            if not SGNo+1:
     412                wx.MessageBox('Nonstandard space group '+self.SGData['SpGrp']+' is not known by MAXMAGN',
     413                    caption='Bilbao MAXMAGN error',style=wx.ICON_EXCLAMATION)
     414                return
     415            dlg = G2G.MultiFloatDialog(self,title='Propagation vector',prompts=['kx','ky','kz'],
     416                    values=self.kvec,limits=[[0.,1.],[0.,1.],[0.,1.]],formats=['%4.1f','%4.1f','%4.1f'])
     417            if dlg.ShowModal() == wx.ID_OK:
     418                self.kvec = dlg.GetValues()
     419                if self.kvec != oldkvec or 'MAXMAGN' not in self.oldSGdata:
     420                    self.oldSGdata['MAXMAGN'] = MAXMAGN.MAXMAGN(SGNo,self.kvec)
     421            wx.CallAfter(self.Draw)
     422                   
     423        def OnBilbaoSG(event):
     424            Obj = event.GetEventObject()
     425            result = self.oldSGdata['MAXMAGN'][Obj.GetSelection()]
     426            self.Bilbao = result[0]
     427            numbs = [eval(item+'.') for item in result[2].split()]
     428            self.Uvec = np.array(numbs[3::4])
     429            self.Trans = np.array([numbs[:3],numbs[4:7],numbs[8:11]])
     430            SpGrp = G2spc.StandardizeSpcName(result[0])
     431            self.SGData = G2spc.SpcGroup(SpGrp)[1]
     432            text,table = G2spc.SGPrint(self.SGData)
     433            self.Phase['General']['SGData'] = self.SGData
     434            self.newSpGrp = SpGrp
     435            msg = 'Space Group Information'
     436            G2G.SGMessageBox(self.panel,msg,text,table).Show()
     437            self.BNSlatt = self.SGData['SGLatt']+'_'+result[1]
     438            GenSym,GenFlg,BNSsym = G2spc.GetGenSym(self.SGData)
     439            self.SGData['BNSlattsym'] = [self.BNSlatt,BNSsym[self.BNSlatt]]
     440            self.SGData['SGSpin'] = [1,]*len(self.SGData['SGSpin'])
     441            Nops = len(self.SGData['SGOps'])*len(self.SGData['SGCen'])
     442            if self.SGData['SGInv']:
     443                Nops *= 2
     444            self.SGData['SpnFlp'] = Nops*[1,]                   
     445            wx.CallAfter(self.Draw)
     446
    405447        self.panel.Destroy()
    406448        self.panel = wx.Panel(self)
     
    456498        mainSizer.Add(MatSizer)
    457499        if self.ifMag:
     500            MagSizer = wx.BoxSizer(wx.HORIZONTAL)
    458501            Mtrans = wx.CheckBox(self.panel,label=' Use matrix transform?')
    459502            Mtrans.SetValue(self.Mtrans)
    460503            Mtrans.Bind(wx.EVT_CHECKBOX,OnMtrans)
    461             mainSizer.Add(Mtrans,0,WACV)
     504            MagSizer.Add(Mtrans,0,WACV)
     505            Bilbao = wx.Button(self.panel,label='Run Bilbao MAXMAGN')
     506            Bilbao.Bind(wx.EVT_BUTTON,OnBilbao)
     507            MagSizer.Add(Bilbao,0,WACV)
     508            mainSizer.Add(MagSizer,0,WACV)
    462509        mainSizer.Add(wx.StaticText(self.panel,label=' Old lattice parameters:'),0,WACV)
    463510        mainSizer.Add(wx.StaticText(self.panel,label=
     
    474521        sgSizer = wx.BoxSizer(wx.HORIZONTAL)
    475522        sgSizer.Add(wx.StaticText(self.panel,label=' Target space group: '),0,WACV)
    476         SGTxt = wx.Button(self.panel,wx.ID_ANY,self.newSpGrp,size=(100,-1))
    477         SGTxt.Bind(wx.EVT_BUTTON,OnSpaceGroup)
    478         sgSizer.Add(SGTxt,0,WACV)
     523        if self.oldSGdata.get('MAXMAGN',[]):
     524            Bilbao = []
     525            for result in self.oldSGdata['MAXMAGN']:
     526                Bilbao.append(result[0])
     527            SGTxtB = wx.ComboBox(self.panel,choices=Bilbao,value=self.Bilbao,style=wx.CB_READONLY|wx.CB_DROPDOWN)
     528            SGTxtB.Bind(wx.EVT_COMBOBOX,OnBilbaoSG)
     529            sgSizer.Add(SGTxtB,0,WACV)
     530        else:
     531            SGTxt = wx.Button(self.panel,wx.ID_ANY,self.newSpGrp,size=(100,-1))
     532            SGTxt.Bind(wx.EVT_BUTTON,OnSpaceGroup)
     533            sgSizer.Add(SGTxt,0,WACV)
    479534        mainSizer.Add(sgSizer,0,WACV)
    480535        if 'magnetic' not in self.Phase['General']['Type']:
  • trunk/GSASIIpwdGUI.py

    r3512 r3521  
    30453045        if 'R' in controls[5]: controls[5] = 'R3-H'
    30463046        controls[6:12] = Cell[1:8]
    3047         controls[13] = spaceGroups[bravaisSymb.index(controls[5])]
     3047        controls[13] = SGData['SpGrp']
    30483048        G2frame.GPXtree.SetItemPyData(UnitCellsId,[controls,bravais,cells,dmin,ssopt])
    30493049        G2frame.dataWindow.RefineCell.Enable(True)
     
    30633063        if 'R' in controls[5]: controls[5] = 'R3-H'
    30643064        controls[6:12] = Cell[1:8]
    3065         controls[13] = spaceGroups[bravaisSymb.index(controls[5])]
     3065        controls[13] = SGData['SpGrp']
    30663066        G2frame.GPXtree.SetItemPyData(UnitCellsId,[controls,bravais,cells,dmin,ssopt])
    30673067        G2frame.dataWindow.RefineCell.Enable(True)
     
    33283328            SGData['SpnFlp'],False).Show()
    33293329       
    3330     def TransposeUnitCell(event):
     3330    def TransformUnitCell(event):
    33313331        Trans = np.eye(3)
    33323332        Uvec = np.zeros(3)
     
    33683368    G2frame.Bind(wx.EVT_MENU, LoadUnitCell, id=G2G.wxID_LOADCELL)
    33693369    G2frame.Bind(wx.EVT_MENU, ImportUnitCell, id=G2G.wxID_IMPORTCELL)
    3370     G2frame.Bind(wx.EVT_MENU, TransposeUnitCell, id=G2G.wxID_TRANSPOSECELL)
     3370    G2frame.Bind(wx.EVT_MENU, TransformUnitCell, id=G2G.wxID_TRANSFORMCELL)
    33713371    G2frame.Bind(wx.EVT_MENU, RefineCell, id=G2G.wxID_REFINECELL)
    33723372    G2frame.Bind(wx.EVT_MENU, MakeNewPhase, id=G2G.wxID_MAKENEWPHASE)
  • trunk/GSASIIspc.py

    r3465 r3521  
    33763376        gray = " 1'"
    33773377        rspc = rspc.replace("1'",'')
    3378     elif rspc[-1:] == 'H': # hexagonal is assumed and thus can be ignored
     3378    rspc = rspc.replace("'",'')
     3379    if rspc[-1:] == 'H': # hexagonal is assumed and thus can be ignored
    33793380        rspc = rspc[:-1]
    3380     else:
    3381         rspc = rspc.replace("'",'')
     3381    if rspc[1:3] in ['M3','N3','A3','D3']:      #fix cubic old style
     3382        rspc.replace('3','-3')
     3383    bns = -1
     3384    try:
     3385        bns = rspc.index('_')
     3386        rspc = rspc.replace(rspc[bns:bns+2],'')
     3387    except ValueError:
     3388        pass
    33823389    # look for a match in the spacegroup lists
    33833390    for i in spglist.values():
     
    33913398    # not found
    33923399        return ''
     3400   
     3401def SpaceGroupNumber(spcgroup):
     3402    SGNo = -1
     3403    SpcGp = StandardizeSpcName(spcgroup)
     3404    if not SpcGp:
     3405        return SGNo
     3406    try:
     3407        SGNo = spgbyNum.index(SpcGp)
     3408    except ValueError:
     3409        pass
     3410    return SGNo
     3411
    33933412
    33943413spgbyNum = []
  • trunk/GSASIItestplot.py

    r3423 r3521  
    6262            if xpos:                                        #avoid out of frame mouse position
    6363                ypos = event.ydata
    64                 self.status.SetStatusText('X= %.2f Y= %.2f'%(xpos,ypos))
     64                self.status.SetStatusText('X= %.3f Y= %.3f'%(xpos,ypos))
    6565               
    6666        page = Plot(self.nb)
  • trunk/atmdata.py

    r3301 r3521  
    491491    'Cd_114':{'Mass':113.903,'SL':[   .748,      0],'SA':         .34},
    492492    'Cd_116':{'Mass':115.905,'SL':[   .626,      0],'SA':        .075},
    493     'In_':   {'Mass': 114.82,'SL':[      0,      0],
    494         'BW-LS':[  .4065,     -.0539,  194.,0,0,0,0,0,0]},
     493#    'In_':   {'Mass': 114.82,'SL':[      0,      0],
     494#        'BW-LS':[  .4065,     -.0539,  194.,0,0,0,0,0,0]},
     495    'In_':   {'Mass': 114.82,'SL':[  .4065,      0],'SA':       193.8},
    495496    'In_113':{'Mass':112.904,'SL':[   .539,      0],'SA':         12.},
    496     'In_115':{'Mass':114.904,'SL':[      0,      0],
    497         'BW-LS':[  0.400,      0.354, 10.793, 97.30, 30.5,0,0,0,0]},     #BW
     497#    'In_115':{'Mass':114.904,'SL':[      0,      0],
     498#        'BW-LS':[  0.400,      0.354, 10.793, 97.30, 30.5,0,0,0,0]},     #BW
     499    'In_115':{'Mass':114.904,'SL':[   .400,      0],'SA':        202.},
    498500    'Sn_':   {'Mass': 118.69,'SL':[  .6225,      0],'SA':        .626},
    499501    'Sb_':   {'Mass': 121.75,'SL':[   .557,      0],'SA':        4.91},
  • trunk/testXNFF.py

    r3508 r3521  
    1010
    1111import sys
    12 import time
    1312import wx
    1413import numpy as np
    15 import matplotlib as mpl
    1614import GSASIIpath
    1715GSASIIpath.SetBinaryPath()
     
    8886               
    8987            fplot.legend(loc='best')
     88            fplot.set_xlabel('wavelength, A')
     89            fplot.set_ylabel('b')
    9090
    9191        def test2():
Note: See TracChangeset for help on using the changeset viewer.