Changeset 4198
- Timestamp:
- Dec 9, 2019 2:30:49 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIIO.py
r4184 r4198 1531 1531 the active histogram being exported. 1532 1532 ''' 1533 self.G2frame.CheckNotebook() 1533 1534 self.parmDict = {} 1534 1535 self.sigDict = {} -
trunk/GSASIIdataGUI.py
r4195 r4198 417 417 ################################################################################ 418 418 class GSASII(wx.Frame): 419 '''Define the main GSAS-II frame and its associated menu items 420 ''' 419 '''Define the main GSAS-II frame and its associated menu items. 420 421 :param parent: reference to parent application 422 423 ''' 421 424 def MenuBinding(self,event): 422 425 '''Called when a menu is clicked upon; looks up the binding in table … … 438 441 439 442 def _Add_FileMenuItems(self, parent): 443 '''Add items to File menu 444 ''' 440 445 item = parent.Append(wx.ID_ANY,'&Open project...\tCtrl+O','Open a GSAS-II project file (*.gpx)') 441 446 self.Bind(wx.EVT_MENU, self.OnFileOpen, id=item.GetId()) … … 471 476 472 477 def _Add_DataMenuItems(self,parent): 478 '''Add items to Data menu 479 ''' 473 480 # item = parent.Append( 474 481 # help='',id=wx.ID_ANY, … … 577 584 578 585 def PreviewFile(self,filename): 579 ' confirm we have the right file'586 'utility to confirm we have the right file' 580 587 fp = open(filename,'r') 581 588 rdmsg = u'File '+ filename +u' begins:\n\n' -
trunk/GSASIIobj.py
r4136 r4198 16 16 as provides misc. support routines. 17 17 18 Constraints Tree Item19 ----------------------20 21 18 .. _Constraints_table: 22 19 … … 24 21 single: Constraints object description 25 22 single: Data object descriptions; Constraints 23 24 Constraints Tree Item 25 ---------------------- 26 26 27 27 Constraints are stored in a dict, separated into groups. … … 97 97 :math:`newvar = m_1 \\times var_1 + m_2 \\times var_2 + ...` 98 98 99 Covariance Tree Item100 --------------------101 102 99 .. _Covariance_table: 103 100 … … 105 102 single: Covariance description 106 103 single: Data object descriptions; Covariance 104 105 Covariance Tree Item 106 -------------------- 107 107 108 108 The Covariance tree item has results from the last least-squares run. They … … 140 140 ============= =============== ==================================================== 141 141 142 Phase Tree Items143 ----------------144 145 142 .. _Phase_table: 146 143 … … 148 145 single: Phase object description 149 146 single: Data object descriptions; Phase 147 148 Phase Tree Items 149 ---------------- 150 150 151 151 Phase information is stored in the GSAS-II data tree as children of the … … 297 297 ========== =============== ==================================================== 298 298 299 Rigid Body Objects300 ------------------301 302 299 .. _RBData_table: 303 300 … … 305 302 single: Rigid Body Data description 306 303 single: Data object descriptions; Rigid Body Data 304 305 Rigid Body Objects 306 ------------------ 307 307 308 308 Rigid body descriptions are available for two types of rigid bodies: 'Vector' … … 345 345 ========== =============== ==================================================== 346 346 347 Space Group Objects348 -------------------349 350 347 .. _SGData_table: 351 348 … … 353 350 single: Space Group Data description 354 351 single: Data object descriptions; Space Group Data 352 353 Space Group Objects 354 ------------------- 355 355 356 356 Space groups are interpreted by :func:`GSASIIspc.SpcGroup` … … 416 416 417 417 418 Atom Records419 ------------420 421 418 .. _Atoms_table: 422 419 … … 425 422 single: Data object descriptions; Atoms record 426 423 424 Atom Records 425 ------------ 427 426 428 427 If ``phasedict`` points to the phase information in the data tree, then … … 455 454 ============== ==================================================== 456 455 457 Drawing Atom Records458 --------------------459 460 456 .. _Drawing_atoms_table: 461 457 … … 464 460 single: Data object descriptions; Drawing atoms record 465 461 462 Drawing Atom Records 463 -------------------- 466 464 467 465 If ``phasedict`` points to the phase information in the data tree, then … … 493 491 ============== ==================================================== 494 492 495 Powder Diffraction Tree Items496 -----------------------------497 498 493 .. _Powder_table: 499 494 … … 501 496 single: Powder data object description 502 497 single: Data object descriptions; Powder Data 498 499 Powder Diffraction Tree Items 500 ----------------------------- 503 501 504 502 Every powder diffraction histogram is stored in the GSAS-II data tree … … 627 625 ====================== =============== ==================================================== 628 626 629 Powder Reflection Data Structure630 --------------------------------631 632 627 .. _PowderRefl_table: 633 628 … … 635 630 single: Powder reflection object description 636 631 single: Data object descriptions; Powder Reflections 632 633 Powder Reflection Data Structure 634 -------------------------------- 637 635 638 636 For every phase in a histogram, the ``Reflection Lists`` value is a dict … … 656 654 ========== ==================================================== 657 655 658 Single Crystal Tree Items659 -------------------------660 661 656 .. _Xtal_table: 662 657 … … 664 659 single: Single Crystal data object description 665 660 single: Data object descriptions; Single crystal data 661 662 Single Crystal Tree Items 663 ------------------------- 666 664 667 665 Every single crystal diffraction histogram is stored in the GSAS-II data tree … … 714 712 ====================== =============== ==================================================== 715 713 716 Single Crystal Reflection Data Structure717 ----------------------------------------718 719 714 .. _XtalRefl_table: 720 715 … … 722 717 single: Single Crystal reflection object description 723 718 single: Data object descriptions; Single Crystal Reflections 719 720 Single Crystal Reflection Data Structure 721 ---------------------------------------- 724 722 725 723 For every single crystal a histogram, the ``'Data'`` item contains … … 744 742 ========== ==================================================== 745 743 746 Image Data Structure747 --------------------748 749 744 .. _Image_table: 750 745 … … 752 747 image: Image data object description 753 748 image: Image object descriptions 749 750 Image Data Structure 751 -------------------- 754 752 755 753 Every 2-dimensional image is stored in the GSAS-II data tree … … 871 869 ====================== ====================== ==================================================== 872 870 871 .. _parmDict_table: 872 873 .. index:: 874 single: Parameter dictionary 875 873 876 Parameter Dictionary 874 877 ------------------------- 875 876 .. _parmDict_table:877 878 .. index::879 single: Parameter dictionary880 878 881 879 The parameter dictionary contains all of the variable parameters for the refinement. -
trunk/GSASIIscriptable.py
r4187 r4198 486 486 \ type The background model, e.g. 'chebyschev' 487 487 \ refine The value of the refine flag, boolean 488 \ no. coeffsNumber of coefficients to use, integer488 \ 'no. coeffs' Number of coefficients to use, integer 489 489 \ coeffs List of floats, literal values for background 490 490 \ FixedPoints List of (2-theta, intensity) values for fixed points 491 \ fit fixed pointsIf True, triggers a fit to the fixed points to491 \ 'fit fixed points' If True, triggers a fit to the fixed points to 492 492 be calculated. It is calculated when this key is 493 493 detected, regardless of calls to refine. 494 494 \ peaks Specifies a set of flags for refining 495 495 background peaks as a nested list. There may 496 496 be an item for each defined background peak … … 1814 1814 1815 1815 class G2Project(G2ObjectWrapper): 1816 """Represents an entire GSAS-II project. 1816 """Represents an entire GSAS-II project. The object contains these 1817 class variables: 1818 1819 * G2Project.filename: contains the .gpx filename 1820 * G2Project.names: contains the contents of the project "tree" as a list 1821 of lists. Each top-level entry in the tree is an item in the list. The 1822 name of the top-level item is the first item in the inner list. Children 1823 of that item, if any, are subsequent entries in that list. 1824 * G2Project.data: contains the entire project as a dict. The keys 1825 for the dict are the top-level names in the project tree (initial items 1826 in the G2Project.names inner lists) and each top-level item is stored 1827 as a dict. 1828 1829 * The contents of Top-level entries will be found in the item 1830 named 'data', as an example, ``G2Project.data['Notebook']['data']`` 1831 1832 * The contents of child entries will be found in the item 1833 using the names of the parent and child, for example 1834 ``G2Project.data['Phases']['NaCl']`` 1817 1835 1818 1836 :param str gpxfile: Existing .gpx file to be loaded. If nonexistent, … … 3021 3039 * cycles: the maximum number of cycles (returns int) 3022 3040 * sequential: the histograms used for a sequential refinement as a list 3023 of histogram names or an empty list when in non-sequential mode. 3041 of histogram names or an empty list when in non-sequential mode. 3042 * Reverse Seq: returns True or False. True indicates that fitting of the 3043 sequence of histograms proceeds in reversed order. 3024 3044 * seqCopy: returns True or False. True indicates that results from 3025 3045 each sequential fit are used as the starting point for the next … … 3035 3055 elif control == 'sequential': 3036 3056 return self.data['Controls']['data']['Seq Data'] 3057 elif control == 'Reverse Seq': 3058 return self.data['Controls']['data']['Reverse Seq'] 3037 3059 elif control in self.data['Controls']['data']: 3038 3060 return self.data['Controls']['data'][control] … … 3059 3081 the starting point for the next. After each fit is is set to False. 3060 3082 Ignored for non-sequential fits. 3083 * Reverse Seq: when True, sequential refinement is performed on the 3084 reversed list of histograms. 3061 3085 3062 3086 .. seealso:: … … 3067 3091 elif control == 'seqCopy': 3068 3092 self.data['Controls']['data']['Copy2Next'] = bool(value) 3093 elif control == 'Reverse Seq': 3094 self.data['Controls']['data']['Reverse Seq'] = bool(value) 3069 3095 elif control == 'sequential': 3070 3096 histlist = [] … … 3291 3317 3292 3318 class G2PwdrData(G2ObjectWrapper): 3293 """Wraps a Powder Data Histogram.""" 3319 """Wraps a Powder Data Histogram. 3320 The object contains these class variables: 3321 3322 * G2PwdrData.proj: contains a reference to the :class:`G2Project` 3323 object that contains this histogram 3324 * G2PwdrData.name: contains the name of the histogram 3325 * G2PwdrData.data: contains the histogram's associated data in a dict, 3326 as documented for the :ref:`Powder Diffraction Tree<Powder_table>`. 3327 The actual histogram values are contained in the 'data' dict item, 3328 as documented for Data. 3329 3330 """ 3294 3331 def __init__(self, data, proj, name): 3295 3332 self.data = data … … 3587 3624 return self['data'][0].get('wR') 3588 3625 3626 def _decodeHist(self,hist): 3627 '''Convert a histogram reference to a histogram name string 3628 ''' 3629 if isinstance(hist, G2PwdrData): 3630 return hist.name 3631 elif hist in [h.name for h in self.proj.histograms()]: 3632 return hist 3633 elif type(hist) is int: 3634 return self.proj.histograms()[hist].name 3635 else: 3636 raise G2ScriptException("Invalid histogram reference: "+str(hist)) 3637 3638 def set_background(self, key, value): 3639 '''Set background parameters (this serves a similar function as in 3640 :meth:`set_refinements`, but with a simplified interface). 3641 3642 :param str key: a string that defines the background parameter that will 3643 be changed. Must appear in the table below. 3644 3645 ================= ============== =========================================== 3646 key name type of value meaning of value 3647 ================= ============== =========================================== 3648 fixedHist int, str, reference to a histogram in the current 3649 None or project or None to remove the reference. 3650 G2PwdrData 3651 fixedFileMult float multiplier applied to intensities in 3652 the background histogram where a value 3653 of -1.0 means full subtraction of 3654 the background histogram. 3655 ================= ============== =========================================== 3656 3657 :param value: a value to set the selected background parameter. The meaning 3658 and type for this parameter is listed in the table above. 3659 3660 ''' 3661 bkgPrms, bkgDict = self.data['Background'] 3662 if key == 'fixedHist': 3663 if value is None: 3664 bkgDict['background PWDR'][0] = '' 3665 return 3666 bkgDict['background PWDR'][0] = self._decodeHist(value) 3667 elif key == 'fixedFileMult': 3668 bkgDict['background PWDR'][1] = float(value) 3669 else: 3670 raise ValueError("Invalid key in set_background:", key) 3671 3589 3672 def set_refinements(self, refs): 3590 3673 """Sets the histogram refinement parameter 'key' to the specification 'value'. … … 3918 4001 class G2Phase(G2ObjectWrapper): 3919 4002 """A wrapper object around a given phase. 4003 The object contains these class variables: 4004 4005 * G2Phase.proj: contains a reference to the :class:`G2Project` 4006 object that contains this phase 4007 * G2Phase.name: contains the name of the phase 4008 * G2Phase.data: contains the phases's associated data in a dict, 4009 as documented for the :ref:`Phase Tree items<Phase_table>`. 3920 4010 3921 4011 Author: Jackson O'Donnell (jacksonhodonnell .at. gmail.com) … … 5024 5114 calls to :meth:`G2Project.add_image` or :meth:`G2Project.images`. 5025 5115 Scripts will not use ``G2Image()`` to call :meth:`G2Image.__init__` directly. 5116 The object contains these class variables: 5117 5118 * G2Image.proj: contains a reference to the :class:`G2Project` 5119 object that contains this image 5120 * G2Image.name: contains the name of the image 5121 * G2Image.data: contains the image's associated data in a dict, 5122 as documented for the :ref:`Image Data Structure<Image_table>`. 5026 5123 5027 5124 Example use of G2Image: -
trunk/docs/source/conf.py
r3000 r4198 18 18 #def __getattr__(cls, name): 19 19 # return wx() 20 Menu = Panel = Dialog = CheckBox = Choice = ComboBox = object20 Frame = Menu = Panel = Dialog = CheckBox = Choice = ComboBox = object 21 21 Button = PyValidator = TextCtrl = TreeCtrl = object 22 22 DEFAULT_DIALOG_STYLE = RESIZE_BORDER = CENTRE = OK = CANCEL = True
Note: See TracChangeset
for help on using the changeset viewer.