Ticket #6863 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Refactor LeBailFit

Reported by: Wenduo Zhou Owned by: Wenduo Zhou
Priority: major Milestone: Release 3.0
Component: Diffraction Keywords:
Cc: petersonpf@… Blocked By:
Blocking: #6867 Tester: Peter Peterson

Description (last modified by Wenduo Zhou) (diff)

LeBailFit.cpp has more than 3000 lines. And it supports 3 different functions, all of which are based on an algorithm to calculate peaks' height by Le Bail's method. So it is better to separate the algorithm out, and divide LeBailFit into different Mantid algorithms.

Meanwhile, the present LeBailFit only supports one peak shape, ThermalNeutronBk2BkExpConvPVoigt. So replace the hard coded peak profile function by a general peak profile function.

Attachments

Calibration_ImportInformation.py (2.3 KB) - added by Wenduo Zhou 7 years ago.
t6863_cal.py (9.1 KB) - added by Wenduo Zhou 7 years ago.
t6863_refine.py (9.8 KB) - added by Wenduo Zhou 7 years ago.
t6863_setup.py (329 bytes) - added by Wenduo Zhou 7 years ago.
Calibration_Information.config (5.6 KB) - added by Wenduo Zhou 7 years ago.
bank1instrument.nxs (71.9 KB) - added by Wenduo Zhou 7 years ago.
Lab6BraggPeaks.nxs (35.6 KB) - added by Wenduo Zhou 7 years ago.
PG3_11485-1.dat (480.6 KB) - added by Wenduo Zhou 7 years ago.

Change History

comment:1 Changed 7 years ago by Wenduo Zhou

  • Status changed from new to accepted

comment:2 Changed 7 years ago by Wenduo Zhou

Refactor is started. Refs #6863.

Changeset: a805f8421a2d4d7c1b8abc84100f77847f119dbc

comment:3 Changed 7 years ago by Wenduo Zhou

Check pointing work. Refs #6863.

Changeset: f971f4fe3b5dff260e90991223df731f272f0d34

comment:4 Changed 7 years ago by Wenduo Zhou

Check pointing work. Refs #6863.

Changeset: deb50e2f634525147e715b4c6f61687e0ccdafea

comment:5 Changed 7 years ago by Wenduo Zhou

Checkpointing work. Refs #6863.

Changeset: 3696e63f7ed6295d4cccd334448c547384eeacc5

comment:6 Changed 7 years ago by Wenduo Zhou

Checkpointing work. Refs #6863.

Changeset: 4aaf548146b197e05d3faa36f30ef229456d5845

comment:7 Changed 7 years ago by Wenduo Zhou

Checkpointing work. Refs #6863.

Changeset: 5484299b86738b7c0f8de3067711889cca2e7fdd

comment:8 Changed 7 years ago by Wenduo Zhou

Checkpointing work. Refs #6863.

Changeset: 04f470253cfd470fc23d7301ab1785fbbc268d56

comment:9 Changed 7 years ago by Wenduo Zhou

Checkpointing work. Refs #6863.

Changeset: 1a46f5db064ebb044d97657ed6929b7da66a0f8d

comment:10 Changed 7 years ago by Wenduo Zhou

Checkpointing work. Refs #6863.

Changeset: 0fa1a047aa5a3282d7cefbb5a9dd075cf15115d6

comment:11 Changed 7 years ago by Wenduo Zhou

Checkpointing. Refs #6863.

Changeset: f5ab6eef886d5e9ae08b6a1041f16483bf2f0bc5

comment:12 Changed 7 years ago by Wenduo Zhou

Checkpointing work. Refs #6863.

Changeset: 1a43edf2c37fe592bc1286a7d146046ef6cb71b2

comment:13 Changed 7 years ago by Wenduo Zhou

Checkpointing work. Refs #6863.

Changeset: 7f3ccc811da99468409852a6ebd917b11ef0c405

