Skip to content

Commit

Permalink
Port inelastic reducer to v2 API. REfs #7469
Browse files Browse the repository at this point in the history
  • Loading branch information
martyngigg committed Jul 23, 2013
1 parent bfd1b18 commit 9a54d50
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
from MantidFramework import *


"""
Command set for Direct Geometry reduction
"""
# Import the specific commands that we need
import mantid
from mantid.api import FrameworkManager
from reduction.command_interface import *
from inelastic_reducer import InelasticReducer

from mantidsimple import *

def ARCS():
Clear(InelasticReducer)

Expand Down Expand Up @@ -49,19 +46,14 @@ def DefaultLoader():
ReductionSingleton().set_loader(step)

def FixEi(ei):
alg = mtd._createAlgProxy("InelasticFixEi")
alg.setPropertyValues(Ei=ei)
alg = FrameworkManager.createAlgorithm("InelasticFixEi")
alg.setProperty("Ei", ei)
ReductionSingleton().set_ei_calculator(alg)

def CalculateEi(guess=None):
#ReductionSingleton().set_ei_calculator(InelasticCalcEi, EiGuess=guess)
alg = mtd._createAlgProxy("InelasticCalcEi")
alg.setPropertyValues(EiGuess=guess)
alg = FrameworkManager.createAlgorithm("InelasticCalcEi")
alg.setProperty("EiGuess",guess)
ReductionSingleton().set_ei_calculator(alg)

def GetEiFromLog():
#ReductionSingleton().set_ei_calculator(InelasticGetEiFromLog)
#alg = mtd._createAlgProxy("InelasticGetEiFromLog")
#alg.setPropertyValues(EiGuess=guess)
#ReductionSingleton().set_ei_calculator(alg)
print "GetEiFromLog(): *** NOT IMPLEMENTED *** "
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
"""
Inelastic specific implementation of the Reducer.
"""

import mantid
from reduction import Reducer
# Validate_step is a decorator that allows both Python algorithms and
# ReductionStep objects to be passed to the Reducer.
# It also does minimal type checking to ensure that the object that is passed is valid

from reduction import validate_step
from reduction import validate_loader
mtd.initialise()
from mantidsimple import *

## Version number
__version__ = '0.01'
Expand Down

0 comments on commit 9a54d50

Please sign in to comment.