Skip to content

Commit

Permalink
Bugfix: NaN when empty particle bins
Browse files Browse the repository at this point in the history
  • Loading branch information
stammler committed Jun 18, 2023
1 parent c4ce216 commit 77c94dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dustpylib/radtrans/radmc3d/radmc3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ def _write_dust_density_inp(self, datadir=None):
z_grid = R_grid * np.cos(theta_grid)

# Binning surface density onto new size bins
Sigma = np.empty(
Sigma = np.zeros(
(self.rc_grid_.shape[0],
self.ac_grid.shape[0])
)
Expand All @@ -524,7 +524,7 @@ def _write_dust_density_inp(self, datadir=None):
yi = self.ac_grid
H = griddata(
(x, y), z, (xi[:, None], yi[None, :]),
method="linear", rescale=True)
method="linear", rescale=True, fill_value=1.)

rho = Sigma / (np.sqrt(2.*np.pi)*H)
rho_grid = np.empty(
Expand Down

0 comments on commit 77c94dd

Please sign in to comment.