Ticket #7617 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Translator from Fullprof to Mantid for initial fitting param starting value

Reported by: Anders Markvardsen Owned by: Karl Palmen
Priority: major Milestone: Release 3.0
Component: Tools Keywords:
Cc: Blocked By:
Blocking: #8071 Tester: Wenduo Zhou

Description

An algorithm which converts initial fitting parameters

InputFile Compulsory

OutputFile Compulsory

Append true/false default to false

We can only translate gsas values for the fitting functions which we have currently defined in Mantid

http://www.ill.eu/sites/fullprof/

Attachments

Fullprof_GEM_test.irf (2.8 KB) - added by Karl Palmen 7 years ago.
Fullprof file for suggested test
GEM_test.nxs (635.2 KB) - added by Karl Palmen 7 years ago.
A simple GEM file for testing

Change History

comment:1 Changed 7 years ago by Karl Palmen

  • Status changed from new to inprogress

comment:2 Changed 7 years ago by Karl Palmen

Add non-functioning ConvertFullprofToXml algorithm re #7617

I've left some code in it from LoadFullprofResolution, which could be useful. If I end up using a lot of the code without much modification, then it should go in a class for use by both algorithms.

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: f25c76724517463fdc36d142961c794b93b68427

comment:3 Changed 7 years ago by Karl Palmen

Change error message re #7617

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: c09e85f28381f01a9e976bde88d8e615a468668c

comment:4 Changed 7 years ago by Karl Palmen

Correct file properties re #7617

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 168bbbacb618937f143be99287d5b3319f97e5a0

comment:5 Changed 7 years ago by Karl Palmen

Enable LoadFullprofResolution to read a file without a CWL re #7617

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 03bdf2abd3da76842e5f1956fb9e79b2d64c6e86

comment:6 Changed 7 years ago by Karl Palmen

Rename to end in XML instead of Xml re #7617

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 043f6cbbd68bf62ec0ff725f9ee9dd3742c45b8b

comment:7 Changed 7 years ago by Karl Palmen

Correct reference to include file re #7617

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: cc6a2ca2e3ca1ddb5468f779b06c21f61b78a998

comment:8 Changed 7 years ago by Karl Palmen

Use LoadFullprofResolution as child algorithm re #7617

Code to read the table and put it into the output parameter file is still to be written.

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: c60425d3eeaa481df4775607a286739d9b43543c

comment:9 Changed 7 years ago by Karl Palmen

Create parameter file stub re #7617

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: bc2441c0e67cb6d44256e90be4bc2046882fbd2a

comment:10 Changed 7 years ago by Karl Palmen

Use current time as date re #7617

Also remove optional attribute of instrument (hard to determine).

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 8819f68a4aae2752284bd4afd07ce569e79ab559

comment:11 Changed 7 years ago by Karl Palmen

Add empty banks to parameter file re #7617

Also tidied up the child algorithm code with help of Martyn

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: c02bd67c8fe5a59b2cc1a6fd0efe50e871f175ba

comment:12 Changed 7 years ago by Karl Palmen

Make LoadFullprofResolution ignore END of bank line re #7617

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 4045674c51baea6e3751da08dd8a2df66c24c6a6

comment:13 Changed 7 years ago by Karl Palmen

Extend LoadFullprofResolutionTest.h re #7617

Test extended to test the names of parameters I'll use later on.

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 6847cd0268da173b8a704d5332c793e80258192d

comment:14 Changed 7 years ago by Karl Palmen

Improve XML and other changes re #7617

Use component-link format for banks and whole instrument Tidy up includes Prepare for use of table workspace columns.

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 1c17fa2a68a7c6e6390b1350e5b8417c718fbd42

comment:15 Changed 7 years ago by Karl Palmen

Begin work on translation of parameters re #7617

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: b96fed5aba1d2edefbb21ce8d6a7ee249c5e88f3