comment:14 Changed 7 years ago by Wenduo Zhou

Checkpointing work. Refs #6863.

Changeset: 337ed8a20238169fbb98faa8cc5656af675067c4

comment:15 Changed 7 years ago by Wenduo Zhou

Checkpointing work. Refs #6863.

Made ThermalNeutronBk2BkExpConvPVoigt inherit from IPowderDiffPeakFunction.

Changeset: 5e36007f9d9ea5fe6d580560053b10418454d015

comment:16 Changed 7 years ago by Wenduo Zhou

Checkpointing work. Refs #6863.

Changeset: ae65cb8b70d3b50513d7369960b66e3cad991e34

comment:17 Changed 7 years ago by Wenduo Zhou

Checkpointing work. Refs #6863.

Changeset: e31a6c8891bdaa18b997879fd960498324cac3d0

comment:18 Changed 7 years ago by Wenduo Zhou

Checkpointing work. Refs #6863.

Changeset: 691a75e3d4df232bc00ae96f5474b976e2c33ce0

comment:19 Changed 7 years ago by Wenduo Zhou

Checkpointing work. Refs #6863.

  1. Moved some status flags to interface class IPowderDiffPeakFunction.
  2. Fixed some error

Changeset: 107431f49be8f703a457a46d41f85b0933ab93b5

comment:20 Changed 7 years ago by Wenduo Zhou

Enable LeBailFunction to pass unit test. Refs #6863.

Changeset: fa92677805ab4550b753381131f183b81d000232

comment:21 Changed 7 years ago by Wenduo Zhou

Checkpointing work. Refs #6863.

Changeset: 5752fe15367404d3b4454651869324600edca2b8

comment:22 Changed 7 years ago by Wenduo Zhou

Add a constructor to Rfactor. Refs #6863.

Changeset: 6de3eb2fd761b06897de7b337e33becd805df12b

comment:23 Changed 7 years ago by Wenduo Zhou

Cleaned comment inside. Refs #6863.

Changeset: bea11cfe4f0926645038a11f07f7a383e0ebfbdb

comment:24 Changed 7 years ago by Wenduo Zhou

Checkpointing work. Refs #6863.

Changeset: 4c83b35bf7448c8fb8a02f62d3cb4642f9e937fa

comment:25 Changed 7 years ago by Nick Draper

  • Status changed from accepted to assigned

comment:26 Changed 7 years ago by Nick Draper

  • Status changed from assigned to new

comment:27 Changed 7 years ago by Nick Draper

  • Component changed from Mantid to Framework

comment:28 Changed 7 years ago by Wenduo Zhou

  • Status changed from new to inprogress

Enable some unit tests. Refs #6863.

Changeset: 28d933766381e546b57137322d0d4ea34c6d7c3b

comment:29 Changed 7 years ago by Wenduo Zhou

Checkpointing work. Refs #6863.

Changeset: 2ff02137d6cfb8e42785a93710ee67ffb856feee

comment:30 Changed 7 years ago by Wenduo Zhou

Removed some unused block. Refs #6863.

Changeset: f9a7dbb07727fa7799e172ac02c19afdaea47862

comment:31 Changed 7 years ago by Wenduo Zhou

Limited the peak by range. Refs #6863.

Changeset: 972a49a5dc8a145013499b20b5bac82536f7a5f9

comment:32 Changed 7 years ago by Wenduo Zhou

Fixed some unit test. Refs #6863.

Changeset: 684c0cdde5f56f63b85316052d859f5e80052826

comment:33 Changed 7 years ago by Wenduo Zhou

Resolved the conflict. Refs #6863.

Changeset: a2c6e867e6d202ef1e43faf231104ff13ca36946

comment:34 Changed 7 years ago by Wenduo Zhou

Removed some unused code. Refs #6863.

Changeset: f69faf7736cc8b8f10a320b3d3c45e16c65c193c

comment:35 Changed 7 years ago by Wenduo Zhou

