Skip to content

Commit

Permalink
fix #13
Browse files Browse the repository at this point in the history
  • Loading branch information
JRLoveridge committed Oct 25, 2023
1 parent 9e6c15e commit ea376be
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions at3d/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -2043,6 +2043,13 @@ def _setup_memory(self):
self._ml = self._nmu - 1
self._mm = max(0, int(self._nphi / 2) - 1)
self._nlm = (2 * self._mm + 1) * (self._ml + 1) - self._mm * (self._mm + 1)
if self._nlm < 4:
raise at3d.exceptions.SHDOMError(
"Insufficient Spherical Harmonics (NLM={})."
" Make sure `num_mu_bins`={} is large enough (>=2) and `num_phi_bins`"
"={} is ~2 times as large.".format(self._nlm, self._nmu, self._nphi)
)

if self._ncs == 1:
self._nphi0max = int((self._nphi + 2) / 2)
elif self._ncs == 2:
Expand Down

0 comments on commit ea376be

Please sign in to comment.