Changeset 5058


Ignore:
Timestamp:
Oct 29, 2021 4:20:04 PM (2 years ago)
Author:
vondreele
Message:

provide sliders for mode displacements - not connected yet

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIconstrGUI.py

    r5057 r5058  
    38473847    ISO = data['ISODISTORT']
    38483848    mainSizer.Add(wx.StaticText(dlg,wx.ID_ANY,
    3849         'ISODISTORT mode computation for cordinates in phase '+str(data['General'].get('Name'))))
     3849        'ISODISTORT mode computation for coordinates in phase '+str(data['General'].get('Name'))))
    38503850    aSizer = wx.BoxSizer(wx.HORIZONTAL)
    38513851    panel1 = wxscroll.ScrolledPanel(
  • trunk/GSASIImath.py

    r5015 r5058  
    20692069                drawatom[dcx+3:dcx+6] = M
    20702070    return drawAtoms,Fade
     2071
     2072def ApplyModeDisp(data):
     2073    ''' Applies ISODISTORT mode displacements to drawing atoms
     2074    '''
     2075    return
     2076    # generalData = data['General']
     2077    # cell = generalData['Cell'][1:7]
     2078    # G,g = G2lat.cell2Gmat(cell)
     2079    # SGData = generalData['SGData']
     2080    # cx,ct,cs,cia = getAtomPtrs(data)
     2081    # drawingData = data['Drawing']
     2082    # dcx,dct,dcs,dci = getAtomPtrs(data,True)
     2083    # atoms = data['Atoms']
     2084    # drawAtoms = drawingData['Atoms']
     2085    # for atom in atoms:
     2086    #     atxyz = np.array(atom[cx:cx+3])
     2087    #     indx = FindAtomIndexByIDs(drawAtoms,dci,[atom[cia+8],],True)
     2088    #     for ind in indx:
     2089    #         drawatom = drawAtoms[ind]
     2090    #         opr = drawatom[dcs-1]           
     2091    #         X = G2spc.ApplyStringOps(opr,SGData,atxyz+wave)
     2092    #         drawatom[dcx:dcx+3] = X
     2093
    20712094   
    20722095# gauleg.py Gauss Legendre numerical quadrature, x and w computation
  • trunk/GSASIIphsGUI.py

    r5057 r5058  
    66516651            modeDisp[idsp] = (Obj.GetValue()-100)/1000.
    66526652            dispVal.SetValue(modeDisp[idsp])
    6653            
    6654        
    6655         Indx = {}       
     6653            G2mth.ApplyModeDisp(data)
     6654            G2plt.PlotStructure(G2frame,data)
     6655           
     6656        def OnDispVal(invalid,value,tc):
     6657            idsp,displ = Indx[tc.GetId()]
     6658            displ.SetValue(int(value*1000)+100)
     6659            G2mth.ApplyModeDisp(data)
     6660            G2plt.PlotStructure(G2frame,data)
     6661           
     6662        def OnReset(event):
     6663            data['ISODISTORT']['modeDispl'] = np.zeros(len(data['ISODISTORT']['G2ModeList']))
     6664            G2mth.ApplyModeDisp(data)
     6665            G2plt.PlotStructure(G2frame,data)
     6666            UpdateISODISTORT()                                   
     6667       
     6668        Indx = {}     
    66566669        if 'radio' not in data['ISODISTORT']:
    66576670            if not data['ISODISTORT']:
     
    66606673                SetPhaseWindow(ISODIST,mainSizer,Scroll=Scroll)               
    66616674                return
     6675#patch
     6676            if 'modeDispl' not in data['ISODISTORT']:
     6677                data['ISODISTORT']['modeDispl'] = np.zeros(len(data['ISODISTORT']['G2ModeList']))
     6678#end patch
    66626679            mainSizer = wx.BoxSizer(wx.VERTICAL)
    66636680            topSizer = wx.BoxSizer(wx.VERTICAL)   
     
    66706687  J. Appl. Cryst. 39, 607-614 (2006).
    66716688  '''),0,WACV)
    6672             topSizer.Add(wx.StaticText(ISODIST,label=' Adjust magnitude of distortion modes (-0.1 to +0.1):'))
     6689            lineSizer = wx.BoxSizer(wx.HORIZONTAL)           
     6690            lineSizer.Add(wx.StaticText(ISODIST,label=' Adjust magnitude of distortion modes (-0.1 to +0.1):  '),0,WACV)
     6691            reset = wx.Button(ISODIST,label='Reset modes')
     6692            reset.Bind(wx.EVT_BUTTON,OnReset)
     6693            lineSizer.Add(reset,0,WACV)
     6694            topSizer.Add(lineSizer,0,WACV)
    66736695            slideSizer = wx.FlexGridSizer(0,3,0,0)
    66746696            slideSizer.AddGrowableCol(2,1)
    6675             modeDisp = np.zeros(len(data['ISODISTORT']['G2ModeList']))
     6697            modeDisp = data['ISODISTORT']['modeDispl']
    66766698            for idsp,item in enumerate(data['ISODISTORT']['G2ModeList']):
    66776699                slideSizer.Add(wx.StaticText(ISODIST,label=item.name),0,WACV)
    6678                 dispVal = G2G.ValidatedTxtCtrl(ISODIST,modeDisp,idsp,xmin=-0.1,xmax=0.1,size=(50,20))
     6700                dispVal = G2G.ValidatedTxtCtrl(ISODIST,modeDisp,idsp,xmin=-0.1,xmax=0.1,size=(50,20),OnLeave=OnDispVal)
    66796701                slideSizer.Add(dispVal,0,WACV)
    66806702                displ = wx.Slider(ISODIST,style=wx.SL_HORIZONTAL,value=int(modeDisp[idsp]*1000)+100)
     
    66826704                displ.Bind(wx.EVT_SLIDER, OnDispl)
    66836705                Indx[displ.GetId()] = [idsp,dispVal]
     6706                Indx[dispVal.GetId()] = [idsp,displ]
    66846707                slideSizer.Add(displ,1,wx.EXPAND|wx.RIGHT)
     6708            slideSizer.SetMinSize(wx.Size(350,10))
    66856709            topSizer.Add(slideSizer)
    66866710            mainSizer.Add(topSizer)
  • trunk/GSASIIpwd.py

    r5054 r5058  
    34423442    return np.array(bondAngles)
    34433443   
     3444   
    34443445#### Reflectometry calculations ################################################################################
    34453446def REFDRefine(Profile,ProfDict,Inst,Limits,Substances,data):
  • trunk/imports/G2phase_CIF.py

    r5057 r5058  
    785785            # create the constraints
    786786            modeVarList = []
     787            modeDispl = []
    787788            for i,row in enumerate(displacivemodeInvmatrix):
    788789                constraint = []
     
    795796                constraint += [modeVar,False,'f']
    796797                self.Constraints.append(constraint)
     798                modeDispl.append(0.0)
    797799            # normilization constants
    798800            normlist = []
     
    820822                'Var2ModeMatrix' : displacivemodeInvmatrix,
    821823                'Mode2VarMatrix' : displacivemodematrix,
     824                'modeDispl' : modeDispl
    822825                })
    823826            # make explaination dictionary
Note: See TracChangeset for help on using the changeset viewer.