Esempio n. 1
0
 def __init__(self,*args,**kwargs):
     """
     NAME:
        __init__
     PURPOSE:
        initialize an actionAngleAxi object
     INPUT:
        Either:
           a) R,vR,vT
           b) Orbit instance: initial condition used if that's it, orbit(t)
              if there is a time given as well
           pot= potential or list of potentials (planarPotentials)
           verticalPot= the vertical Potential
           gamma= (default=1.) replace Lz by Lz+gamma Jz in effective potential (if there is no vertical potential, this is set to zero)
     OUTPUT:
     HISTORY:
        2010-12-01 - Written - Bovy (NYU)
     """
     actionAngle.__init__(self,*args,**kwargs)
     if not kwargs.has_key('pot'): #pragma: no cover
         raise IOError("Must specify pot= for actionAngleAxi")
     self._pot= kwargs['pot']
     if kwargs.has_key('verticalPot'):
         kwargs.pop('pot')
         actionAngleVertical.__init__(self,*args,pot=kwargs['verticalPot'],
                                      **kwargs)
         if kwargs.has_key('gamma'):
             self._gamma= kwargs['gamma']
         else:
             self._gamma= 1.
     else:
         self._gamma= 0.
     return None
Esempio n. 2
0
 def __init__(self,*args,**kwargs):
     """
     NAME:
        __init__
     PURPOSE:
        initialize an actionAngleAxi object
     INPUT:
        Either:
           a) R,vR,vT
           b) Orbit instance: initial condition used if that's it, orbit(t)
              if there is a time given as well
           pot= potential or list of potentials (planarPotentials)
           verticalPot= the vertical Potential
           gamma= (default=1.) replace Lz by Lz+gamma Jz in effective potential (if there is no vertical potential, this is set to zero)
     OUTPUT:
     HISTORY:
        2010-12-01 - Written - Bovy (NYU)
     """
     actionAngle.__init__(self,*args,**kwargs)
     if not kwargs.has_key('pot'):
         raise IOError("Must specify pot= for actionAngleAxi")
     self._pot= kwargs['pot']
     if kwargs.has_key('verticalPot'):
         kwargs.pop('pot')
         actionAngleVertical.__init__(self,*args,pot=kwargs['verticalPot'],
                                      **kwargs)
         if kwargs.has_key('gamma'):
             self._gamma= kwargs['gamma']
         else:
             self._gamma= 1.
     else:
         self._gamma= 0.
     return None
Esempio n. 3
0
 def __init__(self,*args,**kwargs):
     """
     NAME:
        __init__
     PURPOSE:
        initialize an actionAngle object
     INPUT:
        Either:
           a) R,vR,vT
           b) Orbit instance: initial condition used if that's it, orbit(t)
              if there is a time given as well
     OUTPUT:
     HISTORY:
        2010-07-11 - Written - Bovy (NYU)
     """
     actionAngle.__init__(self,*args,**kwargs)
     if kwargs.has_key('verticalPot'):
         actionAngleVertical.__init__(self,*args,pot=kwargs['verticalPot'],
                                      **kwargs)
     return None
Esempio n. 4
0
 def __init__(self, *args, **kwargs):
     """
     NAME:
        __init__
     PURPOSE:
        initialize an actionAnglePower object, power-law is vc=vo(r)^beta
     INPUT:
        Either:
           a) R,vR,vT
           b) Orbit instance: initial condition used if that's it, orbit(t)
              if there is a time given as well
        beta= power-law index
     OUTPUT:
     HISTORY:
        2010-07-11 - Written - Bovy (NYU)
     """
     actionAngle.__init__(self, *args, **kwargs)
     if kwargs.has_key('verticalPot'):
         actionAngleVertical.__init__(self,
                                      *args,
                                      pot=kwargs['verticalPot'],
                                      **kwargs)
     if not kwargs.has_key('beta'):
         raise IOError("Must specify beta= for actionAnglePower")
     self._beta = kwargs['beta']
     if self._beta < 0.:
         self._signbeta = -1
     else:
         self._signbeta = 1
     self._absbeta = nu.fabs(self._beta)
     (rperi, rap) = self.calcRapRperi()
     self._e = (rap - rperi) / (rap + rperi)
     if self._e == 0.:
         self._X = 0.
         self._Y = 0.
     else:
         self._X= (1.-self._e)**2./4./self._e\
             *(((1.+self._e)/(1.-self._e))**(2.*self._beta+2.)-1.)
         self._Y= (1.+self._e)**2./4./self._e\
             *(1.-((1.-self._e)/(1.+self._e))**(2.*self._beta+2.))
     return None
Esempio n. 5
0
 def __init__(self, *args, **kwargs):
     """
     NAME:
        __init__
     PURPOSE:
        initialize an actionAngle object
     INPUT:
        Either:
           a) R,vR,vT
           b) Orbit instance: initial condition used if that's it, orbit(t)
              if there is a time given as well
     OUTPUT:
     HISTORY:
        2010-07-11 - Written - Bovy (NYU)
     """
     actionAngle.__init__(self, *args, **kwargs)
     if kwargs.has_key('verticalPot'):
         actionAngleVertical.__init__(self,
                                      *args,
                                      pot=kwargs['verticalPot'],
                                      **kwargs)
     return None
Esempio n. 6
0
 def __init__(self,*args,**kwargs):
     """
     NAME:
        __init__
     PURPOSE:
        initialize an actionAnglePower object, power-law is vc=vo(r)^beta
     INPUT:
        Either:
           a) R,vR,vT
           b) Orbit instance: initial condition used if that's it, orbit(t)
              if there is a time given as well
        beta= power-law index
     OUTPUT:
     HISTORY:
        2010-07-11 - Written - Bovy (NYU)
     """
     actionAngle.__init__(self,*args,**kwargs)
     if kwargs.has_key('verticalPot'):
         actionAngleVertical.__init__(self,*args,pot=kwargs['verticalPot'],
                                      **kwargs)
     if not kwargs.has_key('beta'):
         raise IOError("Must specify beta= for actionAnglePower")
     self._beta= kwargs['beta']
     if self._beta < 0.:
         self._signbeta= -1
     else:
         self._signbeta= 1
     self._absbeta= nu.fabs(self._beta)
     (rperi,rap)= self.calcRapRperi()
     self._e= (rap-rperi)/(rap+rperi)
     if self._e == 0.:
         self._X= 0.
         self._Y= 0.
     else:
         self._X= (1.-self._e)**2./4./self._e\
             *(((1.+self._e)/(1.-self._e))**(2.*self._beta+2.)-1.)
         self._Y= (1.+self._e)**2./4./self._e\
             *(1.-((1.-self._e)/(1.+self._e))**(2.*self._beta+2.))
     return None