Ticket #10395 (closed: invalid)

Opened 6 years ago

Last modified 5 years ago

CreateWorkspace with source workspace does not copy instrument to the extent sufficient to run converert units on target workspace

Reported by: Alex Buts Owned by: Alex Buts
Priority: major Milestone: Release 3.3
Component: Framework Keywords:
Cc: Blocked By:
Blocking: #10384 Tester: Dan Nixon

Description

if one runs the script below, creating workspace from a source and trying to convert this workspace units, convertUnits does not work failing with an error:

In Instrument::getSource(). No source has been set.
In Instrument::getSamplePos(). No SamplePos has been set.
Error in execution of algorithm ConvertUnits:
Instrument not sufficiently defined: failed to get source and/or sample

Should be able to use the generated workspace as a normal workspace.

Script to illustrate the problem:

if not("ws" in mtd):

	if not('LET00017384rings' in mtd):
		Load(Filename=r'D:\Data\Mantid_Testing\14_10_17\LET00017384.nxs', OutputWorkspace='LET00017384', LoaderName='LoadEventNexus', LoaderVersion=1, LoadMonitors=True)
		GroupDetectors(InputWorkspace='LET00017384', OutputWorkspace='LET00017384rings', MapFile='C:/Users/wkc26243/Documents/work/InstrumentFiles/let/LET_one2one_123.map', Behaviour='Average')

	wsParent = mtd['LET00017384rings'];


	nHist = wsParent.getNumberHistograms();
	print "Parent workspace contains {0:10} histgrams".format(nHist)
	x=[xx*0.6-30 for xx in xrange(1,101)]
	y=[1 for xx in xrange(1,len(x))]*nHist
	x = x*nHist

	ws = CreateWorkspace(DataX=x,DataY=y,UnitX='DeltaE',NSpec=nHist,VerticalAxisUnit='SpectraNumber',ParentWorkspace=wsParent)
else:
	ws = mtd['ws'];
	
#ws = CreateWorkspace(DataX=x,DataY=y,UnitX='TOF',VerticalAxisUnit='SpectraNumber')
wse=ConvertUnits(ws,'TOF',Emode='Direct',EFixed=32.)



Change History

comment:1 Changed 6 years ago by Alex Buts

  • Status changed from new to verify
  • Resolution set to invalid

It works now as it should. Very strange but probably something left in memory.

comment:2 Changed 6 years ago by Dan Nixon

  • Status changed from verify to verifying
  • Tester set to Dan Nixon

comment:3 Changed 6 years ago by Dan Nixon

  • Status changed from verifying to closed

comment:4 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 11237

Note: See TracTickets for help on using tickets.