Skip to content

Commit

Permalink
Work on LoadIDFFromNexus-v1.rst re #9567
Browse files Browse the repository at this point in the history
Signed-off-by: Karl Palmen <karl.palmen@stfc.ac.uk>
  • Loading branch information
KarlPalmen committed Jun 16, 2014
1 parent 6e09db4 commit 1b509c7
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Code/Mantid/docs/source/algorithms/LoadIDFFromNexus-v1.rst
Expand Up @@ -14,4 +14,36 @@ the instrument from this definition. You may need to tell this algorithm
where in the Nexus file to find the Instrument folder, which contains
the instrument definition.


Usage
-----
** Example - Load an IDF with differently named component **

.. testcode:: ExLoadIDFFromnNexusSimple

result = Load("MUSR00015189")
group = result[0]
ws_1 = group[0]
ws_2 = group[1]

# musr_with_namechange.nxs has component named 'the rings' instead of 'both rings')
LoadIDFFromNexus(ws_1, "musr_with_namechange.nxs","/mantid_workspace_1")

# This workspace had the IDF loaded into it, so getting component renamed to "the rings".
inst1 = ws_1.getInstrument()
comp1 = inst1.getComponentByName("the rings")
print "Modified component name =", comp1.getName()

# This workspace had no IDF loaded into it, so still has component named to "both rings".
inst2 = ws_2.getInstrument()
comp2 = inst2.getComponentByName("both rings")
print "Unmodified component name =", comp2.getName()

Output:

.. testoutput:: ExLoadIDFFromnNexusSimple

Modified component name = the rings
Unmodified component name = both rings

.. categories::
Binary file not shown.

0 comments on commit 1b509c7

Please sign in to comment.