<p>For future reference, I believe the issue here was that you didn't instantiate the potential. That is, you probably tried to do</p>
<pre><code>from galpy.potential import LogarithmicHaloPotential, evaluatePotentials
evaluatePotentials(LogarithmicHaloPotential,1.,0.)
</code></pre>
<p>rather than</p>
<pre><code>from galpy.potential import LogarithmicHaloPotential, evaluatePotentials
lp= LogarithmicHaloPotential() # specific instance with default parameters
evaluatePotentials(lp,1.,0.)
</code></pre>
<p>Please don't hesitate to open an Issue or Discussion at the GitHub page or join the slack community there: <a href="https://github.com/jobovy/galpy" rel="nofollow noreferrer">https://github.com/jobovy/galpy</a>. I don't usually monitor stackexchange.</p>

CC BY-SA 4.0
2022-06-28T02:04:15.767Z
*Welcome to Astronomy SE!*
uhoh
CC BY-SA 4.0
2022-06-28T00:16:33.220Z
2022-06-28T00:18:00.550Z
2022-06-28T00:18:00.550Z
Jo Bovy
<p>I am trying to model galactic disks. From the past research we have discovered that the halo follows the logarithmic potential, the disk follows the Miyamoto-Nagai potential and the bulge follows the Hernquist potential. I have the <span class="math-container">$R$</span> and <span class="math-container">$z$</span> coordinates of a sample of stars divided into halo, bulge and disk stars and I am trying to compute the potentials of these potential using <a href="https://github.com/jobovy/galpy" rel="nofollow noreferrer">galpy</a>'s <code>galpy.potential.evaluatePotentials(Pot, R, z, phi=None, t=0.0, dR=0, dphi=0)</code>.</p>
<p>However, it looks like the potentials are defaulted as non axis symmetric during initialization since I am getting the error message as shown in the image.</p>
<p><a href="https://i.sstatic.net/dPnwD.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/dPnwD.png" alt="enter image description here" /></a></p>
<p>Is there a way to make this work?</p>
<p>Coding the potentials is one way to get around the problem, however, before resorting to this option, I needed to check whether there are solutions available already.</p>
<p>Cheers!!!</p>

CC BY-SA 4.0
2022-06-23T23:05:35.143Z
Never used `galpy` before and not sure how your doing your import and definition (can you edit the Q to show this please?) but if I do a `from galpy.potential import LogarithmicHaloPotential ; halo = LogarithmicHaloPotential()` then doing a `halo.isNonAxi` returns False so it has that attribute.
astrosnapper
CC BY-SA 4.0
2022-06-24T13:25:03.497Z
Looks like a temporary bug in the code. I uninstalled galpy and reinstalled it. That worked!!!
CTZenScientist
<galaxy><python><galactic-dynamics><galactic-halo><galactic-evolution>
Evaluating Potentials using Galpy
CTZenScientist
# Evaluating Potentials using Galpy

(Asked by: username_0 on 2022-06-23)

I am trying to model galactic disks. From the past research we have discovered that the halo follows the logarithmic potential, the disk follows the Miyamoto-Nagai potential and the bulge follows the Hernquist potential. I have the $R$ and $z$ coordinates of a sample of stars divided into halo, bulge and disk stars and I am trying to compute the potentials of these potential using [galpy](https://github.com/jobovy/galpy)'s `galpy.potential.evaluatePotentials(Pot, R, z, phi=None, t=0.0, dR=0, dphi=0)`.

However, it looks like the potentials are defaulted as non axis symmetric during initialization since I am getting the error message as shown in the image.

[![enter image description here](https://i.sstatic.net/dPnwD.png)](https://i.sstatic.net/dPnwD.png)

Is there a way to make this work?

Coding the potentials is one way to get around the problem, however, before resorting to this option, I needed to check whether there are solutions available already.

Cheers!!!

**Tags:** galaxy, python, galactic-dynamics, galactic-halo, galactic-evolution
> **Comments:**
> **username_1**: Never used `galpy` before and not sure how your doing your import and definition (can you edit the Q to show this please?) but if I do a `from galpy.potential import LogarithmicHaloPotential ; halo = LogarithmicHaloPotential()` then doing a `halo.isNonAxi` returns False so it has that attribute.  
> **username_0**: Looks like a temporary bug in the code. I uninstalled galpy and reinstalled it. That worked!!!  

---

## 1 answers

### Answer by username_2 on 2022-06-28. Score: 3 | Accepted answer

For future reference, I believe the issue here was that you didn't instantiate the potential. That is, you probably tried to do
from galpy.potential import LogarithmicHaloPotential, evaluatePotentials
evaluatePotentials(LogarithmicHaloPotential,1.,0.)

rather than
from galpy.potential import LogarithmicHaloPotential, evaluatePotentials
lp= LogarithmicHaloPotential() # specific instance with default parameters
evaluatePotentials(lp,1.,0.)

Please don't hesitate to open an Issue or Discussion at the GitHub page or join the slack community there: https://github.com/jobovy/galpy. I don't usually monitor stackexchange.

> **Comments:**
> **username_3**: *Welcome to Astronomy SE!*  

---

