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

Implement LeBail fitting of cubic lattice #6152

Closed
1 task done
wdzhou opened this issue May 10, 2012 · 1 comment
Closed
1 task done

Implement LeBail fitting of cubic lattice #6152

wdzhou opened this issue May 10, 2012 · 1 comment
Assignees
Milestone

Comments

@wdzhou
Copy link
Collaborator

wdzhou commented May 10, 2012

This ticket is blocked by :

Implement LeBail fitting in Mantid. It will support sample of cubic lattice structure in this task.

==== Test Instruction ====
Please run the following script to prepare for Le Bail Fit. The data files can be found in systemtests/data/

# Import data
LoadAscii(Filename='4844b1.inp',OutputWorkspace='4844b1',Unit='TOF')

# Create some table workspaces for staring values
CreateLeBailFitInput(Instrument='NOMAD',ReflectionsFile='LB4844b1.hkl',
   FullprofParameterFile='2011B_HR60b1.irf',LatticeConstant='4.1568899999999998',
   InstrumentParameterWorkspace='Peak4844',BraggPeakParameterWorkspace='HKL4844')

# Fit for background of the diffraction pattern
ProcessBackground(InputWorkspace='4844b1',OutputWorkspace='4844b1_bkgd',
    Options='SelectBackgroundPoints',LowerBound='5053',UpperBound='49387',
    BackgroundType='Chebyshev',
    BackgroundPoints='5000,6500,8951,10670,15231,16943,24887,33527,40200,45110,49725',
    NoiseTolerance='20')

Fit(Function='name=Polynomial,n=6,A0=0,A1=0,A2=0,A3=0,A4=0,A5=0,A6=0',
    InputWorkspace='4844b1_bkgd',MaxIterations='1000',
    Minimizer='Levenberg-MarquardtMD',
    CreateOutput='1',Output='4844b_polybkgd',
    StartX='2277.27',EndX='49988.900000000001')

# Calculate peak heights with Le Bail algorithm
LeBailFit(InputWorkspace='4844b1',OutputWorkspace='4844b1_cal',
    InputParameterWorkspace='Peak4844',OutputParameterWorkspace='Temp1',
    InputHKLWorkspace='HKL4844',OutputPeaksWorkspace='Temp2',Function='Calculation',
    BackgroundFunctionOrder='6',BackgroundParametersWorkspace='4844b_polybkgd_Parameters',
    UseInputPeakHeights='0',PeakRadius='8')

The input instrument resolution file already contains well-fitted data. Thus for testing purpose, some parameter value can be shifted.

# Fix all the parameters
UpdatePeakParameterTableValue(InputWorkspace='Peak4844',Column='FitOrTie',NewStringValue='t')
# Change value of Alph1
UpdatePeakParameterTableValue(InputWorkspace='Peak4844',ParameterNames='Alph1',NewFloatValue='6')
# Flag Alph1 to be fit
UpdatePeakParameterTableValue(InputWorkspace='Peak4844',Column='FitOrTie',ParameterNames='Alph1',NewStringValue='f')

Then LeBailFit() can be called as

LeBailFit(InputWorkspace='4844b1',OutputWorkspace='4844b1_fitalph1',InputParameterWorkspace='Peak4844',OutputParameterWorkspace='Peak4844X',InputHKLWorkspace='HKL4844',OutputPeaksWorkspace='HKL4844X',BackgroundFunctionOrder='6',BackgroundParametersWorkspace='4844b_polybkgd_Parameters',UseInputPeakHeights='0',PeakRadius='8',Minimizer='SteepestDescent')
@wdzhou
Copy link
Collaborator Author

wdzhou commented Jun 3, 2015

This issue was originally trac ticket 5306

@wdzhou wdzhou added the Mantid label Jun 3, 2015
@wdzhou wdzhou self-assigned this Jun 3, 2015
@wdzhou wdzhou added this to the Release 2.3 milestone Jun 3, 2015
@wdzhou wdzhou closed this as completed Jun 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant