Ticket #7221 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

SANS accept already loaded workspace as input

Reported by: Gesner Passos Owned by: Gesner Passos
Priority: major Milestone: Release 2.6
Component: SANS Keywords: SANS
Cc: Blocked By:
Blocking: #6530 Tester: Anders Markvardsen

Description (last modified by Nick Draper) (diff)

The current version of SANS reduction does not accept passing an already loaded workspace as input for the Sample Data, Can, etc.

This option was done in order to make sure that we do not try to 'move the same workspace to its center twice'. Because the movement are relative, this would cause the reduction to work on a fake center and produce a wrong answer.

But, it does have some drawbacks. Sometimes we load data twice to perform a single reduction (wasting time and resources). But, in order to work with the Event Mode data, if we have to split the data, this would mean loading data many times, which would not work nice.

So, my suggestion is to accept workspace as input, but raising exception if the workspace has been moved or rotated so far.

Change History

comment:1 Changed 7 years ago by Gesner Passos

  • Status changed from new to accepted

comment:2 Changed 7 years ago by Gesner Passos

The branch is called feature/7221_accept_loaded_workspace for the mantid code, and for the system test, it is called feature/7221_workspace_as_input.

In order to minimize the impact on the current reduction scheme, a systemtest is suggested to ensure that the system will not break anything. So, it is expected to be tested together.

The system test introduces the file SANS2DLOQReloadWorkspaces.py,

You may run these tests through:

./runSystemTests.py -m <mantidpath> -R SANS2DReloadingWorkspacesOption

comment:3 Changed 7 years ago by Gesner Passos

Introduce the requirements for accepting reload option

re #7221

Changeset: c28d0dac3e44ce76aacb2e988e7c76bda73a15b0

comment:4 Changed 7 years ago by Gesner Passos

Implementation of reload option for accepting workspaces

The strategy here was not to change much the current code. For this reason, it does not touch the way it used to deal with the Loaders.

re #7221

Changeset: 7b650771cd46c8cd827f7777bd981f7a4cbe1643

comment:5 Changed 7 years ago by Gesner Passos

Tester:

I hope the system test will cover all the requirements for this ticket. So, ensuring that the system test has been executed in all machines and that it has passed should be enough. But, the following script also allow to test that we could pass the option to not reaload the data from the file, but to use the already loaded workspace:

from mantid.simpleapi import * 
from ISISCommandInterface import *

config["default.instrument"] = "LOQ"
LOQ()
Set1D()
Detector("rear-detector")
MaskFile('MASK.094AA')
Gravity(False)
Sample = LoadRaw('54431.raw')
Trans_Sample = LoadRaw('54435.raw')
Trans_Direct = LoadRaw('54433.raw')
Can = LoadRaw('54432.raw')
CanTrans_Sample = LoadRaw('54434.raw')
CanTrans_Direct = LoadRaw('54433.raw')
AssignSample(Sample, False)
TransmissionSample(Trans_Sample, Trans_Direct, False)
AssignCan(Can, False)
TransmissionCan(CanTrans_Sample, CanTrans_Direct, False)
FindBeamCentre(60,200, 9)
WavRangeReduction(3, 9, DefaultTrans)

Execute this script and ensure that the answer is good. Than, you could try to change the flag False to True in some cases, to see, if it will load the file again (what it should). Try also to move some of the already loaded workspaces and check that they are not acceptable any more to the reduction.

comment:6 Changed 7 years ago by Gesner Passos

Introduce the requirements for accepting reload option

re #7221

Changeset: c28d0dac3e44ce76aacb2e988e7c76bda73a15b0

comment:7 Changed 7 years ago by Gesner Passos

Allow full data path to be given with folders having dots

The issue of the system test was related that the ubuntu and mac os path name had a folder with a dot. And the input was expecting only a file_name'.'extension.

Now, if it finds more than one dot, it will get only the last one to split the file - extension.

re #7221

Changeset: 9cb09fa9d3bf2e877fe925215c3cabfcea7f9ff1

comment:8 Changed 7 years ago by Gesner Passos

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

This ticket is composed by some changes in the mantid project and inside the system tests as well.

The branch inside the systemtest is called: feature/7221_workspace_as_input

while the branch inside the mantid code is: feature/7221_accept_loaded_workspace.

The system test shows some tests that were created to prove that we can load the workspaces without reloading the data file. The comment:5 does show as well.

Last edited 7 years ago by Gesner Passos (previous) (diff)

comment:9 Changed 7 years ago by Anders Markvardsen

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

comment:10 Changed 7 years ago by Anders Markvardsen

  • Status changed from verifying to closed

Tested script and systemtests passed

comment:11 Changed 7 years ago by Nick Draper

  • Component changed from Mantid to Framework

comment:12 Changed 7 years ago by Nick Draper

  • Component changed from Framework to SANS
  • Description modified (diff)

comment:13 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 8066

Note: See TracTickets for help on using tickets.