def pvR(self,vR,R,z,gl=True,ngl=_DEFAULTNGL2,nsigma=4.,vTmax=1.5):
        """
        NAME:

           pvR

        PURPOSE:

           calculate the marginalized vR probability at this location (NOT normalized by the density)

        INPUT:

           vR - radial velocity (can be Quantity)

           R - radius (can be Quantity)

           z - height (can be Quantity)

           gl - use Gauss-Legendre integration (True, currently the only option)

           ngl - order of Gauss-Legendre integration

           nsigma - sets integration limits to [-1,+1]*nsigma*sigma_z(R) for integration over vz (default: 4)

           vTmax - sets integration limits to [0,vTmax] for integration over vT (default: 1.5)

        OUTPUT:

           p(vR,R,z)

        HISTORY:

           2012-12-22 - Written - Bovy (IAS)

        """
        sigmaz1= self._sz*numpy.exp((self._refr-R)/self._hsz)
        if gl:
            if ngl % 2 == 1:
                raise ValueError("ngl must be even")
            #Use Gauss-Legendre integration for all
            if ngl == _DEFAULTNGL:
                glx, glw= self._glxdef, self._glwdef
                glx12, glw12= self._glxdef12, self._glwdef12
            elif ngl == _DEFAULTNGL2:
                glx, glw= self._glxdef2, self._glwdef2
                glx12, glw12= self._glxdef, self._glwdef
            else:
                glx, glw= numpy.polynomial.legendre.leggauss(ngl)
                glx12, glw12= numpy.polynomial.legendre.leggauss(ngl//2)
            #Evaluate everywhere
            if isinstance(self._aA,(actionAngle.actionAngleAdiabatic,
                                    actionAngle.actionAngleAdiabaticGrid)):
                vzgl= nsigma*sigmaz1/2.*(glx+1.)
                vzglw= glw
                vzfac= nsigma*sigmaz1  #2 x integration over [0,nsigma*sigmaz1]
            else:
                vzgl= nsigma*sigmaz1/2.*(glx12+1.)
                vzgl= list(vzgl)
                vzgl.extend(-nsigma*sigmaz1/2.*(glx12+1.))
                vzgl= numpy.array(vzgl)
                vzglw= glw12
                vzglw= list(vzglw)
                vzglw.extend(glw12)
                vzglw= numpy.array(vzglw)
                vzfac = 0.5*nsigma*sigmaz1   #integration over [-nsigma*sigmaz1,0] and [0,nsigma*sigmaz1]
            vTgl= vTmax/2.*(glx+1.)
            vTfac= 0.5 * vTmax  #integration over [0.,vTmax]
            #Tile everything
            vTgl= numpy.tile(vTgl,(ngl,1)).T
            vzgl= numpy.tile(vzgl,(ngl,1))
            vTglw= numpy.tile(glw,(ngl,1)).T #also tile weights
            vzglw= numpy.tile(vzglw,(ngl,1))
            #evaluate
            logqeval= numpy.reshape(self(R+numpy.zeros(ngl*ngl),
                                         vR+numpy.zeros(ngl*ngl),
                                         vTgl.flatten(),
                                         z+numpy.zeros(ngl*ngl),
                                         vzgl.flatten(),
                                         log=True,
                                         use_physical=False),
                                    (ngl,ngl))
            return numpy.sum(numpy.exp(logqeval)*vTglw*vzglw*vzfac)*vTfac
def pvR ( self , vR , R , z , gl = True , ngl = _DEFAULTNGL2 , nsigma = 4. , vTmax = 1.5 ) : sigmaz1 = self . _sz * numpy . exp ( ( self . _refr - R ) / self . _hsz ) if gl : if ngl % 2 == 1 : raise ValueError ( "ngl must be even" ) if ngl == _DEFAULTNGL : glx , glw = self . _glxdef , self . _glwdef glx12 , glw12 = self . _glxdef12 , self . _glwdef12 elif ngl == _DEFAULTNGL2 : glx , glw = self . _glxdef2 , self . _glwdef2 glx12 , glw12 = self . _glxdef , self . _glwdef else : glx , glw = numpy . polynomial . legendre . leggauss ( ngl ) glx12 , glw12 = numpy . polynomial . legendre . leggauss ( ngl // 2 ) if isinstance ( self . _aA , ( actionAngle . actionAngleAdiabatic , actionAngle . actionAngleAdiabaticGrid ) ) : vzgl = nsigma * sigmaz1 / 2. * ( glx + 1. ) vzglw = glw vzfac = nsigma * sigmaz1 else : vzgl = nsigma * sigmaz1 / 2. * ( glx12 + 1. ) vzgl = list ( vzgl ) vzgl . extend ( - nsigma * sigmaz1 / 2. * ( glx12 + 1. ) ) vzgl = numpy . array ( vzgl ) vzglw = glw12 vzglw = list ( vzglw ) vzglw . extend ( glw12 ) vzglw = numpy . array ( vzglw ) vzfac = 0.5 * nsigma * sigmaz1 vTgl = vTmax / 2. * ( glx + 1. ) vTfac = 0.5 * vTmax vTgl = numpy . tile ( vTgl , ( ngl , 1 ) ) . T vzgl = numpy . tile ( vzgl , ( ngl , 1 ) ) vTglw = numpy . tile ( glw , ( ngl , 1 ) ) . T vzglw = numpy . tile ( vzglw , ( ngl , 1 ) ) logqeval = numpy . reshape ( self ( R + numpy . zeros ( ngl * ngl ) , vR + numpy . zeros ( ngl * ngl ) , vTgl . flatten ( ) , z + numpy . zeros ( ngl * ngl ) , vzgl . flatten ( ) , log = True , use_physical = False ) , ( ngl , ngl ) ) return numpy . sum ( numpy . exp ( logqeval ) * vTglw * vzglw * vzfac ) * vTfac
NAME:

           pvR

        PURPOSE:

           calculate the marginalized vR probability at this location (NOT normalized by the density)

        INPUT:

           vR - radial velocity (can be Quantity)

           R - radius (can be Quantity)

           z - height (can be Quantity)

           gl - use Gauss-Legendre integration (True, currently the only option)

           ngl - order of Gauss-Legendre integration

           nsigma - sets integration limits to [-1,+1]*nsigma*sigma_z(R) for integration over vz (default: 4)

           vTmax - sets integration limits to [0,vTmax] for integration over vT (default: 1.5)

        OUTPUT:

           p(vR,R,z)

        HISTORY:

           2012-12-22 - Written - Bovy (IAS)