• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python logger.information函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中mantid.logger.information函数的典型用法代码示例。如果您正苦于以下问题:Python information函数的具体用法?Python information怎么用?Python information使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了information函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: _calculate_energy

    def _calculate_energy(self, monitor_ws, grouped_ws, red_ws):
        """
        Convert the input run to energy transfer

        @param monitor_ws :: name of the monitor workspace to divide by
        @param grouped_ws :: name of workspace with the detectors grouped
        @param red_ws :: name to call the reduced workspace
        """
        x_range = self._monitor_range(monitor_ws)
        Scale(InputWorkspace=monitor_ws, OutputWorkspace=monitor_ws, Factor=0.001, Operation='Multiply')

        CropWorkspace(InputWorkspace=monitor_ws, OutputWorkspace=monitor_ws, Xmin=x_range[0], XMax=x_range[1])
        ScaleX(InputWorkspace=monitor_ws, OutputWorkspace=monitor_ws, Factor=-x_range[0], Operation='Add')

        CropWorkspace(InputWorkspace=grouped_ws, OutputWorkspace=grouped_ws, Xmin=x_range[0], XMax=x_range[1])
        ScaleX(InputWorkspace=grouped_ws, OutputWorkspace=grouped_ws, Factor=-x_range[0], Operation='Add')

        Divide(LHSWorkspace=grouped_ws, RHSWorkspace=monitor_ws, OutputWorkspace=grouped_ws)
        formula = self._energy_range(grouped_ws)
        ConvertAxisByFormula(InputWorkspace=grouped_ws, OutputWorkspace=red_ws, Axis='X', Formula=formula,
                             AxisTitle='Energy transfer', AxisUnits='meV')

        xnew = mtd[red_ws].readX(0)  # energy array
        logger.information('Energy range : %f to %f' % (xnew[0], xnew[-1]))

        DeleteWorkspace(grouped_ws)
        DeleteWorkspace(monitor_ws)
开发者ID:mkoennecke,项目名称:mantid,代码行数:27,代码来源:IndirectILLReduction.py


示例2: _get_spectra_index

    def _get_spectra_index(self, input_ws):
        """
        Gets the index of the two monitors and first detector for the current instrument configurtion.
        Assumes monitors are named monitor1 and monitor2
        """

        instrument = mtd[input_ws].getInstrument()

        try:
            analyser = instrument.getStringParameter('analyser')[0]
            detector_1_idx = instrument.getComponentByName(analyser)[0].getID() - 1
            logger.information('Got index of first detector for analyser %s: %d' % (analyser, detector_1_idx))
        except IndexError:
            detector_1_idx = 2
            logger.warning('Could not determine index of first detetcor, using default value.')

        try:
            monitor_1_idx = self._get_detector_spectrum_index(input_ws, instrument.getComponentByName('monitor1').getID())

            monitor_2 = instrument.getComponentByName('monitor2')
            if monitor_2 is not None:
                monitor_2_idx = self._get_detector_spectrum_index(input_ws, monitor_2.getID())
            else:
                monitor_2_idx = None

            logger.information('Got index of monitors: %d, %s' % (monitor_1_idx, str(monitor_2_idx)))
        except IndexError:
            monitor_1_idx = 0
            monitor_2_idx = 1
            logger.warning('Could not determine index of monitors, using default values.')

        return monitor_1_idx, monitor_2_idx, detector_1_idx
开发者ID:mkoennecke,项目名称:mantid,代码行数:32,代码来源:IndirectTransmissionMonitor.py


示例3: PyExec

    def PyExec(self):
        self._setup()

        ws_basename = str(self._sample_ws_in)

        self._trans_mon(ws_basename, 'Sam', self._sample_ws_in)
        self._trans_mon(ws_basename, 'Can', self._can_ws_in)

        # Generate workspace names
        sam_ws = ws_basename + '_Sam'
        can_ws = ws_basename + '_Can'
        trans_ws = ws_basename + '_Trans'

        # Divide sample and can workspaces
        Divide(LHSWorkspace=sam_ws, RHSWorkspace=can_ws, OutputWorkspace=trans_ws)

        trans = numpy.average(mtd[trans_ws].readY(0))
        logger.information('Average Transmission: ' + str(trans))

        AddSampleLog(Workspace=trans_ws, LogName='can_workspace', LogType='String', LogText=self._can_ws_in)

        # Group workspaces
        group = sam_ws + ',' + can_ws + ',' + trans_ws
        GroupWorkspaces(InputWorkspaces=group, OutputWorkspace=self._out_ws)

        self.setProperty('OutputWorkspace', self._out_ws)
