Ticket #1553 (closed: fixed)

Opened 10 years ago

Last modified 5 years ago

Instrument parameters

Reported by: Steve Williams Owned by: Anders Markvardsen
Priority: minor Milestone: Iteration 25
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Michael Whitty

Description

Anders this is the problem that I talked to you about, the instrument loses its parameters on the second loading. At the moment we are explictly running populateInstrumentParameters() in LoadRaw and the HFIR equivalent LoadSpice2D.

Below is a script from Mathieu where he was runing LoadSpice2D twice in combination with LoadEmptyInstrument and it lost parameters. The script works OK now after they added the populateInstrumentParameters() line but remove it and it doesn't work.

Can you fix this? Let me know. Cheers, Steve

Hey guys,

I’m having a problem loading parameters from the parameters.xml file. It works fine when I load a data file normally, but the parameters are lost when LoadEmptyInstrument is called beforehand. It seems that the parameters are only loaded in the workspace created by the first call but not the second… Any idea how we should fix this? Run the code below and you’ll see what I mean.

-M

from MantidFramework import * from mantidsimple import * mtd.initialise(False) import os

TEST_DIR = "../../../Test/Data/SANS2D/" filepath = os.path.join(TEST_DIR, "BioSANS_test_data.xml") instrpath = "../../../Test/Instrument/BIOSANS_Definition.xml"

success = True

loader = LoadSpice2D(filepath, "test") test1 = mtdtest?.getInstrument().getComponentByName("detector1").getPos().getZ()==6.0 test2 = mtdtest?.getInstrument().getStringParameter("detector-name")[0] == 'detector1'

LoadEmptyInstrument(instrpath, 'inst') loader = LoadSpice2D(filepath, "test") test3 = mtdtest?.getInstrument().getComponentByName("detector1").getPos().getZ()==6.0 test4 = len(mtdtest?.getInstrument().getStringParameter("detector-name")) == 1 test5 = mtdinst?.getInstrument().getStringParameter("detector-name")[0] == 'detector1'

print "SUCCESS ? " print test1 print test2 print test3 print test4 print test5

Attachments

test.py (944 bytes) - added by Anders Markvardsen 10 years ago.

Change History

comment:1 Changed 10 years ago by Anders Markvardsen

(In [6331]) Remove call to populateInstrumentParameters() in LoadSpice2D.

In general since commit 6109 to ticket #1576 there should be no need to call populateInstrumentParameters() unless user wants to load custom parameter other than those defined in the IDF file itself, e.g GEM_Definition.xml, and the associated default parameter file, e.g. GEM_Parameters.xml.

Added a couple tests to test that this is indeed the current behaviour to LoadEmptyInstrument.

re #1553

Changed 10 years ago by Anders Markvardsen

comment:2 Changed 10 years ago by Anders Markvardsen

  • Status changed from new to accepted
  • Component set to Mantid

Added attachment test.py for testing this ticket. Copy of original ticket python script put without some of the new lines etc scrabbled.

comment:3 Changed 10 years ago by Anders Markvardsen

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

comment:4 Changed 10 years ago by Nick Draper

  • Milestone changed from Unassigned to Iteration 25

comment:5 Changed 10 years ago by Michael Whitty

  • Status changed from verify to verifying
  • Tester set to Michael Whitty

comment:6 Changed 10 years ago by Michael Whitty

  • Status changed from verifying to closed

works in r[7139].

comment:7 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 2400

Note: See TracTickets for help on using tickets.