Ticket #9232 (closed: fixed)
New algorithm SaveParameterFile
Reported by: | Anders Markvardsen | Owned by: | Harry Jeffery |
---|---|---|---|
Priority: | critical | Milestone: | Release 3.3 |
Component: | Framework | Keywords: | student |
Cc: | Blocked By: | ||
Blocking: | #9103 | Tester: | Anders Markvardsen |
Description
Save the parameters in a workspace parameter map to .xml parameter file.
Algorithm must include an option to save with and without 'calibration' paramters, that is any of the parameters that may have been used to move a component away from its base position, according to http://www.mantidproject.org/IDF#Using_.3Cparameter.3E these are:
- "x", "y", and "z" overwrite the x, y and z coordinate respectively of the <location> element of the component the <parameter> is a sub-element of.
- "r-position", "t-position" and "p-position" like "x", "y" and "z" overwrite the x, y, z coordinates but specified using spherical coordinates (as defined ). Note that the parameters "t-position" and "p-position" are ignored if the parameter "r-position" is not also set for the same component. If only "r-position" is set, say to r-position="10.0", than the component will be set to (x,y,z)=(0,0,10.0) i.e. theta and phi default to zero where not specified.
As a suggestion call this boolean paramter SaveLocationParameters and have it to default to true.
Otherwise the algorithm that as input a matrixworkspace and outputs a file.
I have put is as critical because this is a first important step to make instrument parameter more visible to users (and us developers!)
Change History
comment:4 Changed 6 years ago by Nick Draper
- Owner changed from Anders Markvardsen to Anyone
- Keywords student added
comment:8 Changed 6 years ago by Harry Jeffery
Implemented SaveParameterFile algorithm as a stub.
Refs #9232
Changeset: cca9d49c2f12b93dc8332199004b535bf598639b
comment:9 Changed 6 years ago by Harry Jeffery
Implement SaveParameterFile Refs #9232
Changeset: 7167c97043257c3b4ba0b4c0536d8c5f15b081de
comment:10 Changed 6 years ago by Harry Jeffery
Added documentation for SaveParameterFile.
Refs #9232
Changeset: 78331dd9709eb391bede8a00eecc2685e705082e
comment:11 Changed 6 years ago by Harry Jeffery
Fix cppcheck warning. Refs #9232
Changeset: a8565656b62cc95abb8fa59dc017bf96bbacc153
comment:12 Changed 6 years ago by Harry Jeffery
Move SaveParameterFile algorithm to correct dir.
Refs #9232
Changeset: a2c2b9c1111645c16cf6a26ba1dfd1f3ada88253
comment:13 Changed 6 years ago by Harry Jeffery
Fixed namespaces in SaveParameterFile. Refs #9232
Changeset: 36b9e888ab51da06172b2061a1b4ff81b0206453
comment:14 Changed 6 years ago by Harry Jeffery
Create unit test for SaveParameterFile algorithm.
Refs #9232
Changeset: 168b4bc60d2047170e454f8254130316ac860eab
comment:15 Changed 6 years ago by Harry Jeffery
- Status changed from inprogress to verify
- Resolution set to fixed
Testing
- Load some data that has an instrument defined and some parameters (most qualify).
- Run SaveParameterFile, with a filename of your choice and SaveLocationParameters disabled.
- Confirm that the XML file produced is compliant with the schema defined in Code/Mantid/instrument/Schema/ParameterFileSchema.xsd.
- On Ubuntu 14.04 xmllint can be used.
- On other platforms you can improvise.
apt-get install libxml2-utils xmllint --noout \ --schema /path/to/Code/Mantid/instrument/Schema/ParameterFileSchema.xsd \ /path/to/the/parameter/file.xml
- Read the XML file produced yourself, to sanity check it.
- Confirm that the XML file produced can be loaded with LoadParameterFile.
- Test SaveLocationParameters
- To test it, set some location parameters such as:
- "x", "y" and "z"
- "r-position", "t-position" and "p-position"
- "rotx", "roty" and "rotz"
- Confirm that the location parameters are only saved when SaveLocationParameters is enabled.
- To test it, set some location parameters such as:
comment:16 Changed 6 years ago by Anders Markvardsen
- Status changed from verify to verifying
- Tester set to Anders Markvardsen
comment:17 Changed 6 years ago by Harry Jeffery
Improved documentation for SaveParameterFile
Refs #9232
Changeset: 0311ff372e8c4ad79196fcafe9c732881010583c
comment:18 Changed 6 years ago by Harry Jeffery
- Status changed from verifying to reopened
- Resolution fixed deleted
comment:19 Changed 6 years ago by Harry Jeffery
- Status changed from reopened to verify
- Resolution set to fixed
comment:21 Changed 6 years ago by Anders Markvardsen
- Status changed from verifying to reopened
- Resolution fixed deleted
Note need the checkbuild step before ticket can be tested:
ERROR: Branch 'feature/9232_new_algorithm_saveparameterfile' has not been fully merged to develop, meaning it is not possible to know whether the code is valid on all environments .
Contact Harry Jeffery on henry.jeffery@… (or via skype) and ask them to
merge the code
to develop using 'git checkbuild' from their branch feature/9232_new_algorithm_s aveparameterfile and let you know when it passes testing on the buildservers so you can start testing.
comment:22 Changed 6 years ago by Harry Jeffery
Checkbuild completed.
comment:23 Changed 6 years ago by Harry Jeffery
- Status changed from reopened to verify
- Resolution set to fixed
comment:25 Changed 6 years ago by Anders Markvardsen
- Status changed from verifying to closed
Merge remote-tracking branch 'origin/feature/9232_new_algorithm_saveparameterfile'
Full changeset: 8987bfee59a223a6a2a0389433870661d9356325
comment:26 Changed 6 years ago by Anders Markvardsen
Tested by saving mari workspace, loading it, saving it modified, and loading it modified. The algorithm is doing what it says on the tin.
comment:27 Changed 5 years ago by Stuart Campbell
This ticket has been transferred to github issue 10075
As a bonus item, make sure that this will have enough functionality to replace the function SCDCalibratePanels::saveXmlFile in SCDCalibratePanels.