Skip to content

Commit

Permalink
Fix bug in preview point sizing.
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleaoman committed Mar 24, 2024
1 parent 5342c85 commit 1e574dc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Binary file modified docs/source/martini/preview1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/martini/preview2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 9 additions & 9 deletions martini/sources/sph_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,21 +437,21 @@ def preview(
)
nparts = cmask.sum()
mask = np.arange(self.mHI_g.size)[cmask][:: max(nparts // max_points, 1)]
mass_factor = (
1
if (self.mHI_g.isscalar or mask.size <= 1)
else (self.mHI_g[mask] / self.mHI_g[mask].max()).to_value(
U.dimensionless_unscaled
)
)
# mass_factor = (
# 1
# if (self.mHI_g.isscalar or mask.size <= 1)
# else (self.mHI_g[mask] / self.mHI_g[mask].max()).to_value(
# U.dimensionless_unscaled
# )
# )
hsm_factor = (
1
if (self.hsm_g.isscalar or mask.size <= 1)
else (1 - (self.hsm_g[mask] / self.hsm_g[mask].max())).to_value(
else (1 - (self.hsm_g[mask] / self.hsm_g[mask].max()) ** 0.1).to_value(
U.dimensionless_unscaled
)
)
alpha = (mass_factor**0 * hsm_factor**0.1) if point_scaling == "auto" else 1.0
alpha = hsm_factor if point_scaling == "auto" else 1.0
size_scale = (
self.hsm_g.to_value(U.kpc) / lim
if (self.hsm_g.isscalar or mask.size <= 1)
Expand Down

0 comments on commit 1e574dc

Please sign in to comment.