Changeset 2603
- Timestamp:
- Dec 26, 2016 2:24:57 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIplot.py
r2602 r2603 4124 4124 Page.canvas.draw() 4125 4125 elif G2frame.MaskKey == 's': 4126 Masks['Points'].append([]) 4126 new,plotNum,Page,Plot,lim = G2frame.G2plotNB.FindPlotTab('2D Powder Image','mpl',newImage=False) 4127 Page.figure.suptitle('Left-click to create a spot mask',color='r',fontweight='bold') 4128 Page.canvas.draw() 4127 4129 elif G2frame.MaskKey == 'a': 4128 Masks['Arcs'].append([]) 4130 new,plotNum,Page,Plot,lim = G2frame.G2plotNB.FindPlotTab('2D Powder Image','mpl',newImage=False) 4131 Page.figure.suptitle('Left-click to create an arc mask',color='r',fontweight='bold') 4132 Page.canvas.draw() 4129 4133 elif G2frame.MaskKey == 'r': 4130 Masks['Rings'].append([]) 4134 new,plotNum,Page,Plot,lim = G2frame.G2plotNB.FindPlotTab('2D Powder Image','mpl',newImage=False) 4135 Page.figure.suptitle('Left-click to create a ring mask',color='r',fontweight='bold') 4136 Page.canvas.draw() 4131 4137 G2imG.UpdateMasks(G2frame,Masks) 4132 4138 … … 4155 4161 G2frame.MaskKey = 'm' 4156 4162 (x0,y0),(x1,y1) = Plot.get_position().get_points() 4157 Page.figure.suptitle('Multiple spot mode on ',color='r',fontweight='bold')4163 Page.figure.suptitle('Multiple spot mode on, press m or right-click to end',color='r',fontweight='bold') 4158 4164 Page.Choice[-1] = 'm: stop multiple spot mask mode' 4159 4165 Page.canvas.draw() … … 4285 4291 return 4286 4292 if not (event.xdata and event.ydata): return 4287 spot = [event.xdata,event.ydata,1.] 4293 d = GSASIIpath.GetConfigValue('Spot_mask_diameter',1.0) 4294 spot = [event.xdata,event.ydata,d] 4288 4295 Masks['Points'].append(spot) 4289 4296 artist = Circle(spot[:2],radius=spot[2]/2,fc='none',ec='r',picker=3) … … 4627 4634 return 4628 4635 if G2frame.MaskKey == 'm': 4629 spot = [Xpos,Ypos,1.] 4630 Masks['Points'].append(spot) 4631 artist = Circle((Xpos,Ypos),radius=spot[2]/2,fc='none',ec='r',picker=3) 4632 Page.figure.gca().add_artist(artist) 4633 artist.itemNumber = len(Masks['Points'])-1 4634 artist.itemType = 'Spot' 4635 G2imG.UpdateMasks(G2frame,Masks) 4636 Page.canvas.draw() 4636 if event.button == 3: 4637 ToggleMultiSpotMask(G2frame) 4638 else: 4639 d = GSASIIpath.GetConfigValue('Spot_mask_diameter',1.0) 4640 spot = [Xpos,Ypos,d] 4641 Masks['Points'].append(spot) 4642 artist = Circle((Xpos,Ypos),radius=spot[2]/2,fc='none',ec='r',picker=3) 4643 Page.figure.gca().add_artist(artist) 4644 artist.itemNumber = len(Masks['Points'])-1 4645 artist.itemType = 'Spot' 4646 G2imG.UpdateMasks(G2frame,Masks) 4647 Page.canvas.draw() 4637 4648 return 4638 elif G2frame.MaskKey == 's' and event.button == 1: 4639 Masks['Points'][-1] = [Xpos,Ypos,1.] 4649 elif G2frame.MaskKey == 's': 4650 if event.button == 1: 4651 d = GSASIIpath.GetConfigValue('Spot_mask_diameter',1.0) 4652 spot = [Xpos,Ypos,d] 4653 Masks['Points'].append(spot) 4654 G2imG.UpdateMasks(G2frame,Masks) 4655 G2frame.MaskKey = '' 4656 wx.CallAfter(PlotImage,G2frame,newImage=True) 4657 return 4658 elif G2frame.MaskKey == 'r': 4659 if event.button == 1: 4660 tth = G2img.GetTth(Xpos,Ypos,Data) 4661 t = GSASIIpath.GetConfigValue('Ring_mask_thickness',0.1) 4662 Masks['Rings'].append([tth,t]) 4663 G2imG.UpdateMasks(G2frame,Masks) 4640 4664 G2frame.MaskKey = '' 4641 elif G2frame.MaskKey == 'r' and event.button == 1: 4642 tth = G2img.GetTth(Xpos,Ypos,Data) 4643 Masks['Rings'][-1] = [tth,0.1] 4644 G2frame.MaskKey = '' 4645 elif G2frame.MaskKey == 'a' and event.button == 1: 4646 tth,azm = G2img.GetTthAzm(Xpos,Ypos,Data) 4647 azm = int(azm) 4648 Masks['Arcs'][-1] = [tth,[azm-5,azm+5],0.1] 4649 G2frame.MaskKey = '' 4665 wx.CallAfter(PlotImage,G2frame,newImage=True) 4666 return 4667 elif G2frame.MaskKey == 'a': 4668 if event.button == 1: 4669 tth,azm = G2img.GetTthAzm(Xpos,Ypos,Data) 4670 azm = int(azm) 4671 t = GSASIIpath.GetConfigValue('Ring_mask_thickness',0.1) 4672 a = GSASIIpath.GetConfigValue('Arc_mask_azimuth',10.0) 4673 Masks['Arcs'].append([tth,[azm-a/2.,azm+a/2.],t]) 4674 G2imG.UpdateMasks(G2frame,Masks) 4675 G2frame.MaskKey = '' 4676 wx.CallAfter(PlotImage,G2frame,newImage=True) 4677 return 4650 4678 elif G2frame.MaskKey =='p' or G2frame.MaskKey =='f': 4651 4679 if G2frame.MaskKey =='p': … … 4660 4688 if len(polygon) <= 2: # too few points 4661 4689 if G2frame.MaskKey =='p': 4662 del Masks['Polygons'] 4690 del Masks['Polygons'][-1] 4663 4691 else: 4664 4692 Masks['Frames'] = [] -
trunk/config_example.py
r2455 r2603 106 106 GSAS-II is started. 107 107 ''' 108 109 Spot_mask_diameter = 1.0 110 '''Specifies the default diameter for creation of spot masks. Default is 1.0 mm 111 ''' 112 113 Ring_mask_thickness = 0.1 114 '''Specifies the default thickness for creation of ring and arc masks. 115 Default is 0.1 degrees 2-theta. 116 ''' 117 118 Arc_mask_azimuth = 10.0 119 '''Specifies the default azimuthal range for creation of arc masks. 120 Default is 10.0 degrees 2-theta. 121 ''' -
trunk/help/gsasII.html
r2602 r2603 3188 3188 right mouse button. The left button click is generated otherwise. 3189 3189 3190 <h2><a name=Programmers><strong>Programmers documentation</strong></a><strong>:<o:p></o:p></strong></h2> 3190 <h3><a name=Preferences><strong>Configuration Variables</strong></a><strong>:<o:p></o:p></strong></h3> 3191 3192 <p class=MsoNormal><span style='mso-fareast-font-family:"Times New 3193 Roman"'>GSAS-II provides a number of configuration settings that can 3194 be changed via variables that can be set and saved. These are 3195 controlled in the File/Preferences menu item (on Mac the Preferences 3196 menu is found in the usual place, in the main application menu). These 3197 settings are optionally saved from for subsequent runs in a file named 3198 <tt>config.py</tt>. More information about this can be found in the 3199 <a 3200 href="https://subversion.xray.aps.anl.gov/pyGSAS/sphinxdocs/build/html/GSASIIutil.html#module-config_example"> 3201 appropriate section of the Programmer's documentation</a>. 3202 3203 <h3><a name=Programmers><strong>Programmers documentation</strong></a><strong>:<o:p></o:p></strong></h3> 3191 3204 3192 3205 <p class=MsoNormal><span style='mso-fareast-font-family:"Times New Roman"'>The … … 5557 5570 three ways to create spot masks with the keyboard: 5558 5571 <UL> 5559 <LI style='margin-left:.2in'>Press the 's' key and then click on the mask location. 5572 <LI style='margin-left:.2in'>Press the 's' key and then left-click on the mask location. 5573 (<a href="#Mac_rightclick">Right-click*</a> to cancel.) 5560 5574 <LI style='margin-left:.2in'>Press the 'm' key and 5561 then click successively on multiple locations for spot masks. Press the 'm' key again 5575 then left-click successively on multiple locations for spot 5576 masks. Press the 'm' key again or <a href="#Mac_rightclick">right-click*</a> 5562 5577 to stop adding spot masks. 5563 5578 <LI style='margin-left:.2in'>Move the mouse to the position for a … … 5565 5580 this can be used while the plot is in Zoom or Pan mode.) 5566 5581 </UL> 5582 <P style='margin-left:.45in'>The default size for newly-created spot 5583 masks is determined by the <tt>Spot_mask_diameter</tt> 5584 <A Href=#Preferences>configuration variable</a> or 1.0 mm, if not specified. 5567 5585 <P style='margin-left:.25in'><B>Edit Spot mask location</B> by left-clicking inside 5568 5586 or on the edge the of the mask and then drag the spot mask to a new 5569 5587 location. 5570 <P style='margin-left:.25in'><B>Edit Spot mask radius</B> by <a href="#Mac_rightclick">right-clicking*</a> inside 5571 the mask and then dragging to change the mask size. 5588 <P style='margin-left:.25in'><B>Edit Spot mask radius</B> by 5589 <a href="#Mac_rightclick">right-clicking*</a> inside 5590 the mask and then dragging to change the mask size. 5572 5591 5573 5592 <LI style='margin-left:.5in'>Ring masks: occludes a specific Bragg … … 5575 5594 location and thickness of the ring are specified in degrees 5576 5595 2-theta. 5577 <P style='margin-left:.25in'><B>Create Ring masks</B> with a menu command and then by clicking on 5578 the location on the image that should be masked. Or, by pressing the 5579 'r' key and then clicking at the appropriate radius. Initially the 5580 mask is given a thickness of 0.1 degrees. 5596 <P style='margin-left:.25in'><B>Create Ring masks</B> with a menu command and then by left-clicking on 5597 the mask center; Or, by pressing the 5598 'r' key and then left-clicking. 5599 (<a href="#Mac_rightclick">Right-click*</a> to cancel.) 5600 <P style='margin-left:.45in'>The default thickness for newly-created ring 5601 masks is determined by the <tt>Ring_mask_thickness</tt> 5602 <A Href=#Preferences>configuration variable</a> or 0.1 degrees 5603 (2theta) if not specified. 5581 5604 <P style='margin-left:.25in'><B>Edit Ring mask location</B> by 5582 5605 left-clicking on either the inner or outer circle and drag the … … 5588 5611 <LI style='margin-left:.5in'>Arc masks: occludes a section of a Bragg 5589 5612 reflection, similar to a ring mask, except that in addition to the 5590 location and thickness of the ring (in degrees 5591 2-theta), the starting and ending 5592 azimuthal angles are also specified in degrees. 5593 5594 <P style='margin-left:.25in'><B>Create Arc masks</B> with a menu command and then by clicking on 5595 the location on the image that should be masked. Or, by pressing the 5596 'a' key and then clicking at the appropriate radius. Initially the 5597 mask is given a thickness of 0.1 degrees and an azimuthal range of 5598 10 degrees. 5613 location and thickness of the ring, the mask has a starting and ending 5614 azimuthal angle. 5615 <P style='margin-left:.25in'><B>Create Arc masks</B> with a menu command and then by left-clicking on 5616 at the mask center; Or, by pressing the 5617 'a' key and then left-clicking. 5618 (<a href="#Mac_rightclick">Right-click*</a> to cancel.) 5619 <P style='margin-left:.45in'>The default size for newly-created ring 5620 masks is determined by 5621 <A Href=#Preferences>configuration variables</a><BR> 5622 thickness: <tt>Ring_mask_thickness</tt> (0.1 degrees 2theta if not specified) and 5623 <BR>azimuthal range: <tt>Arc_mask_azimuth</tt> (10.0 degrees if not specified.) 5599 5624 <P style='margin-left:.25in'><B>Edit Arc mask location</B> by 5600 5625 left-clicking on either the inner or outer circle and drag the … … 7640 7665 style='mso-bookmark:Pawley'><o:p> </o:p></span></p> 7641 7666 7642 <p class=MsoNormal style='margin-left:.5in'><span style='mso-bookmark:Pawley'><!-- hhmts start -->Last modified: Sun Dec 25 21:30:18CST 2016 <!-- hhmts end --></span></p>7667 <p class=MsoNormal style='margin-left:.5in'><span style='mso-bookmark:Pawley'><!-- hhmts start -->Last modified: Mon Dec 26 14:20:05 CST 2016 <!-- hhmts end --></span></p> 7643 7668 7644 7669 </div>
Note: See TracChangeset
for help on using the changeset viewer.