开发者ID:nimgould,项目名称:mantid,代码行数:26,代码来源:IndirectTransmissionMonitor.py


示例4: ReadWidthFile

def ReadWidthFile(readWidth,widthFile,numSampleGroups):
	widthY = []
	widthE = []

	if readWidth:

		logger.information('Width file is ' + widthFile)

		# read ascii based width file 
		try:
			wfPath = FileFinder.getFullPath(widthFile)
			handle = open(wfPath, 'r')
			asc = []

			for line in handle:
				line = line.rstrip()
				asc.append(line)
			handle.close()

		except Exception, e:
			raise ValueError('Failed to read width file')

		numLines = len(asc)
		
		if numLines == 0:
			raise ValueError('No groups in width file')
		
		if numLines != numSampleGroups:				# check that no. groups are the same
			error = 'Width groups (' +str(numLines) + ') not = Sample (' +str(numSampleGroups) +')'	
			raise ValueError(error)
开发者ID:mantidproject,项目名称:scriptrepository,代码行数:30,代码来源:IndirectBayes.py


示例5: load_files

def load_files(data_files, ipf_filename, spec_min, spec_max, sum_files=False, load_logs=True, load_opts=None):
    """
    Loads a set of files and extracts just the spectra we care about (i.e. detector range and monitor).

    @param data_files List of data file names
    @param ipf_filename File path/name for the instrument parameter file to load
    @param spec_min Minimum spectra ID to load
    @param spec_max Maximum spectra ID to load
    @param sum_files Sum loaded files
    @param load_logs Load log files when loading runs
    @param load_opts Additional options to be passed to load algorithm

    @return List of loaded workspace names and flag indicating chopped data
    """
    workspace_names, chopped_data = _load_files(data_files, ipf_filename, spec_min, spec_max, load_logs, load_opts)

    # Sum files if needed
    if sum_files and len(data_files) > 1:
        if chopped_data:
            workspace_names = sum_chopped_runs(workspace_names)
        else:
            workspace_names = sum_regular_runs(workspace_names)

    logger.information('Summed workspace names: %s' % (str(workspace_names)))

    return workspace_names, chopped_data
开发者ID:DanNixon,项目名称:mantid,代码行数:26,代码来源:IndirectReductionCommon.py


示例6: _generate_UBList

    def _generate_UBList(self):
        CreateSingleValuedWorkspace(OutputWorkspace='__ub')
        LoadIsawUB('__ub',self.getProperty("UBMatrix").value)
        ub=mtd['__ub'].sample().getOrientedLattice().getUB().copy()
        DeleteWorkspace(Workspace='__ub')

        symOps = self.getProperty("SymmetryOps").value
        if symOps:
            try:
                symOps = SpaceGroupFactory.subscribedSpaceGroupSymbols(int(symOps))[0]
            except ValueError:
                pass
            if SpaceGroupFactory.isSubscribedSymbol(symOps):
                symOps = SpaceGroupFactory.createSpaceGroup(symOps).getSymmetryOperations()
            else:
                symOps = SymmetryOperationFactory.createSymOps(symOps)
            logger.information('Using symmetries: '+str([sym.getIdentifier() for sym in symOps]))

            ub_list=[]
            for sym in symOps:
                UBtrans = np.zeros((3,3))
                UBtrans[0] = sym.transformHKL([1,0,0])
                UBtrans[1] = sym.transformHKL([0,1,0])
                UBtrans[2] = sym.transformHKL([0,0,1])
                UBtrans=np.matrix(UBtrans.T)
                ub_list.append(ub*UBtrans)
            return ub_list
        else:
            return [ub]
开发者ID:stuartcampbell,项目名称:mantid,代码行数:29,代码来源:SingleCrystalDiffuseReduction.py


示例7: ReadIbackGroup

def ReadIbackGroup(a,first):                           #read Ascii block of spectrum values
    x = []
    y = []
    e = []
    next = first
    line1 = a[next]
    next += 1
    val = ExtractInt(a[next])
    n1 = val[0]
    ngrp = val[2]
    if line1.startswith('S'):
        error = ''
    else:
        error = 'NOT an S block starting at line ' +str(first)
        logger.information('ERROR *** ' + error)
        sys.exit(error)
    next += 1
    next,Ival = Iblock(a,next)
    for m in range(0, len(Ival)):
        x.append(float(m))
        yy = float(Ival[m])
        y.append(yy)
        ee = math.sqrt(yy)
        e.append(ee)
    return next,x,y,e                                #values of x,y,e as lists
