Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use HKL/d values to get better starting parameters for PoldiFitPeaks2D #610

Merged
merged 21 commits into from Apr 21, 2015

Conversation

MichaelWedel
Copy link
Contributor

This fixed #11551.

What has been added
Since this turned out a bit more involved than I first thought, I'm writing this short summary:

  • To refine lattice parameters directly using Fit, a new domain type has been added, it's called LatticeDomain and works like a FunctionDomain1D, except that it's storing V3D-objects instead of doubles.
  • A general function interface for using this domain type has been added (ILatticeFunction), as well as a concrete implementation in CurveFitting. The implementation uses PawleyParameterFunction internally, so that all the unit cell parameter handling is not duplicated.
  • To make all this work with Fit automatically, a LatticeDomainCreator has been added. It can create a LatticeDomain from an IPeaksWorkspace or a table workspace (similar to PawleyFit). Fit uses this new creator if the function can be casted to ILatticeFunction.
  • Because errors are not always available for d-values, a new cost function has been added, it's called CostFuncUnweightedLeastSquares and uses unit weights for all data points. Furthermore it scales the covariance matrix after the fit. With this cost function, some of the NIST problems that Roman pointed out to me (http://www.itl.nist.gov/div898/strd/nls/nls_main.shtml) seem to be give good results. I added a system test implementing three of those tests.

Testing information

  • Code review
  • Make sure all tests pass
  • Documentation for LatticeFunction in Fit functions category (includes usage example).
  • Manual test: You could take the last usage example for PoldiFitPeaks2D, which performs the Pawley fit and change the "InitialCell" property to deviate further from the end result, for example to "5 5 5 90 90 90". This should still give the same result, while before these changes the fit will not converge.
  • Manual test using Fit (requires system test data, file is in the reference results directory):
peaks = LoadIsawPeaks('3132_Orthorhombic_P.integrate')
Fit(Function="name=LatticeFunction,CrystalSystem=Orthorhombic,a=4.7,b=6.1,c=10.4", InputWorkspace=peaks, CostFunction="Unweighted least squares", Ties="ZeroShift=0.0", CreateOutput=True)

The fit should be successfull and the calculated and observed positions should show only small differences (output table).

@MichaelWedel MichaelWedel added Diffraction Issues and pull requests related to diffraction In Progress labels Apr 17, 2015
@MichaelWedel MichaelWedel added this to the Release 3.4 milestone Apr 17, 2015
@mantid-roman mantid-roman self-assigned this Apr 20, 2015
mantid-roman added a commit that referenced this pull request Apr 21, 2015
…hkl_and_d

Use HKL/d values to get better starting parameters for PoldiFitPeaks2D
@mantid-roman mantid-roman merged commit 877e81b into master Apr 21, 2015
@mantid-roman mantid-roman deleted the 11551_refine_lattice_from_hkl_and_d branch April 21, 2015 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Diffraction Issues and pull requests related to diffraction
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants