- Timestamp:
- Oct 26, 2020 9:40:05 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIconstrGUI.py
r4615 r4624 2098 2098 G2frame.rbBook.SetSelection(G2frame.rbBook.FindPage(pagename)) 2099 2099 2100 HelpInfo = ''' 2101 This window shows all the atoms that were read from the 2102 selected phase file. Select the atoms that will be used in the 2103 rigid body processing (this may include atoms needed to 2104 define an axis or origin that will not be included in the 2105 eventual rigid body.) Note that in the plot window, 2106 unselected atoms appear much darker than selected atoms. 2107 ''' 2100 2108 mainSizer = G2G.G2MultiChoiceWindow(RBImpPnl, 2101 2109 'Select atoms to import', 2102 atomlist,atmsel,OnChange=ShowSelection) 2110 atomlist,atmsel,OnChange=ShowSelection, 2111 helpText=HelpInfo) 2103 2112 2104 2113 # OK/Cancel buttons … … 2402 2411 mainSizer = wx.BoxSizer(wx.HORIZONTAL) 2403 2412 btnSizer = wx.BoxSizer(wx.VERTICAL) 2413 helpText = ''' 2414 In this window, if wanted, 2415 one can select one or more atoms and use them 2416 to define an origin, a specified axis or place the selected atoms into 2417 a selected plane. (Different sets of atoms can be used for each 2418 operation.) 2419 %%Once that is done, atoms can be selected and can be exported in a 2420 "XYZ" file for use in a program such as Avogadro or can be used to 2421 create a Vector or Residue rigid body. 2422 ''' 2423 btnSizer.Add(G2G.HelpButton(RBImpPnl,helpText,wrap=400), 2424 0,wx.ALIGN_RIGHT) 2404 2425 btnSizer.Add(wx.StaticText(RBImpPnl,wx.ID_ANY,'Reorder atoms by dragging'),0,wx.ALL) 2405 2426 btnSizer.Add((-1,15)) -
trunk/GSASIIctrlGUI.py
r4615 r4624 1841 1841 def __init__(self, parent, title, ChoiceList, SelectList, toggle=True, 1842 1842 monoFont=False, filterBox=True, 1843 OnChange=None, OnChangeArgs=[] ):1843 OnChange=None, OnChangeArgs=[], helpText=None): 1844 1844 self.SelectList = SelectList 1845 1845 self.ChoiceList = ['%4d) %s'%(i,item) for i,item in enumerate(ChoiceList)] # numbered list of choices (list of str values) … … 1855 1855 Sizer = self 1856 1856 topSizer = wx.BoxSizer(wx.HORIZONTAL) 1857 topSizer.Add(wx.StaticText(self.frm,wx.ID_ANY,title,size=(-1,35)), 1858 1,wx.ALL|wx.EXPAND|WACV,1) 1857 topSizer.Add(wx.StaticText(self.frm,wx.ID_ANY,title,size=(-1,35)),0,WACV) 1858 if helpText: 1859 topSizer.Add(HelpButton(self.frm,helpText,wrap=400),0,wx.ALL,5) 1860 topSizer.Add((1,-1),1,wx.ALL|wx.EXPAND,1) 1859 1861 if filterBox: 1860 1862 self.timer = wx.Timer() … … 6022 6024 tutorialIndex = ( 6023 6025 # tutorial dir, web page file name, title for page, description 6024 6026 ['Getting started'], 6025 6027 ['StartingGSASII', 'Starting GSAS.htm', 'Starting GSAS-II', 6026 6028 '''An introduction to GSAS-II with starting instructions and a brief description of the displays.'''], 6027 6029 6028 6030 ['Rietveld refinement'], 6029 6031 ['CWNeutron', 'Neutron CW Powder Data.htm', 'CW Neutron Powder fit for Yttrium-Iron Garnet', 6030 6032 '''This shows a simple Rietveld refinement with constraints from CW neutron powder diffraction data.'''], … … 6053 6055 plotting programs.'''], 6054 6056 6055 ['Magnetic Structure Analysis'], 6057 ['RigidBody', 'RigidBodyRef.html', 'Rietveld Fitting with Rigid Bodies', 6058 '''Shows how to set up and refine with rigid bodies to simplify and improve the crystal structure model.'''], 6059 6060 ['Magnetic Structure Analysis'], 6056 6061 ['SimpleMagnetic', 'SimpleMagnetic.htm',"Simple Magnetic Structure Analysis", 6057 6062 '''Analysis of a simple antiferromagnet and a simple ferromagnet from CW neutron powder data'''], … … 6072 6077 '''Analysis of a complex Type IV antiferromagnet with two propagation vectorse using Bilbao k-SUBGROUPSMAG from TOF neutron powder data'''], 6073 6078 6074 6079 ['Parametric sequential fitting'], 6075 6080 ['SeqRefine', 'SequentialTutorial.htm', 'Sequential refinement of multiple datasets', 6076 6081 '''This shows the fitting of a structural model to multiple data sets collected as a function of temperature (7-300K). … … 6085 6090 fitting of the result to get Hookes Law coefficients for elastic deformations.'''], 6086 6091 6087 6092 ['Structure solution'], 6088 6093 ['FitPeaks', 'Fit Peaks.htm', 'Fitting individual peaks & autoindexing', 6089 6094 '''This covers two examples of selecting individual powder diffraction peaks, fitting them and then … … 6110 6115 via Monte Carlo/Simulated Annealing (MC/SA).'''], 6111 6116 6112 ['Reverse MonteCarlo Modeling'],6117 ['Reverse Monte-Carlo Modeling'], 6113 6118 ['RMCProfile-I', 'RMCProfile-I.htm','RMC Modeling with RMCProfile-I', 6114 6119 '''Big box modelling for real and reciprocal space diffraction data for SF6'''], … … 6120 6125 '''x-ray big box modelling with potential energy restraints for real and reciprocal space diffraction data for GaPO4'''], 6121 6126 6122 6127 ['Stacking Fault Modeling'], 6123 6128 ['StackingFaults-I', 'Stacking Faults-I.htm', 'Stacking fault simulations for diamond', 6124 6129 '''This shows how to simulate the diffraction patterns from faulted diamond.'''], … … 6130 6135 '''This shows how to simulate some diffraction patterns from poorly ordered Georgia kaolinite (Al2Si2O5(OH)4) clay.'''], 6131 6136 6132 6137 ['Powder diffractometer calibration'], 6133 6138 ['CWInstDemo', 'FindProfParamCW.htm', 'Determining Starting Profile Parameters from a Standard', 6134 6139 '''This shows how to determine profile parameters by fitting individual peaks … … 6147 6152 coefficients thus fully describing the instrument contribution to the peak profiles.''' ], 6148 6153 6149 6154 ['2D Image Processing'], 6150 6155 ['2DCalibration', 'Calibration of an area detector in GSAS.htm', 'Calibration of an area detector', 6151 6156 '''A demonstration of calibrating a Perkin-Elmer area detector, where the detector was intentionally tilted at 45 degrees. … … 6173 6178 for future reuse.'''], 6174 6179 6175 6180 ['Small-Angle Scattering'], 6176 6181 ['SAsize', 'Small Angle Size Distribution.htm', 'Small angle x-ray data size distribution (alumina powder)', 6177 6182 '''This shows how to determine the size distribution of particles using data from a constant … … 6189 6194 factor for non-dilute systems. '''], 6190 6195 6191 6196 ['Other'], 6192 6197 ['MerohedralTwins', 'Merohedral twin refinement in GSAS.htm', 'Merohedral twin refinements', 6193 6198 '''This shows how to use GSAS-II to refine the structure of a few single crystal structures where there is merohedral twinning. '''], -
trunk/GSASIIdataGUI.py
r4622 r4624 3314 3314 '''Make sure the data tree has the minimally expected controls. 3315 3315 ''' 3316 new = False 3316 3317 if not GetGPXtreeItemId(self,self.root,'Notebook'): 3318 new = True 3317 3319 sub = self.GPXtree.AppendItem(parent=self.root,text='Notebook') 3318 3320 self.GPXtree.SetItemPyData(sub,['']) 3319 3321 if not GetGPXtreeItemId(self,self.root,'Controls'): 3322 new = True 3320 3323 sub = self.GPXtree.AppendItem(parent=self.root,text='Controls') 3321 3324 self.GPXtree.SetItemPyData(sub,copy.copy(G2obj.DefaultControls)) 3322 3325 if not GetGPXtreeItemId(self,self.root,'Covariance'): 3326 new = True 3323 3327 sub = self.GPXtree.AppendItem(parent=self.root,text='Covariance') 3324 3328 self.GPXtree.SetItemPyData(sub,{}) 3325 3329 if not GetGPXtreeItemId(self,self.root,'Constraints'): 3330 new = True 3326 3331 sub = self.GPXtree.AppendItem(parent=self.root,text='Constraints') 3327 3332 self.GPXtree.SetItemPyData(sub,{'Hist':[],'HAP':[],'Phase':[]}) 3328 3333 if not GetGPXtreeItemId(self,self.root,'Restraints'): 3334 new = True 3329 3335 sub = self.GPXtree.AppendItem(parent=self.root,text='Restraints') 3330 3336 self.GPXtree.SetItemPyData(sub,{}) 3331 3337 if not GetGPXtreeItemId(self,self.root,'Rigid bodies'): 3338 new = True 3332 3339 sub = self.GPXtree.AppendItem(parent=self.root,text='Rigid bodies') 3333 3340 self.GPXtree.SetItemPyData(sub,{'Vector':{'AtInfo':{}}, 3334 3341 'Residue':{'AtInfo':{}},'RBIds':{'Vector':[],'Residue':[]}}) 3342 if new: 3343 self.GPXtree.Expand(self.GPXtree.root) 3335 3344 3336 3345 class CopyDialog(wx.Dialog): … … 3816 3825 self.GPXtree.GetItemPyData(subr).update({PhaseName:{}}) 3817 3826 self.GPXtree.AppendItem(parent=subr,text=PhaseName) 3818 sub= self.GPXtree.AppendItem(parent=sub,text=PhaseName)3827 newphase = self.GPXtree.AppendItem(parent=sub,text=PhaseName) 3819 3828 E,SGData = G2spc.SpcGroup('P 1') 3820 self.GPXtree.SetItemPyData(sub,G2obj.SetNewPhase(Name=PhaseName,SGData=SGData)) 3821 SelectDataTreeItem(self,sub) #bring up new phase General tab 3829 self.GPXtree.SetItemPyData(newphase,G2obj.SetNewPhase(Name=PhaseName,SGData=SGData)) 3830 self.GPXtree.Expand(sub) 3831 SelectDataTreeItem(self,newphase) #bring up new phase General tab 3822 3832 3823 3833 def OnDeletePhase(self,event): -
trunk/GSASIIphsGUI.py
r4623 r4624 9853 9853 ################################################################################ 9854 9854 9855 def FillRigidBodyGrid(refresh=True ):9855 def FillRigidBodyGrid(refresh=True,vecId=None,resId=None): 9856 9856 '''Fill the Rigid Body Phase information tab page. 9857 9857 Note that the page is a ScrolledWindow, not a Grid … … 9873 9873 elif val == 'None': 9874 9874 RBObj['ThermalMotion'][0] = 'None' 9875 wx.CallAfter(FillRigidBodyGrid,True)9876 9875 if val != 'None': 9877 9876 cia = data['General']['AtomPtrs'][3] 9878 9877 for i,Id in enumerate(RBObj['Ids']): 9879 9878 data['Atoms'][AtLookUp[Id]][cia] = Ttype 9879 resId,vecId = None,None 9880 if resSelect: 9881 resId = resSelect.GetSelection() 9882 if select: 9883 vecId = select.GetSelection() 9884 wx.CallAfter(FillRigidBodyGrid,True,vecId=vecId,resId=resId) 9880 9885 G2plt.PlotStructure(G2frame,data) 9881 9886 … … 9962 9967 maxMult = len(SGData['SGOps'])*len(SGData['SGCen']) 9963 9968 if SGData['SGInv']: maxMult *= 2 9969 rbSizer = wx.BoxSizer(wx.VERTICAL) 9964 9970 topSizer = wx.FlexGridSizer(0,6,5,5) 9965 9971 if type(RBObj['Orig'][0]) is tuple: # patch because somehow adding RB origin is becoming a tuple … … 9996 10002 Sytsym,Mult = G2spc.SytSym(rbObj['Orig'][0],SGData)[:2] 9997 10003 sytsymtxt = wx.StaticText(RigidBodies,label='Origin site symmetry: %s, multiplicity: %d '%(Sytsym,Mult)) 9998 topSizer.Add(sytsymtxt) 9999 return topSizer 10004 rbSizer.Add(topSizer) 10005 rbSizer.Add(sytsymtxt) 10006 return rbSizer 10000 10007 10001 10008 def ResrbSizer(RBObj): … … 10121 10128 10122 10129 def OnResSelect(event): 10123 rbId = select.GetSelection()10130 rbId = resSelect.GetSelection() 10124 10131 wx.CallLater(100,RepaintRBInfo,'Residue',rbId) 10125 10132 … … 10168 10175 mainSizer = wx.BoxSizer(wx.VERTICAL) 10169 10176 nobody = True 10177 resSelect = None 10178 select = None 10170 10179 if 'Residue' in data['RBModels'] and len(data['RBModels']['Residue']): 10171 10180 nobody = False … … 10176 10185 for RBObj in data['RBModels']['Residue']: 10177 10186 RBnames.append(RBObj['RBname']+RBObj['numChain']) 10178 rbName = RBnames[0] 10179 rbObj = data['RBModels']['Residue'][0] 10187 if resId is None: 10188 resId = 0 10189 rbName = RBnames[resId] 10190 rbObj = data['RBModels']['Residue'][resId] 10180 10191 data['Drawing']['viewPoint'][0] = rbObj['Orig'][0] 10181 10192 data['Drawing']['Quaternion'] = rbObj['Orient'][0] 10182 select = wx.ListBox(RigidBodies,choices=RBnames,style=wx.LB_SINGLE,size=(-1,120))10183 select.SetSelection(RBnames.index(rbName))10184 select.SetFirstItem(RBnames.index(rbName))10185 select.Bind(wx.EVT_LISTBOX,OnResSelect)10186 mainSizer.Add( select,0)10193 resSelect = wx.ListBox(RigidBodies,choices=RBnames,style=wx.LB_SINGLE,size=(-1,120)) 10194 resSelect.SetSelection(RBnames.index(rbName)) 10195 resSelect.SetFirstItem(RBnames.index(rbName)) 10196 resSelect.Bind(wx.EVT_LISTBOX,OnResSelect) 10197 mainSizer.Add(resSelect,0) 10187 10198 G2frame.bottomSizer = wx.BoxSizer(wx.VERTICAL) 10188 10199 G2frame.bottomSizer.Add(ResrbSizer(rbObj)) … … 10198 10209 for RBObj in data['RBModels']['Vector']: 10199 10210 RBnames.append(RBObj['RBname']) 10200 rbName = RBnames[0] 10201 rbObj = data['RBModels']['Vector'][0] 10211 if vecId is None: 10212 vecId = 0 10213 rbName = RBnames[vecId] 10214 rbObj = data['RBModels']['Vector'][vecId] 10202 10215 data['Drawing']['viewPoint'][0] = rbObj['Orig'][0] 10203 10216 data['Drawing']['Quaternion'] = rbObj['Orient'][0] … … 10690 10703 atNames = data['testRBObj']['atNames'] 10691 10704 topSizer = wx.BoxSizer(wx.HORIZONTAL) 10692 topSizer.Add(wx.StaticText(RigidBodies,label='Locating rigid body : '+rbName), 0, WACV) 10705 helpText = ''' 10706 This window is used to insert a rigid body into a unit cell, determining 10707 the initial settings for the position and orientation of the body, 10708 as well as any torsion angles. The origin 10709 determines where the origin of the rigid body will be placed in the 10710 unit cell (expressed in fractional coordinates). 10711 The orientation is determined by a quaternion 10712 that is expressed here as vector (in fraction coordinates) and an azimuthal 10713 rotation (in degrees) around that quaternion vector. For systems where symmetry 10714 dictates that the rigid body needs to be oriented in a particular direction, 10715 the rigid body coordinate system must be defined with the symmetry 10716 direction along the Cartesian x, y, z, x+y or x+y+z and this must be 10717 selected with the "Rigid body symmetry axis." This places the 10718 selected Cartesian axis along the quaternion vector. 10719 10720 %%If there are atoms in the unit cell that are of the appropriate type and 10721 are not already assigned to rigid bodies, a table shows each 10722 atom in the rigid body and the closest atom unit cell atom, as well 10723 as the distance between them. This pairing can be set manually using the 10724 pulldown menu in the "Assign as atom" column, where a particular atom 10725 can be selected. One option is "create new" which means that that RB atom 10726 will not be paired to a unit cell atom. "Update Assignments" recomputes distance 10727 between paired atoms. 10728 Note that when a row in the table is selected, the corresponding atoms 10729 are highlighted in green. The tab key or the "Crystal Highlight" pulldown 10730 can be used to highlight differing unit cell atoms. Alt-Tab highlights different 10731 RB atoms. 10732 If at least one atom is paired manually using "Assign as", the 10733 "Set Origin" button can be used to place the rigid body origin to best fit 10734 the paired atom(s). Likewise, with two or more atoms assigned, the 10735 "Set Orientation" button will determine the quaternion azimuth and vector. Three 10736 or more pairs are assignments allow use of the "Set both" button, which 10737 sets the orientation and origin to best give the smallest distances between 10738 the assigned atoms. 10739 %%The GSAS-II graphics window shows the unit cell contents (use the 10740 "Ball & Sticks" or "Sticks" buttons to change the display of this) and 10741 the rigid body is shown with small balls and green sticks. At the origin of the 10742 RB the axes are indicated with red, green and blue lines (for x, y, & z). 10743 A white line indicates the quaternion vector direction. 10744 The mouse can also be used to position the rigid body in the plot by holding 10745 the Alt key down while dragging with the mouse: Alt+left button to rotates 10746 the RB in the screen x & y; Alt+middle mouse to rotates around the screen z 10747 (out of plane); Alt+right mouse translates the RB in the screen x-y plane. 10748 Note that dragging the mouse without the Alt button changes the view 10749 of the crystal structure. 10750 %%Once the rigid body has been placed in the desired position, press the "Add" button. 10751 ''' 10752 topSizer.Add(G2G.HelpButton(RigidBodies,helpText,wrap=700), 10753 0,wx.RIGHT,5) 10754 topSizer.Add(wx.StaticText(RigidBodies,label='Locating rigid body: '+rbName), 0, WACV) 10693 10755 topSizer.Add((10,-1),0) 10694 10756 topSizer.Add(wx.StaticText(RigidBodies,label='Display crystal structure as:'), 0, WACV) … … 10736 10798 xmin=0.,xmax=360.,typeHint=float,OnLeave=UpdateOrientation)) 10737 10799 OriSizer2.Add(OrientVecSiz[-1],0,WACV) 10738 azSlide = wx.Slider(RigidBodies,style=wx.SL_HORIZONTAL, value=int(rbObj['OrientVec'][0]*10.),size=(200,25))10800 azSlide = wx.Slider(RigidBodies,style=wx.SL_HORIZONTAL,size=(200,25)) 10739 10801 azSlide.SetRange(0,3600) 10802 azSlide.SetValue(int(10*rbObj['OrientVec'][0])) 10740 10803 azSlide.Bind(wx.EVT_SLIDER, OnAzSlide) 10741 10804 OriSizer2.Add(azSlide,0,WACV) -
trunk/GSASIIplot.py
r4622 r4624 425 425 try: 426 426 Page = self.nb.GetPage(self.nb.GetSelection()) 427 except ValueError: # occurs with no plot tabs 427 except: # occurs with no plot tabs 428 event.Skip() 428 429 return 429 430 try:
Note: See TracChangeset
for help on using the changeset viewer.