开发者ID:mkoennecke,项目名称:mantid,代码行数:25,代码来源:IndirectNeutron.py


示例8: _read_width_file

    def _read_width_file(self, readWidth, widthFile, numSampleGroups):
        widthY, widthE = [], []
        if readWidth:
            logger.information('Width file is ' + widthFile)
            # read ascii based width file
            try:
                wfPath = s_api.FileFinder.getFullPath(widthFile)
                handle = open(wfPath, 'r')
                asc = []
                for line in handle:
                    line = line.rstrip()
                    asc.append(line)
                handle.close()
            except Exception:
                raise ValueError('Failed to read width file')
            numLines = len(asc)
            if numLines == 0:
                raise ValueError('No groups in width file')
            if numLines != numSampleGroups:  # check that no. groups are the same
                raise ValueError('Width groups (' + str(numLines) + ') not = Sample (' + str(numSampleGroups) + ')')
        else:
            # no file: just use constant values
            widthY = np.zeros(numSampleGroups)
            widthE = np.zeros(numSampleGroups)
        # pad for Fortran call
        widthY = PadArray(widthY, 51)
        widthE = PadArray(widthE, 51)

        return widthY, widthE
开发者ID:DanNixon,项目名称:mantid,代码行数:29,代码来源:BayesQuasi.py


示例9: process_monitor_efficiency

def process_monitor_efficiency(workspace_name):
    """
    Process monitor efficiency for a given workspace.

    @param workspace_name Name of workspace to process monitor for
    """
    from mantid.simpleapi import OneMinusExponentialCor

    monitor_workspace_name = workspace_name + '_mon'
    instrument = mtd[workspace_name].getInstrument()

    try:
        area = instrument.getNumberParameter('Workflow.Monitor1-Area')[0]
        thickness = instrument.getNumberParameter('Workflow.Monitor1-Thickness')[0]
        attenuation = instrument.getNumberParameter('Workflow.Monitor1-Attenuation')[0]
    except IndexError:
        raise ValueError('Cannot get monitor details form parameter file')

    if area == -1 or thickness == -1 or attenuation == -1:
        logger.information('For workspace %s, skipping monitor efficiency' % workspace_name)
        return

    OneMinusExponentialCor(InputWorkspace=monitor_workspace_name,
                           OutputWorkspace=monitor_workspace_name,
                           C=attenuation * thickness,
                           C1=area)
开发者ID:DanNixon,项目名称:mantid,代码行数:26,代码来源:IndirectReductionCommon.py


示例10: Iblock

def Iblock(a,first):                                 #read Ascii block of Integers
    line1 = a[first]
    line2 = a[first+1]
    val = ExtractInt(line2)
    numb = val[0]
    lines=numb/10
    last = numb-10*lines
    if line1.startswith('I'):
        error = ''
    else:
        error = 'NOT an I block starting at line ' +str(first)
        logger.information('ERROR *** ' + error)
        sys.exit(error)
    ival = []
    for m in range(0, lines):
        mm = first+2+m
        val = ExtractInt(a[mm])
        for n in range(0, 10):
            ival.append(val[n])
    mm += 1
    val = ExtractInt(a[mm])
    for n in range(0, last):
        ival.append(val[n])
    mm += 1
    return mm,ival                                       #values as list
开发者ID:mkoennecke,项目名称:mantid,代码行数:25,代码来源:IndirectNeutron.py


示例11: CheckAnalysers

def CheckAnalysers(in1WS,in2WS):
    '''Check workspaces have identical analysers and reflections

    Args:
      @param in1WS - first 2D workspace
      @param in2WS - second 2D workspace

    Returns:
      @return None

    Raises:
      @exception Valuerror - workspaces have different analysers
      @exception Valuerror - workspaces have different reflections
    '''
    ws1 = mtd[in1WS]
    a1 = ws1.getInstrument().getStringParameter('analyser')[0]
    r1 = ws1.getInstrument().getStringParameter('reflection')[0]
    ws2 = mtd[in2WS]
    a2 = ws2.getInstrument().getStringParameter('analyser')[0]
    r2 = ws2.getInstrument().getStringParameter('reflection')[0]
    if a1 != a2:
        raise ValueError('Workspace '+in1WS+' and '+in2WS+' have different analysers')
    elif r1 != r2:
        raise ValueError('Workspace '+in1WS+' and '+in2WS+' have different reflections')
    else:
        logger.information('Analyser is '+a1+r1)
