def __init__(self, orbit, amp=1., GM=.06, ro=None, vo=None, softening=None, softening_model='plummer', softening_length=0.01): """ NAME: __init__ PURPOSE: initialize a MovingObjectPotential INPUT: orbit - the Orbit of the object (Orbit object) amp= - amplitude to be applied to the potential (default: 1); can be a Quantity with units of mass or Gxmass GM - 'mass' of the object (degenerate with amp, don't use both); can be a Quantity with units of mass or Gxmass Softening: either provide a) softening= with a ForceSoftening-type object b) softening_model= type of softening to use ('plummer') softening_length= (optional; can be Quantity) ro=, vo= distance and velocity scales for translation into internal units (default from configuration file) OUTPUT: (none) HISTORY: 2011-04-10 - Started - Bovy (NYU) """ Potential.__init__(self, amp=amp * GM, ro=ro, vo=vo, amp_units='mass') if _APY_LOADED and isinstance(softening_length, units.Quantity): softening_length = softening_length.to(units.kpc).value / self._ro # Make sure we aren't getting physical outputs self._orb = copy.deepcopy(orbit) self._orb.turn_physical_off() if softening is None: if softening_model.lower() == 'plummer': self._softening = PlummerSoftening( softening_length=softening_length) else: self._softening = softening self.isNonAxi = True return None
def __init__(self, orbit, amp=1., GM=.06, normalize=False, softening=None, softening_model='plummer', softening_length=0.01): """ NAME: __init__ PURPOSE: initialize a MovingObjectPotential INPUT: orbit - the Orbit of the object (Orbit object) amp= - amplitude to be applied to the potential (default: 1) GM - 'mass' of the object (degenerate with amp) normalize - if True, normalize such that vc(1.,0.)=1., or, if given as a number, such that the force is this fraction of the force necessary to make vc(1.,0.)=1. (at t=0) Softening: either provide a) softening= with a ForceSoftening-type object b) softening_model= type of softening to use ('plummer') softening_length= (optional) OUTPUT: (none) HISTORY: 2011-04-10 - Started - Bovy (NYU) """ Potential.__init__(self, amp=amp) self._gm = GM self._orb = orbit if softening is None: if softening_model.lower() == 'plummer': self._softening = PlummerSoftening( softening_length=softening_length) else: self._softening = softening if normalize: self.normalize(normalize)
def __init__(self, orbit, amp=1., GM=.06, softening=None, softening_model='plummer', softening_length=0.01): """ NAME: __init__ PURPOSE: initialize a MovingObjectPotential INPUT: orbit - the Orbit of the object (Orbit object) amp= - amplitude to be applied to the potential (default: 1) GM - 'mass' of the object (degenerate with amp) Softening: either provide a) softening= with a ForceSoftening-type object b) softening_model= type of softening to use ('plummer') softening_length= (optional) OUTPUT: (none) HISTORY: 2011-04-10 - Started - Bovy (NYU) """ Potential.__init__(self, amp=amp) self._gm = GM self._orb = orbit if softening is None: if softening_model.lower() == 'plummer': self._softening = PlummerSoftening( softening_length=softening_length) else: self._softening = softening self.isNonAxi = True return None