comment:17 Changed 7 years ago by Karl Palmen

Preparation for getting parameter values re #7617

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 5e9d17067fee54c1a27e31462bb004632c214d76

comment:18 Changed 7 years ago by Karl Palmen

Correct bank numbers when not in numerical sequence re #7617

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 99a5bb2f815db45908d35ca1aa9ab337a6ec954b

comment:19 Changed 7 years ago by Karl Palmen

Complete the whole instrument parameters re #7617

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 59806989dace08adf111178decb08039ec2fcbb8

comment:20 Changed 7 years ago by Karl Palmen

Correct use of std::to_string re #7617

and some other string usage improvements

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: af76a9ac412f80b30ddb2bc918f588b554c634be

comment:21 Changed 7 years ago by Karl Palmen

Remove accidental use of ConvertFullprofToXML:: in .h file re #7617

Windows but not Unix allows this.

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 4480a0982135e699a530e1bba205a73347daf6ec

comment:22 Changed 7 years ago by Karl Palmen

Complete the translation re #7617

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 24fadac4440a617bc2f0d494a9d02a62d9ca3d05

comment:23 Changed 7 years ago by Karl Palmen

Created skeleton unit test re #7617

It now verifies that the algorithm initializes and executes without error and produces an output file in accordance with its outputFile property.

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 83e0b741196fd6752141b3f3d39874bb90b46e72

comment:24 Changed 7 years ago by Karl Palmen

Unit test checks that Output file can be parsed as XML file re #7617

Also some unnecessary includes were removed from the ConvertFullprofToXML.cpp.

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 7704157246cddef19ae62cb111e2fed34f9e133b

comment:25 Changed 7 years ago by Karl Palmen

Add check for child nodes re #7617

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: b311cb249cde035b97e684580bc1c2620105360f

comment:26 Changed 7 years ago by Karl Palmen

Make a start in testing the contents of the output file re #7617

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: f3e6452e43d9c029566c59d9332f21e51e0f57bd

comment:27 Changed 7 years ago by Russell Taylor

comment:28 Changed 7 years ago by Karl Palmen

Test parameters of whole instrument re #7617

The double valued 'eq' still needs testing.

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: afdb3832ca14c7e5bd7c5468c6bb44af45bf8da3

comment:29 Changed 7 years ago by Karl Palmen

Test all except 'eq' attribute re #7617

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: dfcfbc1f9cfc33ad71e174c4cef1b1b574c15a49

comment:30 Changed 7 years ago by Karl Palmen

Begin creating function to test eq value re #7617

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: c2d59071ed32a1c469c7ec1330037d02435184fe

comment:31 Changed 7 years ago by Karl Palmen

Test 'eq' value of parameters re #7617

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 4f421d9a07e3d934390ad8348a48a23cdc1d960e

comment:32 Changed 7 years ago by Karl Palmen

Tidy up code improve comments re #7617

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 80dc1c51efc5e039d346d857004199f211798698

comment:33 Changed 7 years ago by Karl Palmen

Rename 'Bank...' to 'bank...' as for GEM instrument re #7617

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 41d64e2f5d89fea67e9dd6b246a340283348894a

comment:34 Changed 7 years ago by Karl Palmen

Set instrument to GEM re #7617

This is because fitting requires the instrument name to be specified in the parameter file as well as the IDF file. LoadFullprofResolution does not take the instrument name.

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: c93b90a49fc7c155e835e22667ce6a990b456344

comment:35 Changed 7 years ago by Karl Palmen

Put change to "GEM" into unit test re #7617

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: ccae6fe00d99821fe52194f2ccf1ae537f0ce53a

comment:36 Changed 7 years ago by Karl Palmen

Add instrument property and test it re #7617

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: f050bcd760933d61b4298d0a376130b7cfe74fbc

Changed 7 years ago by Karl Palmen

Fullprof file for suggested test

Changed 7 years ago by Karl Palmen