开发者ID:mkoennecke,项目名称:mantid,代码行数:26,代码来源:IndirectCommon.py


示例12: chop_workspace

def chop_workspace(workspace, monitor_index):
    """
    Chops the specified workspace if its maximum x-value exceeds its instrument
    parameter, 'Workflow.ChopDataIfGreaterThan'.

    :param workspace:     The workspace to chop
    :param monitor_index: The index of the monitor spectra in the workspace.
    :return:              A tuple of the list of output workspace names and a boolean
                          specifying whether the workspace was chopped.
    """
    from mantid.simpleapi import ChopData

    workspace_name = workspace.getName()

    # Chop data if required
    try:
        chop_threshold = workspace.getInstrument().getNumberParameter('Workflow.ChopDataIfGreaterThan')[0]
        x_max = workspace.readX(0)[-1]
        chopped_data = x_max > chop_threshold
    except IndexError:
        logger.warning("Chop threshold not found in instrument parameters")
        chopped_data = False
    logger.information('Workspace {0} need data chop: {1}'.format(workspace_name, str(chopped_data)))

    if chopped_data:
        ChopData(InputWorkspace=workspace,
                 OutputWorkspace=workspace_name,
                 MonitorWorkspaceIndex=monitor_index,
                 IntegrationRangeLower=5000.0,
                 IntegrationRangeUpper=10000.0,
                 NChops=5)
        return mtd[workspace_name].getNames(), True
    else:
        return [workspace_name], False
开发者ID:DanNixon,项目名称:mantid,代码行数:34,代码来源:IndirectReductionCommon.py


示例13: Fblock

def Fblock(a,first):                                 #read Ascii block of Floats
    line1 = a[first]
    line2 = a[first+1]
    val = ExtractInt(line2)
    numb = val[0]
    lines=numb/5
    last = numb-5*lines
    if line1.startswith('F'):
        error= ''
    else:
        error = 'NOT an F block starting at line ' +str(first)
        logger.information('ERROR *** ' + error)
        sys.exit(error)
    fval = []
    for m in range(0, lines):
        mm = first+2+m
        val = ExtractFloat(a[mm])
        for n in range(0, 5):
            fval.append(val[n])
    mm += 1
    val = ExtractFloat(a[mm])
    for n in range(0, last):
        fval.append(val[n])
    mm += 1
    return mm,fval                                       #values as list
开发者ID:mkoennecke,项目名称:mantid,代码行数:25,代码来源:IndirectNeutron.py


示例14: identify_bad_detectors

def identify_bad_detectors(workspace_name):
    """
    Identify detectors which should be masked

    @param workspace_name Name of workspace to use to get masking detectors
    @return List of masked spectra
    """
    from mantid.simpleapi import (IdentifyNoisyDetectors, DeleteWorkspace)

    instrument = mtd[workspace_name].getInstrument()

    try:
        masking_type = instrument.getStringParameter('Workflow.Masking')[0]
    except IndexError:
        masking_type = 'None'

    logger.information('Masking type: %s' % masking_type)

    masked_spec = list()

    if masking_type == 'IdentifyNoisyDetectors':
        ws_mask = '__workspace_mask'
        IdentifyNoisyDetectors(InputWorkspace=workspace_name,
                               OutputWorkspace=ws_mask)

        # Convert workspace to a list of spectra
        num_spec = mtd[ws_mask].getNumberHistograms()
        masked_spec = [spec for spec in range(0, num_spec) if mtd[ws_mask].readY(spec)[0] == 0.0]

        # Remove the temporary masking workspace
        DeleteWorkspace(ws_mask)

    logger.debug('Masked spectra for workspace %s: %s' % (workspace_name, str(masked_spec)))

    return masked_spec
开发者ID:DanNixon,项目名称:mantid,代码行数:35,代码来源:IndirectReductionCommon.py


示例15: CheckAnalysers

