Changeset 4111


Ignore:
Timestamp:
Aug 25, 2019 11:06:49 PM (4 years ago)
Author:
toby
Message:

move GetPhaseData? inside histogram loop so sym constraints are generated in SeqRef?

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImapvars.py

    r3788 r4111  
    12851285def StoreEquivalence(independentVar,dependentList,symGen=True):
    12861286    '''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`
    12881293
    12891294    :param str independentVar: name of master parameter that will be used to determine the value
  • trunk/GSASIIstrIO.py

    r4047 r4111  
    10451045################################################################################
    10461046##### Phase data
    1047 ################################################################################       
    1048                    
     1047################################################################################                   
    10491048def 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    '''
    10511053           
    10521054    def PrintFFtable(FFtable):
  • trunk/GSASIIstrMain.py

    r4021 r4111  
    209209    rbIds = rigidbodyDict.get('RBIds',{'Vector':[],'Residue':[]})
    210210    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)
    213213    calcControls['atomIndx'] = atomIndx
    214214    calcControls['Natoms'] = Natoms
     
    237237    try:
    238238        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())
    242242    except G2mv.ConstraintException:
    243243        G2fil.G2Print (' *** ERROR - your constraints are internally inconsistent ***')
     
    349349    rbIds = rigidbodyDict.get('RBIds',{'Vector':[],'Residue':[]})
    350350    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)
    353355    for item in phaseVary:
    354356        if '::A0' in item:
     
    375377        if GSASIIpath.GetConfigValue('Show_timing'): t1 = time.time()
    376378        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})
    377386        ifPrint = False
    378387        if dlg:
     
    423432        # do constraint processing
    424433        #reload(G2mv) # debug
    425         G2mv.InitVars()
    426434        constrDict,fixedList = G2stIO.GetConstraints(GPXfile)
    427435        varyListStart = tuple(varyList) # save the original varyList before dependent vars are removed
     
    433441#            if GSASIIpath.GetConfigValue('debug'): print("DBG_"+
    434442#                G2mv.VarRemapShow(varyList,True))
     443#            print('DependentVars',G2mv.GetDependentVars())
     444#            print('IndependentVars',G2mv.GetIndependentVars())
    435445            constraintInfo = (groups,parmlist,constrDict,fixedList,ihst)
    436446        except G2mv.ConstraintException:
     
    534544#            G2fil.G2Print (' ***** Refinement aborted *****')
    535545#            return False,Msg.msg
     546        #print('after fit',{i:parmDict[i] for i in parmDict if 'Ax:2' in i})
    536547        if GSASIIpath.GetConfigValue('Show_timing'):
    537548            t2 = time.time()
  • trunk/help/Tutorials.html

    r3749 r4111  
    4545</UL><h4>Magnetic Structure Analysis</H4><UL>
    4646<LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SimpleMagnetic/SimpleMagnetic.htm">Simple Magnetic Structure Analysis</A>
    47  [links: <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>].
    4848<blockquote><I>Analysis of a simple antiferromagnet and a simple ferromagnet from CW neutron powder data</I></blockquote>
    4949<LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/Magnetic-I/Magnetic Structures-I.htm">Magnetic Structure Analysis-I</A>
     
    6464</UL><h4>Parametric sequential fitting</H4><UL>
    6565<LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SeqRefine/SequentialTutorial.htm">Sequential refinement of multiple datasets</A>
    66  [links: <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>].
    6767<blockquote><I>This shows the fitting of a structural model to multiple data sets collected as a function of temperature (7-300K).
    6868     This tutorial is the prerequisite for the next one.</I></blockquote>
    6969<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].
    7171<blockquote><I>This explores the results of the sequential refinement obtained in the previous tutorial; includes
    7272     plotting of variables and fitting the changes with simple equations.</I></blockquote>
    7373</UL>
    7474<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  [links: <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>].
    7676<blockquote><I>This shows the fitting of single peaks in a sequence of TOF powder patterns from a sample under load; includes
    7777      fitting of the result to get Hookes Law coefficients for elastic deformations.</I></blockquote>
    7878</UL><h4>Structure solution</H4><UL>
    7979<LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/FitPeaks/Fit Peaks.htm">Fitting individual peaks & autoindexing</A>
    80  [links: <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>].
    8181<blockquote><I>This covers two examples of selecting individual powder diffraction peaks, fitting them and then
    8282     indexing to determine the crystal lattice and possible space group. This is the prerequisite for the next two tutorials.</I></blockquote>
     
    104104</UL><h4>Stacking Fault Modeling</H4><UL>
    105105<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].
    107107<blockquote><I>This shows how to simulate the diffraction patterns from faulted diamond.</I></blockquote>
    108108<LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/StackingFaults-II/Stacking Faults II.htm">Stacking fault simulations for Keokuk kaolinite</A>
     
    114114</UL><h4>Powder diffractometer calibration</H4><UL>
    115115<LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/CWInstDemo/FindProfParamCW.htm">Determining Starting Profile Parameters from a Standard</A>
    116  [links: <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>].
    117117<blockquote><I>This shows how to determine profile parameters by fitting individual peaks
    118118        with data collected on a standard using a lab diffractometer.</I></blockquote>
     
    124124     Input is formulated to use FPA values similar to those in Topas.</I></blockquote>
    125125<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  [links: <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>].
    127127<blockquote><I>This uses the fitted positions of all visible peaks in a pattern of NIST SRM 660b La11B6
    128128     (a=4.15689Ã
     
    133133</UL><h4>2D Image Processing</H4><UL>
    134134<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  [links: <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>].
    136136<blockquote><I>A demonstration of calibrating a Perkin-Elmer area detector,  where the detector was intentionally tilted at 45 degrees.
    137137     This exercise is the prerequisite for the next one.</I></blockquote>
    138138<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].
    140140<blockquote><I>Integration of the image from a Perkin-Elmer area detector, where the detector was intentionally tilted at 45 degrees.</I></blockquote>
    141141</UL>
    142142<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  [links: <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>].
    144144<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)
    145145     directly froom a sequence of 2D imges from a loaded sample.</I></blockquote>
    146146<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  [links: <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>].
    148148<blockquote><I>This shows 3 different methods for determining texture via spherical harmonics from 2D x-ray diffraction images. </I></blockquote>
    149149<LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/DeterminingWavelength/DeterminingWavelength.html">Area Detector Calibration with Multiple Distances: Determine Wavelength</A>
    150  [links: <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>].
    151151<blockquote><I>To get an accurate wavelength, without knowing the sample-to-detector distance accurately, images recorded with
    152152     several different distances can be used. This exercise shows how to determine the wavelength from such a series.
    153153     This exercise is the prerequisite for the next one.</I></blockquote>
    154154<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].
    156156<blockquote><I>To get an accurate wavelength, without knowing the sample-to-detector distance accurately, images recorded with
    157157     several different distances can be used. After using the previous exercise to determine the wavelength,
     
    161161</UL><h4>Small-Angle Scattering</H4><UL>
    162162<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  [links: <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>].
    164164<blockquote><I>This shows how to determine the size distribution of particles using data from a constant
    165165     wavelength synchrotron X-ray USAXS instrument. This is the prerequisite for the next tutorial</I></blockquote>
    166166<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  [links: <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>].
    168168<blockquote><I>This shows how to fit small angle scattering data using data from a constant wavelength synchrotron X-ray USAXS instrument. </I></blockquote>
    169169</UL>
    170170<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  [links: <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>].
    172172<blockquote><I>This shows how to  reduce 2D SAXS data to create 1D absolute scaled data. </I></blockquote>
    173173<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  [links: <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>].
    175175<blockquote><I>This shows how to fit USAXS small angle scattering data for a suite of samples to demonstrate the
    176176     sequential refinement technique in GSAS-II for SASD and demonstrates fitting with a hard sphere structure
     
    178178</UL><h4>Other</H4><UL>
    179179<LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/MerohedralTwins/Merohedral twin refinement in GSAS.htm">Merohedral twin refinements</A>
    180  [links: <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>].
    181181<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>
    182182<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>
     
    202202<LI><A href="https://anl.box.com/v/SimTutorial">Simulating Powder Diffraction with GSAS-II</A></LI>
    203203<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>
    223204</UL>
    224205
Note: See TracChangeset for help on using the changeset viewer.