Changeset 4111
- Timestamp:
- Aug 25, 2019 11:06:49 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIImapvars.py
r3788 r4111 1285 1285 def StoreEquivalence(independentVar,dependentList,symGen=True): 1286 1286 '''Takes a list of dependent parameter(s) and stores their 1287 relationship to a single independent parameter (independentVar) 1287 relationship to a single independent parameter (independentVar). 1288 1289 Called with user-supplied constraints by :func:`GSASIIstrIO.ProcessConstraints, 1290 with Pawley constraints from :func:`GSASIIstrIO.GetPawleyConstr`, 1291 with Unit Cell constraints from :func:`GSASIIstrIO.cellVary` 1292 with symmetry-generated atom constraints from :func:`GSASIIstrIO.GetPhaseData` 1288 1293 1289 1294 :param str independentVar: name of master parameter that will be used to determine the value -
trunk/GSASIIstrIO.py
r4047 r4111 1045 1045 ################################################################################ 1046 1046 ##### Phase data 1047 ################################################################################ 1048 1047 ################################################################################ 1049 1048 def GetPhaseData(PhaseData,RestraintDict={},rbIds={},Print=True,pFile=None,seqRef=False): 1050 'needs a doc string' 1049 '''Setup the phase information for a structural refinement, used for 1050 regular and sequential refinements, optionally printing information 1051 to the .lst file (if Print is True) 1052 ''' 1051 1053 1052 1054 def PrintFFtable(FFtable): -
trunk/GSASIIstrMain.py
r4021 r4111 209 209 rbIds = rigidbodyDict.get('RBIds',{'Vector':[],'Residue':[]}) 210 210 rbVary,rbDict = G2stIO.GetRigidBodyModels(rigidbodyDict,pFile=printFile) 211 Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtables,BLtables,MFtables,maxSSwave = \212 G2stIO.GetPhaseData(Phases,restraintDict,rbIds,pFile=printFile)211 (Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtables,BLtables,MFtables, 212 maxSSwave) = G2stIO.GetPhaseData(Phases,restraintDict,rbIds,pFile=printFile) 213 213 calcControls['atomIndx'] = atomIndx 214 214 calcControls['Natoms'] = Natoms … … 237 237 try: 238 238 G2mv.GenerateConstraints(varyList,constrDict,fixedList,parmDict) 239 #print G2mv.VarRemapShow(varyList)240 #print 'DependentVars',G2mv.GetDependentVars()241 #print 'IndependentVars',G2mv.GetIndependentVars()239 #print(G2mv.VarRemapShow(varyList)) 240 #print('DependentVars',G2mv.GetDependentVars()) 241 #print('IndependentVars',G2mv.GetIndependentVars()) 242 242 except G2mv.ConstraintException: 243 243 G2fil.G2Print (' *** ERROR - your constraints are internally inconsistent ***') … … 349 349 rbIds = rigidbodyDict.get('RBIds',{'Vector':[],'Residue':[]}) 350 350 rbVary,rbDict = G2stIO.GetRigidBodyModels(rigidbodyDict,pFile=printFile) 351 Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtables,BLtables,MFtables,maxSSwave = \ 352 G2stIO.GetPhaseData(Phases,restraintDict,rbIds,False,printFile,seqRef=True) 351 G2mv.InitVars() 352 (Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtables,BLtables,MFtables, 353 maxSSwave) = G2stIO.GetPhaseData(Phases,restraintDict,rbIds, 354 Print=False,pFile=printFile,seqRef=True) 353 355 for item in phaseVary: 354 356 if '::A0' in item: … … 375 377 if GSASIIpath.GetConfigValue('Show_timing'): t1 = time.time() 376 378 G2fil.G2Print('\nRefining with '+str(histogram)) 379 G2mv.InitVars() 380 #print('before load',{i:phaseDict[i] for i in phaseDict if 'Ax:2' in i}) 381 (Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup, 382 FFtables,BLtables,MFtables,maxSSwave) = G2stIO.GetPhaseData( 383 Phases,restraintDict,rbIds, 384 Print=False,pFile=printFile,seqRef=True) 385 #print('before fit ',{i:phaseDict[i] for i in phaseDict if 'Ax:2' in i}) 377 386 ifPrint = False 378 387 if dlg: … … 423 432 # do constraint processing 424 433 #reload(G2mv) # debug 425 G2mv.InitVars()426 434 constrDict,fixedList = G2stIO.GetConstraints(GPXfile) 427 435 varyListStart = tuple(varyList) # save the original varyList before dependent vars are removed … … 433 441 # if GSASIIpath.GetConfigValue('debug'): print("DBG_"+ 434 442 # G2mv.VarRemapShow(varyList,True)) 443 # print('DependentVars',G2mv.GetDependentVars()) 444 # print('IndependentVars',G2mv.GetIndependentVars()) 435 445 constraintInfo = (groups,parmlist,constrDict,fixedList,ihst) 436 446 except G2mv.ConstraintException: … … 534 544 # G2fil.G2Print (' ***** Refinement aborted *****') 535 545 # return False,Msg.msg 546 #print('after fit',{i:parmDict[i] for i in parmDict if 'Ax:2' in i}) 536 547 if GSASIIpath.GetConfigValue('Show_timing'): 537 548 t2 = time.time() -
trunk/help/Tutorials.html
r3749 r4111 45 45 </UL><h4>Magnetic Structure Analysis</H4><UL> 46 46 <LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SimpleMagnetic/SimpleMagnetic.htm">Simple Magnetic Structure Analysis</A> 47 [link s: <A href="https://anl.box.com/v/SimpleMagnetic">video</A>,<A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SimpleMagnetic/data">Exercise files</A>].47 [link: <A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SimpleMagnetic/data">Exercise files</A>]. 48 48 <blockquote><I>Analysis of a simple antiferromagnet and a simple ferromagnet from CW neutron powder data</I></blockquote> 49 49 <LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/Magnetic-I/Magnetic Structures-I.htm">Magnetic Structure Analysis-I</A> … … 64 64 </UL><h4>Parametric sequential fitting</H4><UL> 65 65 <LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SeqRefine/SequentialTutorial.htm">Sequential refinement of multiple datasets</A> 66 [link s: <A href="https://anl.box.com/v/SequentialTutorial">video</A>,<A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SeqRefine/data">Exercise files</A>].66 [link: <A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SeqRefine/data">Exercise files</A>]. 67 67 <blockquote><I>This shows the fitting of a structural model to multiple data sets collected as a function of temperature (7-300K). 68 68 This tutorial is the prerequisite for the next one.</I></blockquote> 69 69 <UL><LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SeqParametric/ParametricFitting.htm">Parametric Fitting and Pseudo Variables for Sequential Fits</A> <A href="#prereq">*</A> 70 [ link: <A href="https://anl.box.com/v/ParametricFitting">video</A>, no example data].70 [no example data or video]. 71 71 <blockquote><I>This explores the results of the sequential refinement obtained in the previous tutorial; includes 72 72 plotting of variables and fitting the changes with simple equations.</I></blockquote> 73 73 </UL> 74 74 <LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/TOF Sequential Single Peak Fit/TOF Sequential Single Peak Fit.htm">Sequential fitting of single peaks and strain analysis of result</A> 75 [link s: <A href="https://anl.box.com/v/TOFSequentialSinglePeakFit">video</A>,<A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/TOF Sequential Single Peak Fit/data">Exercise files</A>].75 [link: <A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/TOF Sequential Single Peak Fit/data">Exercise files</A>]. 76 76 <blockquote><I>This shows the fitting of single peaks in a sequence of TOF powder patterns from a sample under load; includes 77 77 fitting of the result to get Hookes Law coefficients for elastic deformations.</I></blockquote> 78 78 </UL><h4>Structure solution</H4><UL> 79 79 <LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/FitPeaks/Fit Peaks.htm">Fitting individual peaks & autoindexing</A> 80 [link s: <A href="https://anl.box.com/v/FitPeaks">video</A>,<A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/FitPeaks/data">Exercise files</A>].80 [link: <A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/FitPeaks/data">Exercise files</A>]. 81 81 <blockquote><I>This covers two examples of selecting individual powder diffraction peaks, fitting them and then 82 82 indexing to determine the crystal lattice and possible space group. This is the prerequisite for the next two tutorials.</I></blockquote> … … 104 104 </UL><h4>Stacking Fault Modeling</H4><UL> 105 105 <LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/StackingFaults-I/Stacking Faults-I.htm">Stacking fault simulations for diamond</A> 106 [ link: <A href="https://anl.box.com/v/StackingFaults-I">video</A>, no example data].106 [no example data or video]. 107 107 <blockquote><I>This shows how to simulate the diffraction patterns from faulted diamond.</I></blockquote> 108 108 <LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/StackingFaults-II/Stacking Faults II.htm">Stacking fault simulations for Keokuk kaolinite</A> … … 114 114 </UL><h4>Powder diffractometer calibration</H4><UL> 115 115 <LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/CWInstDemo/FindProfParamCW.htm">Determining Starting Profile Parameters from a Standard</A> 116 [link s: <A href="https://anl.box.com/v/FindProfParamCW">video</A>,<A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/CWInstDemo/data">Exercise files</A>].116 [link: <A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/CWInstDemo/data">Exercise files</A>]. 117 117 <blockquote><I>This shows how to determine profile parameters by fitting individual peaks 118 118 with data collected on a standard using a lab diffractometer.</I></blockquote> … … 124 124 Input is formulated to use FPA values similar to those in Topas.</I></blockquote> 125 125 <LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/TOF Calibration/Calibration of a TOF powder diffractometer.htm">Calibration of a Neutron TOF diffractometer</A> 126 [link s: <A href="https://anl.box.com/v/CalibrationofaTOFpowderdiffrac">video</A>,<A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/TOF Calibration/data">Exercise files</A>].126 [link: <A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/TOF Calibration/data">Exercise files</A>]. 127 127 <blockquote><I>This uses the fitted positions of all visible peaks in a pattern of NIST SRM 660b La11B6 128 128 (a=4.15689Ã … … 133 133 </UL><h4>2D Image Processing</H4><UL> 134 134 <LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/2DCalibration/Calibration of an area detector in GSAS.htm">Calibration of an area detector</A> 135 [link s: <A href="https://anl.box.com/v/CalibrationofanareadetectorinG">video</A>,<A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/2DCalibration/data">Exercise files</A>].135 [link: <A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/2DCalibration/data">Exercise files</A>]. 136 136 <blockquote><I>A demonstration of calibrating a Perkin-Elmer area detector, where the detector was intentionally tilted at 45 degrees. 137 137 This exercise is the prerequisite for the next one.</I></blockquote> 138 138 <UL><LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/2DIntegration/Integration of area detector data in GSAS.htm">Integration of area detector data</A> <A href="#prereq">*</A> 139 [ link: <A href="https://anl.box.com/v/Integrationofareadetectordatai">video</A>, no example data].139 [no example data or video]. 140 140 <blockquote><I>Integration of the image from a Perkin-Elmer area detector, where the detector was intentionally tilted at 45 degrees.</I></blockquote> 141 141 </UL> 142 142 <LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/2DStrain/Strain fitting of 2D data in GSAS-II.htm">Strain fitting of 2D data</A> 143 [link s: <A href="https://anl.box.com/v/Strainfittingof2DdatainGSAS-II">video</A>,<A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/2DStrain/data">Exercise files</A>].143 [link: <A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/2DStrain/data">Exercise files</A>]. 144 144 <blockquote><I>This show how to determine 3 strain tensor values using the method of He & Smith (Adv. in X-ray Anal. 41, 501, 1997) 145 145 directly froom a sequence of 2D imges from a loaded sample.</I></blockquote> 146 146 <LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/2DTexture/Texture analysis of 2D data in GSAS-II.htm">Texture analysis of 2D data</A> 147 [link s: <A href="https://anl.box.com/v/Textureanalysisof2DdatainGSAS-">video</A>,<A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/2DTexture/data">Exercise files</A>].147 [link: <A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/2DTexture/data">Exercise files</A>]. 148 148 <blockquote><I>This shows 3 different methods for determining texture via spherical harmonics from 2D x-ray diffraction images. </I></blockquote> 149 149 <LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/DeterminingWavelength/DeterminingWavelength.html">Area Detector Calibration with Multiple Distances: Determine Wavelength</A> 150 [link s: <A href="https://anl.box.com/v/DeterminingWavelength">video</A>,<A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/DeterminingWavelength/data">Exercise files</A>].150 [link: <A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/DeterminingWavelength/data">Exercise files</A>]. 151 151 <blockquote><I>To get an accurate wavelength, without knowing the sample-to-detector distance accurately, images recorded with 152 152 several different distances can be used. This exercise shows how to determine the wavelength from such a series. 153 153 This exercise is the prerequisite for the next one.</I></blockquote> 154 154 <UL><LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/CalibrationTutorial/CalibrationTutorial.html">Area Detector Calibration with Multiple Distances: Calibrate Detector Distances</A> <A href="#prereq">*</A> 155 [ link: <A href="https://anl.box.com/v/CalibrationTutorial">video</A>, no example data].155 [no example data or video]. 156 156 <blockquote><I>To get an accurate wavelength, without knowing the sample-to-detector distance accurately, images recorded with 157 157 several different distances can be used. After using the previous exercise to determine the wavelength, … … 161 161 </UL><h4>Small-Angle Scattering</H4><UL> 162 162 <LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SAsize/Small Angle Size Distribution.htm">Small angle x-ray data size distribution (alumina powder)</A> 163 [link s: <A href="https://anl.box.com/v/SmallAngleSizeDistribution">video</A>,<A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SAsize/data">Exercise files</A>].163 [link: <A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SAsize/data">Exercise files</A>]. 164 164 <blockquote><I>This shows how to determine the size distribution of particles using data from a constant 165 165 wavelength synchrotron X-ray USAXS instrument. This is the prerequisite for the next tutorial</I></blockquote> 166 166 <UL><LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SAfit/Fitting Small Angle Scattering Data.htm">Fitting small angle x-ray data (alumina powder)</A> <A href="#prereq">*</A> 167 [link s: <A href="https://anl.box.com/v/FittingSmallAngleScatteringDat">video</A>,<A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SAfit/data">Exercise files</A>].167 [link: <A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SAfit/data">Exercise files</A>]. 168 168 <blockquote><I>This shows how to fit small angle scattering data using data from a constant wavelength synchrotron X-ray USAXS instrument. </I></blockquote> 169 169 </UL> 170 170 <LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SAimages/Small Angle Image Processing.htm">Image Processing of small angle x-ray data</A> 171 [link s: <A href="https://anl.box.com/v/SmallAngleImageProcessing">video</A>,<A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SAimages/data">Exercise files</A>].171 [link: <A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SAimages/data">Exercise files</A>]. 172 172 <blockquote><I>This shows how to reduce 2D SAXS data to create 1D absolute scaled data. </I></blockquote> 173 173 <LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SAseqref/Sequential Refinement of Small Angle Scattering Data.htm">Sequential refinement with small angle scattering data</A> 174 [link s: <A href="https://anl.box.com/v/SequentialRefinementofSmallAng">video</A>,<A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SAseqref/data">Exercise files</A>].174 [link: <A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SAseqref/data">Exercise files</A>]. 175 175 <blockquote><I>This shows how to fit USAXS small angle scattering data for a suite of samples to demonstrate the 176 176 sequential refinement technique in GSAS-II for SASD and demonstrates fitting with a hard sphere structure … … 178 178 </UL><h4>Other</H4><UL> 179 179 <LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/MerohedralTwins/Merohedral twin refinement in GSAS.htm">Merohedral twin refinements</A> 180 [link s: <A href="https://anl.box.com/v/MerohedraltwinrefinementinGSAS">video</A>,<A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/MerohedralTwins/data">Exercise files</A>].180 [link: <A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/MerohedralTwins/data">Exercise files</A>]. 181 181 <blockquote><I>This shows how to use GSAS-II to refine the structure of a few single crystal structures where there is merohedral twinning. </I></blockquote> 182 182 <LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/TOF Single Crystal Refinement/TOF single crystal refinement in GSAS.htm">Single crystal refinement from TOF data</A> … … 202 202 <LI><A href="https://anl.box.com/v/SimTutorial">Simulating Powder Diffraction with GSAS-II</A></LI> 203 203 <LI><A href="https://anl.box.com/v/FitBkgTut">Fitting the Starting Background using Fixed Points</A></LI> 204 <LI><A href="https://anl.box.com/v/SimpleMagnetic">Simple Magnetic Structure Analysis</A></LI>205 <LI><A href="https://anl.box.com/v/SequentialTutorial">Sequential refinement of multiple datasets</A></LI>206 <LI><A href="https://anl.box.com/v/ParametricFitting">Parametric Fitting and Pseudo Variables for Sequential Fits</A></LI>207 <LI><A href="https://anl.box.com/v/TOFSequentialSinglePeakFit">Sequential fitting of single peaks and strain analysis of result</A></LI>208 <LI><A href="https://anl.box.com/v/FitPeaks">Fitting individual peaks & autoindexing</A></LI>209 <LI><A href="https://anl.box.com/v/StackingFaults-I">Stacking fault simulations for diamond</A></LI>210 <LI><A href="https://anl.box.com/v/FindProfParamCW">Determining Starting Profile Parameters from a Standard</A></LI>211 <LI><A href="https://anl.box.com/v/CalibrationofaTOFpowderdiffrac">Calibration of a Neutron TOF diffractometer</A></LI>212 <LI><A href="https://anl.box.com/v/CalibrationofanareadetectorinG">Calibration of an area detector</A></LI>213 <LI><A href="https://anl.box.com/v/Integrationofareadetectordatai">Integration of area detector data</A></LI>214 <LI><A href="https://anl.box.com/v/Strainfittingof2DdatainGSAS-II">Strain fitting of 2D data</A></LI>215 <LI><A href="https://anl.box.com/v/Textureanalysisof2DdatainGSAS-">Texture analysis of 2D data</A></LI>216 <LI><A href="https://anl.box.com/v/DeterminingWavelength">Area Detector Calibration with Multiple Distances: Determine Wavelength</A></LI>217 <LI><A href="https://anl.box.com/v/CalibrationTutorial">Area Detector Calibration with Multiple Distances: Calibrate Detector Distances</A></LI>218 <LI><A href="https://anl.box.com/v/SmallAngleSizeDistribution">Small angle x-ray data size distribution (alumina powder)</A></LI>219 <LI><A href="https://anl.box.com/v/FittingSmallAngleScatteringDat">Fitting small angle x-ray data (alumina powder)</A></LI>220 <LI><A href="https://anl.box.com/v/SmallAngleImageProcessing">Image Processing of small angle x-ray data</A></LI>221 <LI><A href="https://anl.box.com/v/SequentialRefinementofSmallAng">Sequential refinement with small angle scattering data</A></LI>222 <LI><A href="https://anl.box.com/v/MerohedraltwinrefinementinGSAS">Merohedral twin refinements</A></LI>223 204 </UL> 224 205
Note: See TracChangeset
for help on using the changeset viewer.