def CheckAnalysers(in1WS, in2WS):
    """
    Check workspaces have identical analysers and reflections

    Args:
      @param in1WS - first 2D workspace
      @param in2WS - second 2D workspace

    Returns:
      @return None

    Raises:
      @exception Valuerror - workspaces have different analysers
      @exception Valuerror - workspaces have different reflections
    """
    ws1 = s_api.mtd[in1WS]
    try:
        analyser_1 = ws1.getInstrument().getStringParameter('analyser')[0]
        reflection_1 = ws1.getInstrument().getStringParameter('reflection')[0]
    except IndexError:
        raise RuntimeError('Could not find analyser or reflection for workspace %s' % in1WS)
    ws2 = s_api.mtd[in2WS]
    try:
        analyser_2 = ws2.getInstrument().getStringParameter('analyser')[0]
        reflection_2 = ws2.getInstrument().getStringParameter('reflection')[0]
    except:
        raise RuntimeError('Could not find analyser or reflection for workspace %s' % in2WS)

    if analyser_1 != analyser_2:
        raise ValueError('Workspace %s and %s have different analysers' % (ws1, ws2))
    elif reflection_1 != reflection_2:
        raise ValueError('Workspace %s and %s have different reflections' % (ws1, ws2))
    else:
        logger.information('Analyser is %s, reflection %s' % (analyser_1, reflection_1))
开发者ID:samueljackson92,项目名称:mantid,代码行数:34,代码来源:IndirectCommon.py


示例16: PyExec

    def PyExec(self):
        self.log().information('IndirectILLreduction')

        run_path = self.getPropertyValue('Run')
        self._calibration_workspace = self.getPropertyValue('CalibrationWorkspace')
        self._raw_workspace = self.getPropertyValue('RawWorkspace')
        self._red_workspace = self.getPropertyValue('ReducedWorkspace')
        self._red_left_workspace = self.getPropertyValue('LeftWorkspace')
        self._red_right_workspace = self.getPropertyValue('RightWorkspace')
        self._map_file = self.getProperty('MapFile').value

        self._use_mirror_mode = self.getProperty('MirrorMode').value
        self._save = self.getProperty('Save').value
        self._plot = self.getProperty('Plot').value

        LoadILLIndirect(FileName=run_path, OutputWorkspace=self._raw_workspace)

        instrument = mtd[self._raw_workspace].getInstrument()
        self._instrument_name = instrument.getName()

        self._run_number = mtd[self._raw_workspace].getRunNumber()
        self._analyser = self.getPropertyValue('Analyser')
        self._reflection = self.getPropertyValue('Reflection')
        self._run_name = self._instrument_name + '_' + str(self._run_number)

        AddSampleLog(Workspace=self._raw_workspace, LogName="mirror_sense",
                     LogType="String", LogText=str(self._use_mirror_mode))

        logger.information('Nxs file : %s' % run_path)

        output_workspaces = self._reduction()

        if self._save:
            workdir = config['defaultsave.directory']
            for ws in output_workspaces:
                file_path = os.path.join(workdir, ws + '.nxs')
                SaveNexusProcessed(InputWorkspace=ws, Filename=file_path)
                logger.information('Output file : ' + file_path)

        if self._plot:
            from IndirectImport import import_mantidplot
            mtd_plot = import_mantidplot()
            graph = mtd_plot.newGraph()

            for ws in output_workspaces:
                mtd_plot.plotSpectrum(ws, 0, window=graph)

            layer = graph.activeLayer()
            layer.setAxisTitle(mtd_plot.Layer.Bottom, 'Energy Transfer (meV)')
            layer.setAxisTitle(mtd_plot.Layer.Left, '')
            layer.setTitle('')

        self.setPropertyValue('RawWorkspace', self._raw_workspace)
        self.setPropertyValue('ReducedWorkspace', self._red_workspace)

        if self._use_mirror_mode:
            self.setPropertyValue('LeftWorkspace', self._red_left_workspace)
            self.setPropertyValue('RightWorkspace', self._red_right_workspace)
开发者ID:dezed,项目名称:mantid,代码行数:58,代码来源:IndirectILLReduction.py


示例17: C2Se

