Changeset 5368
- Timestamp:
- Nov 11, 2022 9:25:48 AM (11 months ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIctrlGUI.py
r5366 r5368 801 801 self._setValue(self.result[self.key]) 802 802 elif self.result is not None: # show formatted result, as Bob wants 803 self.result[self.key] = self.GetValue() 803 804 if not self.invalid: # don't update an invalid expression 804 805 self._setValue(self.result[self.key]) -
trunk/GSASIIplot.py
r5363 r5368 53 53 :func:`PlotLayers` show layer structures as balls & sticks 54 54 :func:`PlotFPAconvolutors` plots the convolutors from Fundamental Parameters 55 :func:'PlotClusterYYZ' plots the result of cluster analysis55 :func:'PlotClusterYYZ' plots the result of cluster analysis 56 56 ============================ =========================================================================== 57 57 -
trunk/nistlat.py
r5364 r5368 20 20 cell reduction matrix terms. 21 21 22 [if used cite:V. L. Karen and A. D. Mighell, NIST Technical Note 1290 (1991),22 Please cite V. L. Karen and A. D. Mighell, NIST Technical Note 1290 (1991), 23 23 https://nvlpubs.nist.gov/nistpubs/Legacy/TN/nbstechnicalnote1290.pdf; 24 24 and V. L. Karen & A. D. Mighell, U.S. Patent 5,235,523, 25 https://patents.google.com/patent/US5235523A/en?oq=5235523 ]26 27 This is still under development; not yet in use. 28 29 Work to come: "Relate two unit cells" 25 https://patents.google.com/patent/US5235523A/en?oq=5235523 if this module 26 is used. 27 28 This will be deployed in GSAS-II after a release of updated binary images. 29 30 30 ''' 31 31 … … 43 43 def showCell(cell,center='P',setting=' ',*ignored): 44 44 '''show unit cell input or output nicely formatted. 45 45 46 :param list cell: six lattice constants as float values; a 7th volume value 46 47 is ignored if present. … … 62 63 def uniqCells(cellList): 63 64 '''remove duplicated cells from a cell output list from :func:`ReduceCell` 65 64 66 :param list cellList: A list of reduced cells where each entry represents a 65 67 reduced cell as (_,cell,_,_,center,...) where cell has six lattice … … 76 78 return uList 77 79 78 def emulateLP(line,fp):80 def _emulateLP(line,fp): 79 81 '''Emulate an antique 132 column line printer, where the first column 80 82 that is printed is used for printer control. '1' starts a new page … … 105 107 :param list cellin: six lattice constants as float values 106 108 :param int mode: 107 0: reduction, 108 1: generate supercells, 109 2: generate subcells 110 3: generate sub- and supercells 109 110 * 0: reduction, 111 * 1: generate supercells, 112 * 2: generate subcells 113 * 3: generate sub- and supercells 114 111 115 :param int deltaV: volume ratios for sub/supercells if mode != 0 as 112 116 ratio of original cell to smallest subcell or largest supercell 113 117 to original cell. Ignored if mode=0. Otherwise should be 2, 3, 4 or 5 114 :param str output: name of file to write the NIST*LATTICE output 115 :returns: a dict with item 'input' with input cell as (cell,center,setting) 116 and 'output' which is a list of reduced cells of form 117 (d,cell,vol,mat,center,setting). In these, 118 cell: is the six cell dimensions; 119 center: is as above (always 'P' on output); 120 setting: is ' ' except for rhombohedral symmetry where it may be R or H for the cell type; 121 d: is the volume ratio for new cell over input cell; 122 vol: is volume of output cell 123 mat: is the matrix that gives the output cell when the input cell is multiplied by mat. 118 :param str output: name of file to write the NIST*LATTICE output. 119 Default is None, which does not produce a file. 120 :returns: a dict with two items, 'input' and 'output'. The value for 121 'input' is the input cell as (cell,center,setting). The value for 122 'output' is a list of reduced cells of form 123 (d,cell,vol,mat,center,setting). In these: 124 125 * cell: a list with the six cell dimensions; 126 * center: is as above (always 'P' on output); 127 * setting: is ' ' except for rhombohedral symmetry where it may be R or H for the cell type; 128 * d: is the volume ratio for new cell over input cell; 129 * vol: is volume of output cell 130 * mat: is the matrix that gives the output cell when the input cell is multiplied by mat. 124 131 ''' 125 132 … … 157 164 linenum += 1 158 165 line = b.decode() 159 emulateLP(line,fp)166 _emulateLP(line,fp) 160 167 pat = r"T 2= (.*)/ (.*)/ (.*)" # transform matrix 161 168 s = re.split(pat,line) … … 187 194 def ConvCell(redcell): 188 195 '''Converts a reduced cell to a conventional cell 196 189 197 :param list redcell: unit cell parameters as 3 cell lengths 190 198 and 3 angles (in degrees) 191 :returns: tuple (cell,center,setting,mat) where 192 cell: has the six cell dimensions for the conventional cell; 193 center: is P/A/B/C/F/I/R; 194 setting: is ' ' except for rhombohedral symmetry (center=R), where 199 :returns: tuple (cell,center,setting,mat) where: 200 201 * cell: has the six cell dimensions for the conventional cell; 202 * center: is P/A/B/C/F/I/R; 203 * setting: is ' ' except for rhombohedral symmetry (center=R), where 195 204 it will always be H (for hexagonal cell choice); 196 mat: is the matrix that gives the conventional cell when the reduced205 * mat: is the matrix that gives the conventional cell when the reduced 197 206 cell is multiplied by mat. 198 207 ''' … … 252 261 Must be 1 <= vrange <= 10 for mode='F' or 253 262 Must be 1 <= vrange <= 40 for mode='I' 254 :param str output: name of file to write the NIST*LATTICE output 255 256 :returns: a list of matrices that match cell1 to cell2 where 257 each entry contains (det, im, m, tol, one2two, two2one) where 258 0: det is the determinant, giving the volume ratio between cells 259 1: im relates the reduced cell for cell1 to the reduced cell for cell2 260 2: m relates the reduced cell for cell2 to the reduced cell for cell1 261 3: tol quality of agreement as six differences between the 262 two reduced cells 263 4: one2two numpy matrix that transforms cell1 to cell2 264 5: two2one numpy matrix that transforms cell2 to cell1 263 :param str output: name of file to write the NIST*LATTICE output. 264 Default is None, which does not produce a file. 265 266 :returns: A list of matrices that match cell1 to cell2 where 267 each entry contains (det, im, m, tol, one2two, two2one) where: 268 269 * det is the determinant, giving the volume ratio between cells 270 * im relates the reduced cell for cell1 to the reduced cell for cell2 271 * m relates the reduced cell for cell2 to the reduced cell for cell1 272 * tol shows the quality of agreement, as six differences between the 273 two reduced cells 274 * one2two: a numpy matrix that transforms cell1 to cell2 275 * two2one: a numpy matrix that transforms cell2 to cell1 265 276 ''' 266 277 # reduce input cells. Save cell, volume and matrix … … 293 304 p.terminate() 294 305 if fp: 295 for line in lines: emulateLP(line,fp)306 for line in lines: _emulateLP(line,fp) 296 307 fp.close() 297 308 lnum = 0 … … 348 359 349 360 def CellSymSearch(cellin, center, tolerance=3*[0.2]+3*[1], mode=0, 350 deltaV=2, minsym=' ',output=None):361 deltaV=2, output=None): 351 362 '''Search for a higher symmetry lattice related to an input unit cell, 352 363 and optionally to the supercells and/or subcells with a specified … … 360 371 & gamma (defaults to [0.2,0.2,0.2,1.,1.,1.] 361 372 :param int mode: 362 0: use only input cell, 363 1: generate supercells, 364 2: generate subcells 365 3: generate sub- and supercells 373 374 * 0: use only input cell, 375 * 1: generate supercells, 376 * 2: generate subcells 377 * 3: generate sub- and supercells 378 366 379 :param int deltaV: volume ratios for sub/supercells if mode != 0 as 367 380 ratio of original cell to smallest subcell or largest supercell 368 381 to original cell. Ignored if mode=0. Otherwise should be 2, 3, 4 or 5 369 :param ? minsym: 370 :param str output: name of file to write the NIST*LATTICE output 371 372 :returns: a list of processed cells (only one if mode=0) where for each cell the 373 the following items are included: conventional input cell; reduced input cell; 374 symmetry-generated conventional cell; symmetry-generated reduced cell; 375 matrix to convert sym-generated output cell to input conventional cell 382 :param str output: name of file to write the NIST*LATTICE output. Default 383 is None, which does not produce a file. 384 385 :returns: a list of processed cells (only one entry in list when mode=0) 386 where for each cell the the following items are included: 387 388 * conventional input cell; 389 * reduced input cell; 390 * symmetry-generated conventional cell; 391 * symmetry-generated reduced cell; 392 * matrix to convert sym-generated output cell to input conventional cell 376 393 ''' 377 394 # setting is non-blank for rhombohedral lattices (center=R) only. … … 406 423 if output: fp = open(output,'w') 407 424 if fp: 408 for line in lines: emulateLP(line,fp)425 for line in lines: _emulateLP(line,fp) 409 426 fp.close() 410 427 lnum = 0
Note: See TracChangeset
for help on using the changeset viewer.