Ticket #10185 (closed: fixed)

Opened 6 years ago

Last modified 5 years ago

SaveParameterFile output pos and rot location parameters.

Reported by: Harry Jeffery Owned by: Harry Jeffery
Priority: major Milestone: Release 3.3
Component: Framework Keywords:
Cc: anders.markvardsen@… Blocked By:
Blocking: #10260 Tester: Anders Markvardsen

Description (last modified by Anders Markvardsen) (diff)

At present SaveParameterFile, when user select LocationParameters = true, wrongly search the parameter map for parameter names: "x", "y", "z", "r-position", "t-position", "p-position", "rotx", "roty", and "rotz", and save these as the location parameters.

Change this so that SaveParameterFile, when LocationParameters = true, save the pos parameter as "x", "y", "z" and rot parameter as "rotx", "roty", and "rotz".

When saving a pos parameter, check it with the base instrument and only save the “x” and/or “y” and/or “z” if they are different. Do the same for rot.

Output warning to the user if it is found that the parameter map contains any of the parameters: "x", "y", "z", "r-position", "t-position", "p-position", "rotx", "roty", and "rotz" saying something like “blah blah parameter found in parameter map, this should not happen, please contact the Mantid team.”

Please update the document along the lines of : “When LocationParameters = true information about changes to the location of components (e.g. detectors) different from locations defined by the IDF?, are saved as "x", "y", "z", "rotx", "roty", and "rotz" parameters”.

Change History

comment:1 Changed 6 years ago by Nick Draper

This needs a short discussion with Anders, Martyn and I.

comment:2 Changed 6 years ago by Nick Draper

  • Owner set to Nick Draper
  • Cc anders.markvardsen@… added
  • Status changed from new to verify
  • Resolution set to wontfix

Harry,

After discussing this we are going to have to leave this as it is, and perhaps just improve the documentation for SaveInstrumentParameters.

The pos and rot are stored as calcuated vectors (and quaternions) for good performance reasons, and it would be a mistake to store the same information internally in two different ways by keeping the separate component values. Especially as there are other ways to move a component, in C++, Python and Move/RotateInstrumentComponent which would likely fail to maintain both values together.

In this instance the usage of this data on loading and general usage far outweighs the number of times they will be written out to file suing SaveInstrumentComponent. So I think it is better to just add a note to the alg documentation explaining that all of the possible location and rotation tags will be outputted as a single pos and rot parameter.

comment:3 Changed 6 years ago by Anders Markvardsen

  • Status changed from verify to reopened
  • Resolution wontfix deleted

Updated description will follow

comment:4 Changed 6 years ago by Anders Markvardsen

  • Owner changed from Nick Draper to Harry Jeffery

comment:5 Changed 6 years ago by Anders Markvardsen

  • Description modified (diff)
  • Summary changed from Correct handling of location parameters. to SaveParameterFile output pos and rot location parameters.

comment:6 Changed 6 years ago by Harry Jeffery

  • Status changed from reopened to inprogress

comment:7 Changed 6 years ago by Harry Jeffery

Refs #10185 Make SaveParameterFile output pos and rot parameters

Changeset: 0d17032571d5f01b417e24ad61d6b9c42cf32e7c

comment:8 Changed 6 years ago by Harry Jeffery

Refs #10185 Update SaveParameterFile documentation.

Changeset: ce0154784a5bf6db002356a33dd9eff40085714e

comment:9 Changed 6 years ago by Harry Jeffery

Refs #10185 Replace std::tuple with boost::tuple

Changeset: d2b7ecf70ba52ee4515161423dbad9ac12a95150

comment:10 Changed 6 years ago by Harry Jeffery

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

Testing

I've been unable to test that this is behaving correctly myself as I'm unfamiliar with with instruments themselves, so I'm unable to verify if the output is correct.

  • Code review
  • Verify position and rotation parameters are being saved correctly
  • Verify saved parameter file is loaded correctly

comment:11 Changed 6 years ago by Anders Markvardsen

  • Status changed from verify to verifying
  • Tester set to Anders Markvardsen

comment:12 Changed 6 years ago by Harry Jeffery

Refs #10185 Save location of all moved components

Changeset: 7bd198f0ea6596efa4c28a4e1dd9a75dd42ff3c4

comment:13 Changed 6 years ago by Harry Jeffery

Refs #10185 Skip saving inherited location params

Changeset: ba67b415691bd268edb10c6880d9c6712a68d073

comment:14 Changed 6 years ago by Harry Jeffery

7bd198f0 Fixes the issue where only components that already had a non-location parameter would have their location parameters saved. Instead it checks every component in the instrument to see if its position has been changed by a parameter and saves location parameters if needed.

However, with the MAPS00018314.nsx test data, a ~1,600,000 line XML file is produced containing hundreds of thousands of pixels and their location. So ba67b415 attempts to reduce the volume by not saving location parameters for components whose parents have been moved in the same way by a location parameter. i.e. If component A is moved by 3m, all of its children do not need to say that they've been moved by 3m too, as it should be inherited from the movement of component A. This reduces the size of the output to ~630,000 lines.

Why still so many? The detector group that was moved was also rotated slightly so all of its detector pixels have unique translations.

Instead of checking all components' position and rotation for changes it may be better to try and better detect the generic translation and rotation of the entire group, but that will require additional thought.

comment:15 Changed 6 years ago by Harry Jeffery

  • Blocking 10260 added

comment:16 Changed 6 years ago by Anders Markvardsen

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/feature/10185_correct_handling_of_location_params'

Full changeset: 16fbb6da6d4f2b63c001cd8d10a4418df0d44f86

comment:17 Changed 6 years ago by Anders Markvardsen

tested by:

load MAPS00018314.nsx, run saveparaemterfile, run clearparameterfile and run loadparameterfile. Instrument came back as it originally was.

Good with the extra intelligence to reduce output where possible.

comment:18 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 11027

Note: See TracTickets for help on using tickets.