Ticket #4572 (closed: fixed)

Opened 9 years ago

Last modified 5 years ago

CovertMatrixtoMD algorithm

Reported by: Nick Draper Owned by: Alex Buts
Priority: blocker Milestone: Release 2.0
Component: Mantid Keywords:
Cc: martyn.gigg@… Blocked By:
Blocking: Tester: Janik Zikovsky

Description

Write an algorithm that will copy a matrix workspace to a 2 dimensional MD workspace. No unit or axis conversion is required.

The aim of this is to allow workspaces from SOFQW2 to be viewed in the sliceviewer, but it would be nice if it worked for any 2D workspace if possible.

Change History

comment:1 Changed 9 years ago by Alex Buts

  • Status changed from new to accepted

comment:2 Changed 9 years ago by Alex Buts

refs #4572 changes to default values caused by bug ref #4590

Allows to use algorithm from GUI until the bug is fixed.

Changeset: 089842d0f704cd32062709ea618a917b0171aa58

comment:3 Changed 9 years ago by Alex Buts

refs #4572 Changed Box-controller validators to accept values from 1

apparently this is needed for correct box controller operations.

Changeset: d0c178ef3617752a40771e8291ec68501d6e96d7

comment:4 Changed 9 years ago by Alex Buts

refs #4572 This fixes it

Though ConvertToMDEvents was copying data to target ws before, some processed ws which did not have detector information attached to it were empty as no spectra-det map was present (equal to empty spectra-det map)

Solved by generating fake 1:1 spectra detector map to fake detectors (which were and are not used)

Couple more tests are needed to validate the code

Changeset: 6ea40c2fd55900065cbe205e64b6e1aa168f27c9

comment:5 Changed 9 years ago by Alex Buts

refs #4572 Some unit tests for new behavior.

checks if the detector lost info propagates properly.

Changeset: 0e8f47f7b2088ed3d9985f3344f5a62a47fc7d97

comment:6 Changed 9 years ago by Alex Buts

COnvertToMDEvents has the requested behaviour. Simple python script below illustrates this, though seeing bigger input workspace (e.g. converted to energy MARI) is more persuasive.

Should work for any 2D matrix or Event ws too.

Load(Filename='IRS26173_ipg.nxs',OutputWorkspace='IRI_ipg') SofQW2(InputWorkspace='IRI_ipg',OutputWorkspace='IRI',QAxisBinning='0.5,0.25,2',EMode='Indirect',EFixed='1.8400000000000001') ConvertToMDEvents(InputWorkspace='IRI',OutputWorkspace='MD_IRI',QDimensions="",dEAnalysisMode="",MinValues='0,-1',MaxValues='2,2',SplitInto="200,200") plotSlice("MD_IRI", xydim=["Q1","Q2"], slicepoint=[0,0] )

comment:7 Changed 9 years ago by Alex Buts

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

comment:8 Changed 9 years ago by Alex Buts

refs #4572 Minor changes to comments

Changeset: 729a63770120dc12adf36c962a9f37d3daf7991a

comment:9 Changed 9 years ago by Janik Zikovsky

  • Status changed from verify to verifying
  • Tester set to Janik Zikovsky

comment:10 Changed 9 years ago by Janik Zikovsky

  • Status changed from verifying to closed

OK this works as described above for the result of SofQW2. However, going to a MDEventWorkspace causes some issues when rebinning later (Jon Taylor raised these).

A better solution will be addressed in ticket #4666 and #4665.

comment:11 Changed 9 years ago by Janik Zikovsky

  • Status changed from closed to reopened
  • Resolution fixed deleted

I missed one issue: the dimensions in the output MD workspace have no names, units or IDs. This needs to be fixed for this iteration.

comment:12 Changed 9 years ago by Alex Buts

refs #4572 Creates dimID-s if they have not been copied

from source workspace (appears empty)

Changeset: c269ce50ddf372c84c48c825a815fdb83e661796

comment:13 Changed 9 years ago by Alex Buts

refs #4572 Created default dimID if input are empty

If input ws provides empty dim ID-s the algorithm creates default dimID-s (Dim0,Dim1, etc) Dim-names should be copied from source workspace.

Changeset: a0d786270e5b5c6b44877afce349c1d8195e82b6

comment:14 Changed 9 years ago by Alex Buts

  • Cc martyn.gigg@… added

ideally algorithm should copy dimNames and dim ID-s from input workspace axis. It is what it is hopefully doing with dim-names. No ID-s specified.

I've added small piece of code, which should generate default dimension's ID (Dim0, Dim1 etc) if neither ID nor dim-names are present along axis of input ws.

Ideally, SofQ should copy names and Id=s from axis of the source ws -- something to Martin to look at if he deals with SofQ

Last edited 9 years ago by Alex Buts (previous) (diff)

comment:15 Changed 9 years ago by Alex Buts

  • Status changed from reopened to accepted

comment:16 Changed 9 years ago by Alex Buts

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

comment:17 Changed 9 years ago by Janik Zikovsky

  • Status changed from verify to verifying

comment:18 Changed 9 years ago by Janik Zikovsky

  • Status changed from verifying to reopened
  • Resolution fixed deleted

Can we get the dimension name to be the same as the ID in the case of the default Dim0 etc.?

comment:19 Changed 9 years ago by Alex Buts

refs #4572 DimName=DimID if DimName is initially empty

Changeset: 31ce5ea84fa49d66bdeabc4099c35f98ff8ed9c0

comment:20 Changed 9 years ago by Alex Buts

refs #4572 DimID is not empty in any mode

not only in NoQ as before

Changeset: 59409a1fd1d50cc8f2a3ea9f6acb8f73905cb13b

comment:21 Changed 9 years ago by Alex Buts

refs #4572 Actually, DimNames not empty in any mode too.

Changeset: b7512cabec5782bad9f271cf7a626dd82c424fb0

comment:22 Changed 9 years ago by Alex Buts

  • Status changed from reopened to accepted

comment:23 Changed 9 years ago by Alex Buts

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

comment:24 Changed 9 years ago by Janik Zikovsky

  • Status changed from verify to verifying

comment:25 Changed 9 years ago by Janik Zikovsky

  • Status changed from verifying to closed

Dimensions have names now.

comment:26 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 5419

Note: See TracTickets for help on using tickets.