Changeset 3090 for trunk/GSASIIscriptable.py
- Timestamp:
- Sep 19, 2017 3:12:12 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIscriptable.py
r3085 r3090 42 42 -------------------- 43 43 44 This table describes the dictionaries supplied to :func:`~G2PwdrData.set_refinement `45 and :func:`~G2PwdrData.clear_refinement `.44 This table describes the dictionaries supplied to :func:`~G2PwdrData.set_refinements` 45 and :func:`~G2PwdrData.clear_refinements`. 46 46 47 47 .. tabularcolumns:: |l|p| … … 89 89 ---------------- 90 90 91 This table describes the dictionaries supplied to :func:`~G2Phase.set_refinement` 92 and :func:`~G2Phase.clear_refinement`. 93 91 This table describes the dictionaries supplied to :func:`~G2Phase.set_refinements` 92 and :func:`~G2Phase.clear_refinements`. 93 94 ===================== ==================== 95 key explanation 96 ===================== ==================== 97 Cell Whether or not to refine the unit cell. 98 Atoms Dictionary of atoms and refinement flags. 99 Each key should be an atom label, e.g. 100 'O3', 'Mn5', and each value should be 101 a string defining what values to refine. 102 Values can be any combination of 'F' 103 for fractional occupancy, 'X' for position, 104 and 'U' for Debye-Waller factor 105 LeBail Enables LeBail intensity extraction. 106 ===================== ==================== 94 107 95 108 .. _HAP_parameters_table: … … 99 112 ------------------------------ 100 113 101 This table describes the dictionaries supplied to :func:`~G2Phase.set_HAP_refinement` 102 and :func:`~G2Phase.clear_HAP_refinement`. 103 114 This table describes the dictionaries supplied to :func:`~G2Phase.set_HAP_refinements` 115 and :func:`~G2Phase.clear_HAP_refinements`. 116 117 ===================== ===================== ==================== 118 key subkey explanation 119 ===================== ===================== ==================== 120 Babinet Should be a **list** of the following 121 subkeys. If not, assumes both 122 BabA and BabU 123 \ BabA 124 \ BabU 125 Extinction Should be boolean, whether or not to 126 refine. 127 HStrain Should be boolean, whether or not to 128 refine. 129 Mustrain 130 \ type Mustrain model. One of 'isotropic', 131 'uniaxial', or 'generalized' 132 \ direction For uniaxial. A list of three integers, 133 the [hkl] direction of the axis. 134 \ refine Usually boolean, whether or not to refine. 135 When in doubt, set it to true. 136 For uniaxial model, can specify list 137 of 'axial' or 'equatorial'. If boolean 138 given sets both axial and equatorial. 139 Pref.Ori. Boolean, whether to refine 140 Show Boolean, whether to refine 141 Size Not implemented 142 Use Boolean, whether to refine 143 Scale Boolean, whether to refine 144 ===================== ===================== ==================== 104 145 105 146 ============================ … … 1817 1858 for key, value in refs.items(): 1818 1859 if key == "Cell": 1819 self.data['General']['Cell'][0] = True 1860 self.data['General']['Cell'][0] = value 1861 1820 1862 elif key == "Atoms": 1821 cx, ct, cs, cia = self.data['General']['AtomPtrs']1822 1823 1863 for atomlabel, atomrefinement in value.items(): 1824 1864 if atomlabel == 'all': … … 1830 1870 raise ValueError("No such atom: " + atomlabel) 1831 1871 atom.refinement_flags = atomrefinement 1872 1832 1873 elif key == "LeBail": 1833 1874 hists = self.data['Histograms'] 1834 1875 for hname, hoptions in hists.items(): 1835 1876 if 'LeBail' not in hoptions: 1836 hoptions['newLeBail'] = True1877 hoptions['newLeBail'] = bool(True) 1837 1878 hoptions['LeBail'] = bool(value) 1838 1879 else: … … 1894 1935 elif key == 'Extinction': 1895 1936 for h in histograms: 1896 h['Extinction'][1] = True1937 h['Extinction'][1] = bool(val) 1897 1938 elif key == 'HStrain': 1898 1939 for h in histograms: 1899 hist['HStrain'][1] = [ Truefor p in hist['Hstrain'][0]]1940 hist['HStrain'][1] = [bool(val) for p in hist['Hstrain'][0]] 1900 1941 elif key == 'Mustrain': 1901 1942 for h in histograms: … … 1921 1962 if isinstance(types, (unicode, str)): 1922 1963 types = [types] 1964 elif isinstance(types, bool): 1965 mustrain[2][0] = types 1966 mustrain[2][1] = types 1967 types = [] 1968 else: 1969 raise ValueError("Not sure what to do with: " 1970 + str(types)) 1923 1971 else: 1924 1972 types = [] … … 1942 1990 elif key == 'Pref.Ori.': 1943 1991 for h in histograms: 1944 h['Pref.Ori.'][2] = True1992 h['Pref.Ori.'][2] = bool(val) 1945 1993 elif key == 'Show': 1946 1994 for h in histograms: 1947 h['Show'] = True1995 h['Show'] = bool(val) 1948 1996 elif key == 'Size': 1997 # TODO 1949 1998 raise NotImplementedError() 1950 1999 elif key == 'Use': 1951 2000 for h in histograms: 1952 h['Use'] = True2001 h['Use'] = bool(val) 1953 2002 elif key == 'Scale': 1954 2003 for h in histograms: 1955 h['Scale'][1] = False2004 h['Scale'][1] = bool(val) 1956 2005 1957 2006 def clear_HAP_refinements(self, refs, histograms='all'):
Note: See TracChangeset
for help on using the changeset viewer.