def C2Se(sname):
    prog = 'QSe'
    outWS = sname+'_Result'
    asc = readASCIIFile(sname+'.qse')
    lasc = len(asc)
    var = asc[3].split()                            #split line on spaces
    nspec = var[0]
    ndat = var[1]
    var = ExtractInt(asc[6])
    first = 7
    Xout = []
    Yf = []
    Ef = []
    Yi = []
    Ei = []
    Yb = []
    Eb = []
    ns = int(nspec)

    dataX = np.array([])
    dataY = np.array([])
    dataE = np.array([])

    for m in range(0,ns):
        first,Q,int0,fw,it,be = SeBlock(asc,first)
        Xout.append(Q)
        Yf.append(fw[0])
        Ef.append(fw[1])
        Yi.append(it[0])
        Ei.append(it[1])
        Yb.append(be[0])
        Eb.append(be[1])
    Vaxis = []

    dataX = np.append(dataX,np.array(Xout))
    dataY = np.append(dataY,np.array(Yi))
    dataE = np.append(dataE,np.array(Ei))
    nhist = 1
    Vaxis.append('f1.Amplitude')

    dataX = np.append(dataX, np.array(Xout))
    dataY = np.append(dataY, np.array(Yf))
    dataE = np.append(dataE, np.array(Ef))
    nhist += 1
    Vaxis.append('f1.FWHM')

    dataX = np.append(dataX,np.array(Xout))
    dataY = np.append(dataY,np.array(Yb))
    dataE = np.append(dataE,np.array(Eb))
    nhist += 1
    Vaxis.append('f1.Beta')

    logger.information('Vaxis=' + str(Vaxis))
    CreateWorkspace(OutputWorkspace=outWS, DataX=dataX, DataY=dataY, DataE=dataE, Nspec=nhist,
        UnitX='MomentumTransfer', VerticalAxisUnit='Text', VerticalAxisValues=Vaxis, YUnitLabel='')
    return outWS
开发者ID:mkoennecke,项目名称:mantid,代码行数:56,代码来源:IndirectBayes.py


示例18: _establish_save_path

 def _establish_save_path(self):
     """
     @return the directory to save FORTRAN outputs to
     """
     workdir = config['defaultsave.directory']
     if not os.path.isdir(workdir):
         workdir = os.getcwd()
         logger.information('Default Save directory is not set.')
         logger.information('Defaulting to current working Directory: ' + workdir)
     return workdir
开发者ID:mducle,项目名称:mantid,代码行数:10,代码来源:BayesStretch.py


示例19: _save_output

    def _save_output(self):
        """
        Save the output workspace to the user's default working directory
        """
        from IndirectCommon import getDefaultWorkingDirectory
        workdir = getDefaultWorkingDirectory()
        file_path = os.path.join(workdir, self._output_workspace + '.nxs')
        SaveNexusProcessed(InputWorkspace=self._output_workspace,
                           Filename=file_path)

        logger.information('Output file : ' + file_path)
开发者ID:mkoennecke,项目名称:mantid,代码行数:11,代码来源:Symmetrise.py


示例20: _load_files

def _load_files(file_specifiers, ipf_filename, spec_min, spec_max, load_logs=True, load_opts=None):
    """
    Loads a set of files and extracts just the spectra we care about (i.e. detector range and monitor).

    @param file_specifiers List of data file specifiers
    @param ipf_filename File path/name for the instrument parameter file to load
    @param spec_min Minimum spectra ID to load
    @param spec_max Maximum spectra ID to load
    @param load_logs Load log files when loading runs
    @param load_opts Additional options to be passed to load algorithm

    @return List of loaded workspace names and flag indicating chopped data
    """
    delete_monitors = False

    if load_opts is None:
        load_opts = {}

    if "DeleteMonitors" in load_opts:
        delete_monitors = load_opts["DeleteMonitors"]
        load_opts.pop("DeleteMonitors")

    workspace_names = []
    chopped_data = False

    for file_specifier in file_specifiers:
        # The filename without path and extension will be the workspace name
        ws_name = os.path.splitext(os.path.basename(str(file_specifier)))[0]
        logger.debug('Loading file %s as workspace %s' % (file_specifier, ws_name))
        do_load(file_specifier, ws_name, ipf_filename, load_logs, load_opts)
        workspace = mtd[ws_name]

        # Add the workspace to the list of workspaces
        workspace_names.append(ws_name)

        # Get the spectrum number for the monitor
        instrument = workspace.getInstrument()
        monitor_param = instrument.getNumberParameter('Workflow.Monitor1-SpectrumNumber')

        if monitor_param:
            monitor_index = int(monitor_param[0])
            logger.debug('Workspace %s monitor 1 spectrum number :%d' % (ws_name, monitor_index))

            workspaces, chopped_data = chop_workspace(workspace, monitor_index)
            crop_workspaces(workspaces, spec_min, spec_max, not delete_monitors, monitor_index)

    logger.information('Loaded workspace names: %s' % (str(workspace_names)))
    logger.information('Chopped data: %s' % (str(chopped_data)))

    if delete_monitors:
        load_opts['DeleteMonitors'] = True

    return workspace_names, chopped_data
开发者ID:DanNixon,项目名称:mantid,代码行数:53,代码来源:IndirectReductionCommon.py



注:本文中的mantid.logger.information函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python logger.notice函数代码示例发布时间:2022-05-27
下一篇:
Python logger.information函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap