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


Python Layout.showGs方法代码示例

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


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

示例1: Coverage

# 需要导入模块: from pylayers.gis.layout import Layout [as 别名]
# 或者: from pylayers.gis.layout.Layout import showGs [as 别名]

#.........这里部分代码省略.........
        --------
        .. plot::
            :include-source:

            >>> from pylayers.antprop.coverage import *
            >>> C = Coverage()
            >>> C.cover()
            >>> C.showPr()

        """
        self.Lwo,self.Lwp,self.Edo,self.Edp = Loss0_v2(self.L,self.grid,self.model.f,self.tx)
        self.freespace = PL(self.grid,self.model.f,self.tx)
        self.prdbmo = self.ptdbm - self.freespace - self.Lwo
        self.prdbmp = self.ptdbm - self.freespace - self.Lwp
        self.snro = self.prdbmo - self.pndbm
        self.snrp = self.prdbmp - self.pndbm


    def showEd(self,polarization='o'):
        """ show direct path excess of delay map

        Examples
        --------
        .. plot::
            :include-source:

            >>> from pylayers.antprop.coverage import *
            >>> C = Coverage()
            >>> C.cover()
            >>> C.showEdo()
        """

        fig=plt.figure()
        fig,ax=self.L.showGs(fig=fig)
        l=self.grid[0,0]
        r=self.grid[-1,0]
        b=self.grid[0,1]
        t=self.grid[-1,-1]
        if polarization=='o':
            cov=ax.imshow(self.Edo.reshape((self.nx,self.ny)).T,
                      extent=(l,r,b,t),
                      origin='lower')
            titre = "Map of LOS excess delay, polar orthogonal"
        if polarization=='p':
            cov=ax.imshow(self.Edp.reshape((self.nx,self.ny)).T,
                      extent=(l,r,b,t),
                      origin='lower')
            titre = "Map of LOS excess delay, polar parallel"

        ax.scatter(self.tx[0],self.tx[1],linewidth=0)
        ax.set_title(titre)

        divider = make_axes_locatable(ax)
        cax = divider.append_axes("right", size="5%", pad=0.05)
        clb = fig.colorbar(cov,cax)
        clb.set_label('excess delay (ns)')
        if self.show:
            plt.show()


    def showPower(self,rxsens=True,nfl=True,polarization='o'):
        """ show the map of received power

        Parameters
        ----------
开发者ID:vostro2013,项目名称:pylayers,代码行数:69,代码来源:coverage.py

示例2: Layout

# 需要导入模块: from pylayers.gis.layout import Layout [as 别名]
# 或者: from pylayers.gis.layout.Layout import showGs [as 别名]
#doctest.testmod(layout)


#L = Layout('TA-Office.ini')
L = Layout('DLR.ini')
try:
    L.dumpr()
except:
    L.build()
    L.dumpw()
#L.editor()
fig = plt.gcf()
#ax1  = fig.add_subplot(221)
ax1  = fig.add_subplot(321)
L.display['thin']=True
fig,ax1  = L.showGs(fig=fig,ax=ax1)
#L.display['edlabel']=True
#L.display['edlblsize']=50
# display selected segments
L.display['thin']=True
L.showG(fig=fig,ax=ax1,graph='t')
fig = plt.gcf()
ax1 = plt.gca()
fig,ax1 =  L.showGs(fig=fig,ax=ax1,edlist=[125],width=4)
ax11 = fig.add_subplot(322)
L.showG(fig=fig,ax=ax11,graph='')
#plt.savefig('graphGs.png')
#build topological graph 
ax2 = fig.add_subplot(323)
L.showG(fig=fig,ax=ax2,graph='t')
plt.title('Topological graph')
开发者ID:mlaaraie,项目名称:pylayers,代码行数:33,代码来源:test_layout.py

示例3: Simul

# 需要导入模块: from pylayers.gis.layout import Layout [as 别名]
# 或者: from pylayers.gis.layout.Layout import showGs [as 别名]

#.........这里部分代码省略.........
        #
        # forall person
        #   forall device
        for p in self.dpersons:
            D = []
            for dev in self.dpersons[p].dev:
                aDev = Device(self.dpersons[p].dev[dev]['name'], ID = dev)
                D.append(aDev)

                D[-1].ant['A1']['name'] = self.dpersons[p].dev[dev]['file']
                D[-1].ant['antenna'] = self.dpersons[p].dev[dev]['ant']
            N.add_devices(D, grp=p)
        #
        # get access point devices
        #
        for ap in self.dap:
            D = Device(self.dap[ap]['name'], ID = ap)
            D.ant['antenna'] = self.dap[ap]['ant']
            N.add_devices(D, grp = 'ap', p = self.dap[ap]['pos'])
            N.update_orient(ap, self.dap[ap]['T'], now = 0.)
        # create Network
        #
        #    _get_wstd
        #    _get_grp
        #    _connect
        #    _init_PN
        #
        N.create()
        self.N = N

    def show(self):
        """ show actual simlulation configuration
        """
        fig, ax = self.L.showGs()
        fig, ax = self.N.show(fig=fig, ax=ax)
        return fig, ax

    def evaldeter(self, na, nb, wstd, fmod='force',nf=10,fGHz=[], **kwargs):
        """ deterministic evaluation of a link

        Parameters
        ----------

        na : string:
            node a id in self.N (Network)
        nb : string:
            node b id in self.N (Network)
        wstd : string:
            wireless standard used for commmunication between na and nb
        fmode : string ('center'|'band'|'force')
            mode of frequency evaluation
            center : single frequency (center frequency of a channel)
            band : nf points on the whole band
            force : takes directly fGHz
        nf : int:
            number of frequency points (if fmode = 'band')
        **kwargs : argument of DLink

        Returns
        -------

        (a, t )

        a : ndarray
            alpha_k
        t : ndarray
开发者ID:Dialloalha,项目名称:pylayers,代码行数:70,代码来源:simultraj.py

示例4: Simul

# 需要导入模块: from pylayers.gis.layout import Layout [as 别名]
# 或者: from pylayers.gis.layout.Layout import showGs [as 别名]

#.........这里部分代码省略.........
                s=30,
                spl=221,
                title='',
                vaxis=((-30, 10, 2, 18)),
                vmin=0,
                vmax=1,
                colbool=False,
                cblabel='dB'):
        """
            Parameters
            ----------

            itx
            irx
            values
            cmap
            s
            spl
            title
            vaxis
            vmin
            vmax
            colbool
            clabel

        """
        fig = plt.gcf()
        ax = fig.add_subplot(spl)
        xtx = self.tx.position[itx, 0]
        ytx = self.tx.position[itx, 1]
        xrx = self.rx.position[irx, 0]
        yrx = self.rx.position[irx, 1]
        self.L.display['title'] = title
        self.L.showGs(ax)
        for furk in siradel.siradel_furniture.keys():
            fur = siradel.siradel_furniture[furk]
            if fur.Matname == 'METAL':
                fur.show(fig, ax)

        #self.show(furniture=True)
        plt.axis(vaxis)
        b1 = ax.scatter(xtx, ytx, s=s, c=values, cmap=cmap,
                        linewidths=0, vmin=vmin, vmax=vmax)
        ax.scatter(xrx, yrx, s=30, c='b', linewidths=0)
        if colbool:
            cb = colorbar(b1)
            cb.set_label(cblabel, fontsize=14)
        return(b1)

    def info(self, itx=[], irx=[]):
        """ display simulation information

         Parameters
         ----------
         itx : Tx index
         irx : Rx index

        """
        print self.filesimul
        print '------------------------------------------'
        try:
            print "Layout Info : \n", self.L.info()
        except:
            print "provide a Layout in the simulation : S.L "
            print ">>> S.layout(filename.str) "
            print "or "
开发者ID:,项目名称:,代码行数:70,代码来源:

示例5: Layout

# 需要导入模块: from pylayers.gis.layout import Layout [as 别名]
# 或者: from pylayers.gis.layout.Layout import showGs [as 别名]
from pylayers.gis.layout import Layout
import matplotlib.pyplot as plt 
import doctest 

#doctest.testmod(layout)


L = Layout()
L.load('TA-Office.str')
#L.editor()
fig = plt.gcf()
#ax1  = fig.add_subplot(221)
ax1  = fig.add_subplot(111)
L.display['thin']=True
fig,ax1  = L.showGs(fig=fig,ax=ax1)
L.display['thin']=False
L.display['edlabel']=True
L.display['edlblsize']=50
fig,ax1 =  L.showGs(fig=fig,ax=ax1,edlist=[10,7,54],width=4)
plt.show()
#plt.savefig('graphGs.png')
# build topological graph 
#L.buildGt()
#ax2 = fig.add_subplot(222)
#L.showG(fig=fig,ax=ax2,graph='t')
#plt.title('Topological graph')
#plt.savefig('graphGt.png')
# build graph of rooms
#L.buildGr()
#ax3 = fig.add_subplot(223)
#L.showG(fig=fig,ax=ax3,graph='r')
开发者ID:fgrandhomme,项目名称:pylayers,代码行数:33,代码来源:test_layout.py

示例6: Simul

# 需要导入模块: from pylayers.gis.layout import Layout [as 别名]
# 或者: from pylayers.gis.layout.Layout import showGs [as 别名]

#.........这里部分代码省略.........
        """ generate Network and associated links

        Notes
        -----

        Create self.N : Network object

        See Also
        --------

        pylayers.network.network

        """

        N = Network()
        # get devices on bodies
        for p in self.dpersons:
            D = []
            for dev in self.dpersons[p].dev:
                D.append(
                    Device(self.dpersons[p].dev[dev]['name'], ID=dev + '_' + p))
            N.add_devices(D, grp=p)
        # get access point devices
        for ap in self.dap:
            D = Device(self.dap[ap]['name'], ID=ap)
            N.add_devices(D, grp='ap', p=self.dap[ap]['pos'])
        # create Network
        N.create()
        self.N = N

    def show(self):
        """ show actual simlulation configuration
        """
        fig, ax = self.L.showGs()
        fig, ax = self.N.show(fig=fig, ax=ax)
        return fig, ax

    def evaldeter(self, na, nb, wstd, fmode='band', nf=10):
        """ deterministic evaluation of a link

        Parameters
        ----------

        na : string:
            node a id in self.N (Network)
        nb : string:
            node b id in self.N (Network)
        wstd : string:
            wireless standard used for commmunication between na and nb
        fmode : string ('center'|'band')
            mode of frequency evaluation
            center : only on the centered frequency
            band : on the whole band
        nf : int:
            number of frequency points (if fmode = 'band')

        Returns
        -------

        (a, t )

        a : ndarray
            alpha_k
        t : ndarray
            tau_k
开发者ID:niamiot,项目名称:pylayers,代码行数:69,代码来源:simultraj.py


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