当前位置: 首页>>代码示例>>Python>>正文


Python SDAPlotter.addPlot方法代码示例

本文整理汇总了Python中uk.ac.diamond.scisoft.analysis.SDAPlotter.addPlot方法的典型用法代码示例。如果您正苦于以下问题:Python SDAPlotter.addPlot方法的具体用法?Python SDAPlotter.addPlot怎么用?Python SDAPlotter.addPlot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在uk.ac.diamond.scisoft.analysis.SDAPlotter的用法示例。


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

示例1: plotdata

# 需要导入模块: from uk.ac.diamond.scisoft.analysis import SDAPlotter [as 别名]
# 或者: from uk.ac.diamond.scisoft.analysis.SDAPlotter import addPlot [as 别名]
def plotdata(filename, dataType=MAC, plotPane="DataPlot", Overlay=True):
    '''Plot existing data on "MAC, PSD", or "SRS" (if any) Panel, the default is MAC data on DataPlot panel and overlay is True.
       
       syntax:
               plotdata(filename,[MAC|SRS|PSD],["MAC"|"Mythen"|"DataPlot"],[True|False])
       
               where:
                    filename: the filename string in quote. 
                
                    dataType: the input data types or formats available
		                MAC - plot MAC data on MAC panel
		                PSD - plot PSD data on Mythen panel
		                SRS - plot SRS data on SRS panel
		            
		            plotPane: the graph panel to display the plot
		        
		            Overlay:
                        'True': plot over the exist data on the graph (Default) 
                        'False': clear existing plot data from the graph before plotting new data
                         
    '''
    print("Data plotting to " + plotPane + " panel, please wait ...")
    if dataType == MAC:
        sfh = loadMacData(filename)
        dataset=sfh.getAxis(1)
        dataset.setName(filename)
        if Overlay:
            Plotter.plotOver(plotPane, sfh.getAxis(0), dataset)
        else:
            Plotter.plot(plotPane, sfh.getAxis(0), dataset)
    elif dataType == SRS:
        sfh = loadSRSData(filename)
        if Overlay:
            Plotter.plotOver(plotPane, sfh.getAxis(0), sfh.getAxis(1))
        else:
            Plotter.plot(plotPane, sfh.getAxis(0), sfh.getAxis(1))
    elif dataType == PSD:
        if not str(filename).find("mythen") == -1:
            # mythen data file
            dataset = loadMythenData(filename)
            data=dataset.getCountDataSet()
            data.setName(filename)
            if Overlay:
                Plotter.plotOver(plotPane, dataset.getAngleDataSet(), data)
            else:
                Plotter.plot(plotPane, dataset.getAngleDataSet(), data)
        else:
            parts = str(filename).split(File.separator)
            name=parts[-1]
            names=str(name).split(".")
            if representsInt(names[0]):
                # Mythen SRS file
                for each in loadMythenSRSFile(filename):
                    dataset = loadMythenData(str(each) + ".dat")
                    data=dataset.getCountDataSet()
                    data.setName(each)
                    if Overlay:
                        Plotter.plotOver(plotPane, dataset.getAngleDataSet(), data)
                    else:
                        Plotter.plot(plotPane, dataset.getAngleDataSet(), data)
            else:
                dataset = loadMythenData(filename)
                data=dataset.getCountDataSet()
                data.setName(filename)
                if Overlay:
                    Plotter.plotOver(plotPane, dataset.getAngleDataSet(), data)
                else:
                    Plotter.plot(plotPane, dataset.getAngleDataSet(), data)
    elif dataType == RAW:
            # mythen raw data file
            dataset = loadMythenRawData(filename)
            data=DoubleDataset(dataset.getCountArray(), dataset.getCountArray().length)
            channeldata=DoubleDataset(dataset.getChannelArray(),dataset.getChannelArray().length)
            data.setName(filename)
            if Overlay:
                Plotter.plotOver(plotPane, channeldata, data)
                SDAPlotter.addPlot(plotPane, "", channeldata, data, "delta", "counts")
            else:
                Plotter.plot(plotPane, channeldata, data)
                SDAPlotter.plot(plotPane, "", channeldata, data, "delta", "counts")
    else:
        print "Data Type is not recognised or supported."
    print "Plotting completed."
开发者ID:fajinyuan,项目名称:gda-dls-beamline-i11,代码行数:85,代码来源:plot.py

示例2: plot_addline

# 需要导入模块: from uk.ac.diamond.scisoft.analysis import SDAPlotter [as 别名]
# 或者: from uk.ac.diamond.scisoft.analysis.SDAPlotter import addPlot [as 别名]
def plot_addline(*arg, **kwarg):
    _plotter.addPlot(*arg, **kwarg)
开发者ID:erwindl0,项目名称:scisoft-core,代码行数:4,代码来源:jyplot.py


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