Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instrument parameters #2400

Closed
mantid-builder opened this issue Aug 26, 2010 · 2 comments
Closed

Instrument parameters #2400

mantid-builder opened this issue Aug 26, 2010 · 2 comments
Assignees
Labels
Low Priority Things that you don't ever want to be done.
Milestone

Comments

@mantid-builder
Copy link
Collaborator

Original Reporter: Steve Williams

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 = mtd["test"].getInstrument().getComponentByName("detector1").getPos().getZ()==6.0
test2 = mtd['test'].getInstrument().getStringParameter("detector-name")[0] == 'detector1'

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

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

@mantid-builder
Copy link
Collaborator Author

This issue was originally trac ticket 1553

@mantid-builder
Copy link
Collaborator Author

@mantid-builder mantid-builder added Low Priority Things that you don't ever want to be done. Mantid labels Jun 3, 2015
@mantid-builder mantid-builder added this to the Iteration 25 milestone Jun 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Low Priority Things that you don't ever want to be done.
Projects
None yet
Development

No branches or pull requests

2 participants