Fixed an error. Refs #6863.

Changeset: b23e2c07bd5988d8d44103970f14fa5fb21a35be

comment:36 Changed 7 years ago by Nick Draper

  • Milestone changed from Release 2.6 to Backlog

Moved to backlog at the code freeze for R2.6

comment:37 Changed 7 years ago by Wenduo Zhou

  • Description modified (diff)
  • Milestone changed from Backlog to Release 3.0

comment:38 Changed 7 years ago by Wenduo Zhou

  • Blocking 6867 added

comment:39 Changed 7 years ago by Wenduo Zhou

How to verify

  1. Download all the attached python script and Nexus file;
  2. Run script t6863_setup.py to load all the required files to workspaces in Mantid;
  3. Run script t6863_cal.py to calculate the diffraction pattern by Le Bail method. Plot spectra 1 to 3 in the output MatrixWorkspace to see the result of calculation. The calculated pattern does not match the original data perfectly, but it is not far away either.
  4. Run script t6863_refine.py to refine (Monte Carlo simulation) several profile parameters by Le Bail method. Plot specta 1 to 3 in the output MatrixWorkspace to see the result of refinement. It should be better than that in step 3. There should be 2 output matrix workspaces. They are PG3_11485_MC_2002 and PG3_11485_MC_20000. The first one shows the result of first step refinement. The second one shows that from the second step refinement.
Last edited 7 years ago by Wenduo Zhou (previous) (diff)

Changed 7 years ago by Wenduo Zhou

Changed 7 years ago by Wenduo Zhou

Changed 7 years ago by Wenduo Zhou

Changed 7 years ago by Wenduo Zhou

Changed 7 years ago by Wenduo Zhou

Changed 7 years ago by Wenduo Zhou

Changed 7 years ago by Wenduo Zhou

Changed 7 years ago by Wenduo Zhou

comment:40 Changed 7 years ago by Wenduo Zhou

Make it more robust to read string from table workspace. Refs #6863.

String in table workspace may have unexpected extra spaces if the workspace is loaded from Nexus file. Enable the algorithm to trim the while spaces such that the parameter names read from workspace can match to those defined in peak functions.

Changeset: 30f290c609bbc2ff3a95a9afbaa20c09de2127ef

comment:41 Changed 7 years ago by Wenduo Zhou

Cleaned the code. Refs #6863.

Changeset: 8c05210fb4abba8ab003de7ab8109d423c94c852

comment:42 Changed 7 years ago by Wenduo Zhou

Enable to trim spaces in parameter name. Refs #6863.

Changeset: 490c43062306b688017fbea0726c5bb12b675625

comment:43 Changed 7 years ago by Wenduo Zhou

  • Status changed from inprogress to verify
  • Resolution set to fixed

comment:44 Changed 7 years ago by Peter Peterson

  • Status changed from verify to verifying
  • Tester set to Peter Peterson

comment:45 Changed 7 years ago by Wenduo Zhou

Resolved conflict. Refs #6863.

Changeset: 015ef5b6e1b4e14b22e55046c031b73f375cf7b2

comment:46 Changed 7 years ago by Peter Peterson

Merge remote branch 'origin/feature/6863_refactor_lebailfit'

Conflicts:

Code/Mantid/Framework/CurveFitting/src/LeBailFit.cpp

Re #6863

Changeset: fec15bd6baafa44a5d704713ceecf9ae9968d0ce

comment:47 Changed 7 years ago by Peter Peterson

  • Status changed from verifying to closed

The code is split out, but it is still quite hard to follow.

comment:48 Changed 7 years ago by Wenduo Zhou

Resolved conflict. Refs #6863.

Changeset: 015ef5b6e1b4e14b22e55046c031b73f375cf7b2

comment:49 Changed 7 years ago by Nick Draper

  • Component changed from Framework to Diffraction

comment:50 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 7709

Note: See TracTickets for help on using tickets.