A simple GEM file for testing

comment:37 Changed 7 years ago by Karl Palmen

To test download the fullprof file attached.

Run the ConvertFullprofToXML on this file with instrument='GEM', check that it produces a well formed XML file.

Load a GEM file such as the one attached. Load it again into a second workspace. Run Loadparameter file on one of these two workspaces using the parameter file created by the run of ConvertFullprofToXML.

For each workspace plot the same spectrum. Then for each graph press the fit button on the toolbar clock on the graph to select a peak, choose IkedaCarapenterPV as the peak type then click on the top of the peak selected. Then some red markings should appear around the peak.

Look at the values of the parameters of the function in the Fit Function window. Check that they are different for the two workspaces and that for the workspace that had the parameters loaded the values for Alpha0, Alpha1, Beta0 and Kappa are the same as in the fullprof file allowing for floating point rounding errors.

Also check that the unit test is adequate and so is the wiki.

comment:38 Changed 7 years ago by Karl Palmen

Also the tester can check that the parameter file generated corresponds to the fullprof file as described in http://www.mantidproject.org/CreateIkedaCarpenterParameters .

comment:39 Changed 7 years ago by Karl Palmen

  • Blocking 8071 added

comment:40 Changed 7 years ago by Karl Palmen

The append property is covered by ticket #8071. Do not test for this property.

comment:41 Changed 7 years ago by Karl Palmen

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

comment:42 Changed 7 years ago by Gesner Passos

  • Status changed from verify to verifying
  • Tester set to Gesner Passos

comment:43 Changed 7 years ago by Gesner Passos

  • Status changed from verifying to reopened
  • Resolution fixed deleted

I failed to see the fitting parameters showing the values inside the fullprof file. We will investigate the reason. In the mean time, we discussed some improvements to the code.

comment:44 Changed 7 years ago by Karl Palmen

  • Status changed from reopened to inprogress

comment:45 Changed 7 years ago by Karl Palmen

Make changes recommended by Gesner re #7617

Corrected comments, use ManditoryValidator and use AutoPtr.

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: f21c0173a0995d3e105408a6bc55a376f061ceaf

comment:46 Changed 7 years ago by Karl Palmen

Reduce arguments and improve efficiency re #7617

as suggested by Gesner Passos

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: fc0ea5aaaa0ef422c260d5abafcd353f4ec403d1

comment:47 Changed 7 years ago by Gesner Passos

It turned out that it was my fault that I could not test and I got the result described in comment:43. I tried to get the result described here using the GEM58654. But, I tried in one invalid spectrum. Today, I tried on valid spectrum, and I got the expected result.

So, everything is working fine up to the commit on comment:36.

comment:48 Changed 7 years ago by Karl Palmen

Unit test has been crashing since I made the changes recommended by Gesner.

comment:49 Changed 7 years ago by Karl Palmen

Use AutoPtr in unit test re #7617

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 52c5aa66219726c2c066495f57dc15d12d730aab

comment:50 Changed 7 years ago by Karl Palmen

Fix unit test to cope with validator on instrument name re #7617

Also use AutoPtr in unit test where appropriate.

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 04ac658801996da0a7c5d07c59000abbdd62a9de

comment:51 Changed 7 years ago by Karl Palmen

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

comment:52 Changed 7 years ago by Wenduo Zhou

  • Status changed from verify to verifying
  • Tester changed from Gesner Passos to Wenduo Zhou

comment:53 Changed 7 years ago by Wenduo Zhou

  • Status changed from verifying to closed

Very nice work. We should make it work for other profiles.

comment:54 Changed 7 years ago by Wenduo Zhou

Merge remote-tracking branch 'origin/feature/7617_fullprof_to_xml'

Full changeset: 31a5ed2e56937e602e171c2ae4bd32d697bc794e

comment:55 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 8462

Note: See TracTickets for help on using tickets.