class MARIReductionSum(ISISDirectInelasticReduction):

    def __init__(self):

        ISISDirectInelasticReduction.__init__(self)
        from ISIS_MariReduction import MARIReductionSum

        self.red = MARIReductionSum()
        self.red.def_advanced_properties()
        self.red.def_main_properties()

    def runTest(self):
        """Defines the workflow for the test
        It verifies operation on summing two files on demand. No absolute units
        """
        #pylint: disable=unused-variable
        outWS=self.red.reduce()
        #outWS*=1.00001556766686

    def get_result_workspace(self):
        """Returns the result workspace to be checked"""
        return "outWS"

    def get_reference_file(self):
        return "MARIReductionSum.nxs"
Exemple #2
0
    def __init__(self):

        ISISDirectInelasticReduction.__init__(self)
        from ISIS_MariReduction import MARIReductionSum

        self.red = MARIReductionSum()
        self.red.def_advanced_properties()
        self.red.def_main_properties()
class MARIReductionWaitAndSum(ISISDirectInelasticReduction):

    def __init__(self):

        ISISDirectInelasticReduction.__init__(self)
        from ISIS_MariReduction import MARIReductionSum

        self.red = MARIReductionSum()
        self.red.def_advanced_properties()
        self.red.def_main_properties()
        self._counter=0
        self._file_to_clear = ''

    def prepare_test_file(self):
        """ This method will run instead of pause and
          would copy run file 11015 into 11002 emulating
          appearance of this file from instrument
      """
        self._counter+=1
        if self._counter>= 3:
            source =  FileFinder.findRuns('MAR11015')[0]
            targ_path = config['defaultsave.directory']
            targ_file = os.path.join(targ_path,'MAR11002.raw')
            shutil.copy2(source ,targ_file )

            self._file_to_clear = targ_file
            self._counter = 0

    def runTest(self):
        """Defines the workflow for the test
      It verifies operation on summing two files on demand. with wait for
      files appearing on data search path
      """
        targ_path = config['defaultsave.directory']
        self._file_to_clear = os.path.join(targ_path,'MAR11002.raw')
        if os.path.exists(self._file_to_clear):
            os.remove(self._file_to_clear)
            self._file_to_clear = ''

        self.red.wait_for_file = 100
        self.red._debug_wait_for_files_operation = self.prepare_test_file
        self._counter=0

        self.red.reducer.prop_man.sample_run=[11001,11002]
        #pylint: disable=unused-variable
        outWS = self.red.run_reduction()

        self.red.wait_for_file =0
        self.red._debug_wait_for_files_operation = None
        os.remove(self._file_to_clear)


    def get_result_workspace(self):
        """Returns the result workspace to be checked"""
        return "outWS"

    def get_reference_file(self):
        return "MARIReductionSum.nxs"
    def __init__(self):

        ISISDirectInelasticReduction.__init__(self)
        from ISIS_MariReduction import MARIReductionSum

        self.red = MARIReductionSum()
        self.red.def_advanced_properties()
        self.red.def_main_properties()