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

Python analysis.SDAPlotter类代码示例

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

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



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

示例1: imagePlot

 def imagePlot(self, panel=None):
     if panel is None:
         panel=self.panel;
         
     da=self.chData.cagetArrayUnsigned();
     ds = IntegerDataset.createFromObject(da);
     newds=ds.reshape([self.height, self.width]);
 
     SDAPlotter.imagePlot(panel, newds);
开发者ID:jjkraken,项目名称:gda-epics,代码行数:9,代码来源:EpicsWaveform.py


示例2: imagePlot0

 def imagePlot0(self, panel=None):
     if panel is None:
         panel=self.panel;
         
     da=self.chData.cagetArrayByte()
     ds = ByteDataset.createFromObject(da);
 
     newds=ds.reshape([self.height, self.width]);
 
     SDAPlotter.imagePlot(panel, newds);
开发者ID:jjkraken,项目名称:gda-epics,代码行数:10,代码来源:EpicsWaveform.py


示例3: display

	def display(self,file=None):
		if file==None:
			file = self.getFullFileName()
#		self.data.loadPilatusData(file)
		self.data.load(PilatusTiffLoader(file));
		dataset = self.data.getAxis(0);

		if self.panel:
			if self.logScale:
				SDAPlotter.imagePlot(self.panel, DatasetUtils.lognorm(dataset)); #For RCP GUI
			else:
				SDAPlotter.imagePlot(self.panel, dataset); #For RCP GUI
		else:
			print "No panel set to display"
			raise Exception("No panel_name set in %s. Set this or set %s.setAlive(False)" % (self.name,self.name));
开发者ID:openGDA,项目名称:gda-core,代码行数:15,代码来源:DummyAreaDetector.py


示例4: imagePlot2

 def imagePlot2(self, panel=None):
     if panel is None:
         panel=self.panel;
         
     da=self.chData.cagetArrayByte();
     
     #To convert from singed to unsigned
     #method 2
     da=[x&0xff for x in da]
     
 #method 3
 #    ds1=array.array('B' [x&0xff for x in ds1] )
         
     ds = IntegerDataset.createFromObject(da);
     newds=ds.reshape([self.height, self.width]);
     
     SDAPlotter.imagePlot(panel, newds);
开发者ID:jjkraken,项目名称:gda-epics,代码行数:17,代码来源:EpicsWaveform.py


示例5: ncdredconf

    def ncdredconf(self, detector, **kwords):
        """
            if default None passed in no change is made
            default is everything off
        """
        
        if detector.lower() == "Waxs".lower():
            detector="Waxs"
        else:
            detector="Saxs"
            
        if not detector in self.settings:
            self.settings[detector] = {}
        for i in self.options:
            if not i in self.settings[detector]:
                self.settings[detector][i] = False
            if i in kwords:
                if kwords[i] == None:
                    self.settings[detector][i] = False
                else:
                    self.settings[detector][i] = kwords[i]
        
        realdet=ncdutils.getDetectorByType(self.detsystem, detector.upper())
        realdetname = realdet.getName()
        ncdutils.removeDetectorByName(self.detsystem, detector+" chain")
        
        saxsrc=ReductionChain(detector+" chain", realdetname)
        saxsrclist=saxsrc.getChain()
        
        panel=detector+" Plot"
        beanbag=SDAPlotter.getGuiBean(panel)
        if beanbag == None:
            beanbag = {}
        
        sroi = None
        if self.is2D(realdet):
            if GuiParameters.ROIDATA in beanbag:
                roi = beanbag[GuiParameters.ROIDATA]
                if isinstance(roi, SectorROI):
                    sroi = roi
                    radii = sroi.getRadii()
                    self.settings[detector]["length"]=int(math.ceil(radii[1]-radii[0]))
                    self.settings[detector]["disttobeamstop"]=radii[0]

        length =  self.settings[detector]["length"]
        slope =  self.settings[detector]["slope"]
        intercept =  self.settings[detector]["intercept"]
        if slope == 0 or slope == False:
            axisds=None
        else:
            axis=[]
            pis = realdet.getPixelSize()*1000
            d2b = self.settings[detector]["disttobeamstop"]
            for i in range(length):
                axis.append(float((i+d2b)*pis*slope+intercept))
            axisds=DataSet("qaxis", axis)
            
        mask =  self.settings[detector]["mask"]
        sect =  self.settings[detector]["sect"]
        if sroi != None:
            if sect or isinstance(axisds, DataSet):
                    start = sroi.getPoint()
                    realdet.setAttribute("beam_center_x", start[0])
                    realdet.setAttribute("beam_center_y", start[1])
            else:
                    realdet.setAttribute("beam_center_x", None)
                    realdet.setAttribute("beam_center_y", None)
                    
        cameralength = self.settings[detector]["cameralength"]
        if cameralength != False:
            realdet.setAttribute("distance", cameralength)
        else:
            realdet.setAttribute("distance", None)
            
        norm = self.settings[detector]["norm"]
        if (norm != False):
            saxsnorm=Normalisation(detector+"norm","ignored")
            saxsnorm.setCalibChannel(1)
            saxsnorm.setCalibName(ncdutils.getDetectorByType(self.detsystem, "CALIB").getName())
            saxsrclist.add(saxsnorm)
            
        bg =  self.settings[detector]["bg"]
        if bg != False: 
            if os.path.isfile(bg):
                saxsbgs=BackgroundSubtraction(detector+"bg","ignored")
                sfh=ScanFileHolder()
                if (norm>=0):
                    upstream=detector+"norm.data"
                else:
                    upstream=realdetname+".data"
                sfh.load(NexusLoader(bg,[upstream]))
                ds=sfh.getAxis(upstream)
                saxsbgs.setBackground(ds)
                saxsrclist.add(saxsbgs)
            else:
                print "background file \"%s\" does not exist." % bg
        

        if (sect):
            if sroi != None:
