CompositePotential

class gala.potential.CompositePotential(*args, **kwargs)[source]

Bases: gala.potential.PotentialBase, collections.OrderedDict

A potential composed of several distinct components. For example, two point masses or a galactic disk and halo, each with their own potential model.

A CompositePotential is created like a Python dictionary, e.g.:

>>> p1 = SomePotential(func1) 
>>> p2 = SomePotential(func2) 
>>> cp = CompositePotential(component1=p1, component2=p2) 

This object actually acts like an OrderedDict, so if you want to preserve the order of the potential components, use:

>>> cp = CompositePotential() 
>>> cp['component1'] = p1 
>>> cp['component2'] = p2 

You can also use any of the built-in Potential classes as components:

>>> from gala.potential import HernquistPotential
>>> cp = CompositePotential()
>>> cp['spheroid'] = HernquistPotential(m=1E11, c=10., units=(u.kpc,u.Myr,u.Msun,u.radian))

Attributes Summary

parameters
units

Attributes Documentation

parameters
units