Ticket #10332 (closed: fixed)

Opened 6 years ago

Last modified 5 years ago

ConvertTo MD does not update EI attached to PreprocessedDetectorsWorkspace

Reported by: Alex Buts Owned by: Alex Buts
Priority: major Milestone: Release 3.3
Component: Framework Keywords:
Cc: helen.c.walker@… Blocked By:
Blocking: Tester: Federico M Pouzols

Description

As described in the letter from the instrument scientist, preprocessedDetectorWorkspace does not work propertly and this is the the reason for that.

Should be fixed.

=== OK, I think I have found my problem. I am using BuildSQW_FePS3.py to generate sqw files for two different energy runs. From the 75 meV data I am looking at hplots, and from the 32 meV data kplots. The problem comes if I start off looking at one, and making the necessary plots, and then just run the script again for the other energy data set, WITHOUT first deleting the workspace preprDetMER. As long as I remember to delete this workspace in between running the scripts, then it would appear that everything works just fine.

Sorry, it should have occurred to me that this might present a problem, but it could cause difficulties for others in the future, because they, like me, might assume that this workspace would be rewritten each time the script was run.

Best wishes,

Helen

Change History

comment:1 Changed 6 years ago by Alex Buts

refs #10332 This should fix it.

Changeset: 959eee237ae7693bfb1804b8f4ae53bd3ab05ef2

comment:2 Changed 6 years ago by Alex Buts

  • Status changed from new to assigned

the script below will run in current Mantid and will produce 3 absolutely identical workspaces. This is wrong.

After the patch applied, it will produce two workspaces (fail on the md2db), and md2c is very different from md2da.

redWS = CreateSimulationWorkspace(Instrument='MAR',BinParams=[-10,0.1,20],UnitX='DeltaE')
AddSampleLog(redWS,LogName='Ei',LogText='12.',LogType='Number');
md2a=ConvertToMD(InputWorkspace=redWS,QDimensions='|Q|',dEAnalysisMode='Direct',MinValues=[0,-10],MaxValues=[8,20],SplitInto='200,200')

try:
	redWS1 = CreateSimulationWorkspace(Instrument='MAR',BinParams=[-10,0.1,20],UnitX='DeltaE')
	#AddSampleLog(redWS,LogName='Ei',LogText='100.',LogType='Number');
	md2b=ConvertToMD(InputWorkspace=redWS1,QDimensions='|Q|',dEAnalysisMode='Direct',MinValues=[0,-10],MaxValues=[8,20],SplitInto='200,200')
except:
	print " Can not produce md2d workspace"


#redWS1 = CreateSimulationWorkspace(Instrument='MAR',BinParams=[-10,0.1,20],UnitX='DeltaE')
AddSampleLog(redWS,LogName='Ei',LogText='100.',LogType='Number');
md2c=ConvertToMD(InputWorkspace=redWS,QDimensions='|Q|',dEAnalysisMode='Direct',MinValues=[0,-10],MaxValues=[8,20],SplitInto='200,200')


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

comment:3 Changed 6 years ago by Alex Buts

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

comment:4 Changed 6 years ago by Alex Buts

refs #10332 Allow incident energy to be defined as eFixed log name

Changeset: f36f3ad3d88b4800e71c3d106e465de44ba47035

comment:5 Changed 6 years ago by Alex Buts

refs #10332 Allow different spelling for eFixed

Changeset: c58c25b5803352e62aa8a4ddfcc5584c83604a05

comment:6 Changed 6 years ago by Alex Buts

refs #10332 Test failure if Ei is not defined on source workspace

Always fail in direct or indirect mode.

Changeset: 041b9000ccd443fbf0ef459b4edf05896d926b37

comment:7 Changed 6 years ago by Alex Buts

refs #10332 Fix min-max which now correctly changed

(the previous values were related to 60mEv incident energy (Shame!)

Changeset: addd9b9a849c34450b60244f37cfd06f030e2fa9

comment:8 Changed 6 years ago by Alex Buts

refs #10332 Remove unnecessary check in indirect mode

As indirect instrument would not easily change

Changeset: 85569c2d992b0977898dc266f4b6fe1eac68cbc2

comment:9 Changed 6 years ago by Alex Buts

refs #10332 Should fix MergeMD doctest

it was producing incorrect results!!!

Changeset: aa8e31ccde0f65f781e0f683914b89688dc9a1ae

comment:10 Changed 6 years ago by Alex Buts

I think, changes to the code are easy to understand as I am updating Ei attached to Preprocessed detectors' workspace from source workspace each time the algorithm is run.

As the result, the calculations fail (see script above) when Ei is not attached to the source workspace and different energy do produce different scattering patterns for the same energy transfer results.

Tester may compare the results with updated energy with the results when preprocessed detectors workspace is not generated at all ("-" for preprocessed detector's workspace name) and verify that these results are identical to the one obtained in the case when incident energy is updated.

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

comment:11 Changed 6 years ago by Federico M Pouzols

  • Status changed from verify to verifying
  • Tester set to Federico M Pouzols

comment:12 Changed 6 years ago by Federico M Pouzols

  • Status changed from verifying to closed

All looks fine. The new code checks error conditions and provides informative error messages. I verified that:

  • in current Mantid, three workspaces are created when you run the script provided in the 2nd comment: md2a, md2b, md2c, all of them apparently identical
  • after changes, md2b is not created, the try/except block shows an error message. md2c is created and is now different from md2a
  • If I forget to specify 'Input neutron's energy', I get a ValueError exception with informative message
  • different repetitions seems to produce identical output workspaces
  • tests and doc-tests pass (the rst expected output has been updated)

comment:13 Changed 6 years ago by Federico Montesino Pouzols

Merge remote-tracking branch 'origin/bugfix/10332_updateEi'

Full changeset: cb55e79c1ab4e0ff4365c76a5590eab843aa7386

comment:14 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 11174

Note: See TracTickets for help on using tickets.