#.........这里部分代码省略.........
开发者ID:openGDA,项目名称:gda-core,代码行数:101,代码来源:redux.py


示例6: plotdata

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,代码行数:83,代码来源:plot.py


示例7: plot_viewnexustree

def plot_viewnexustree(name, tree):
    if not isinstance(tree, _h5mgr):
        import sys #@Reimport
        print >> sys.stderr, "Only tree from loadnexus works for now"
        return
#        import jyhdf5io._tojavatree as _tojtree
#        tree = _tojtree(tree)
    _plotter.viewHDF5Tree(name, tree.gettree())
开发者ID:thiyagavit,项目名称:passerelle,代码行数:8,代码来源:jyplot.py


示例8: plot_getdatabean

def plot_getdatabean(name):
    jdb = _plotter.getDataBean(name)
    if jdb is not None:
        jgb = jdb.getGuiParameters()
        if jgb is not None:
            _wrap_gui_bean(jgb, jgb)
    return jdb
开发者ID:erwindl0,项目名称:scisoft-core,代码行数:7,代码来源:jyplot.py


示例9: plot_addline

def plot_addline(*arg, **kwarg):
    _plotter.addPlot(*arg, **kwarg)
开发者ID:erwindl0,项目名称:scisoft-core,代码行数:2,代码来源:jyplot.py


示例10: plot_line

def plot_line(*arg, **kwarg):
    _plotter.plot(*arg, **kwarg)
开发者ID:erwindl0,项目名称:scisoft-core,代码行数:2,代码来源:jyplot.py


示例11: plot_getdatabean

def plot_getdatabean(name):
    jdb = _plotter.getDataBean(name)
    jgb = jdb.getGuiParameters()
    _wrap_gui_bean(jgb)
    return jdb
开发者ID:DevasenaInupakutika,项目名称:scisoft-core,代码行数:5,代码来源:jyplot.py


示例12: plot_updatepoints2d

def plot_updatepoints2d(*arg, **kwarg):
    _plotter.scatter2DPlotOver(*arg, **kwarg)
开发者ID:erwindl0,项目名称:scisoft-core,代码行数:2,代码来源:jyplot.py


示例13: plot_surface

def plot_surface(*arg, **kwarg):
    _plotter.surfacePlot(*arg, **kwarg)
开发者ID:erwindl0,项目名称:scisoft-core,代码行数:2,代码来源:jyplot.py


示例14: plot_setupimagegrid

def plot_setupimagegrid(*arg, **kwarg):
    _plotter.setupNewImageGrid(*arg, **kwarg)
开发者ID:erwindl0,项目名称:scisoft-core,代码行数:2,代码来源:jyplot.py


示例15: plot_image

def plot_image(*arg, **kwarg):
    _plotter.imagePlot(*arg, **kwarg)
开发者ID:erwindl0,项目名称:scisoft-core,代码行数:2,代码来源:jyplot.py


示例16: plot_addstack

def plot_addstack(*arg, **kwarg):
    _plotter.addStackPlot(*arg, **kwarg)
开发者ID:erwindl0,项目名称:scisoft-core,代码行数:2,代码来源:jyplot.py


示例17: plot_updateline

def plot_updateline(*arg, **kwarg):
    _plotter.updatePlot(*arg, **kwarg)
开发者ID:erwindl0,项目名称:scisoft-core,代码行数:2,代码来源:jyplot.py


示例18: plot_viewtree

def plot_viewtree(name, tree):
    _plotter.viewTree(name, tree._getnative())
开发者ID:DawnScience,项目名称:scisoft-core,代码行数:2,代码来源:jyplot.py


示例19: plot_volume

def plot_volume(*arg, **kwarg):
    _plotter.volumePlot(*arg, **kwarg)
开发者ID:DawnScience,项目名称:scisoft-core,代码行数:2,代码来源:jyplot.py


示例20: plot_stack

def plot_stack(*arg, **kwarg):
    _plotter.stackPlot(*arg, **kwarg)
开发者ID:erwindl0,项目名称:scisoft-core,代码行数:2,代码来源:jyplot.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python dataset.Comparisons类代码示例发布时间:2022-05-27
下一篇:
Python ujson.loads函数代码示例发布时间: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