Broken pixels when drawing a gas map from 'pynbody.plot.sph.image'

73 views
Skip to first unread message

SungWon Kwak

unread,
Dec 18, 2018, 8:51:21 PM12/18/18
to pynbody-users
Here are two gas density maps of a galaxy drawn from the same snapshot but in different width & height.
My simulation was run by ChaNGa with the SF, SN feedback, and grackle cooling.
I simply did followings

import pynbody
import matplotlib.pyplot as plt
import pynbody.plot.sph as sph
f = pynbody.load(filename)
f.physical_units()
pynbody.analysis.angmom.faceon(f.s)
barmax = 0.5*(10**9)
barmin = (10**3)
sph.image(f.g, width=width_in,vmax=barmax,vmin=barmin,units='Msol kpc^-2',cmap='gist_heat')
plt.show()

Not all snapshots give such broken pixels but I have seen these occasionally.
Has anyone experienced the same and figured out how to avoid them?

Thank you,
SungWon

SungWon Kwak

unread,
Dec 18, 2018, 10:39:55 PM12/18/18
to pynbody-users
Here's another snapshot with broken pixels

Andrew Pontzen

unread,
Dec 19, 2018, 4:46:31 AM12/19/18
to SungWon Kwak, pynbody-users
That suggests there are some NaNs in your image. Are there perhaps gas particles with invalid or negative values for density or mass?

All the best, Andrew

On 19 Dec 2018, at 03:39, SungWon Kwak <kwak...@gmail.com> wrote:

Here's another snapshot with broken pixels

<Auto Generated Inline Image 1.png>

--
You received this message because you are subscribed to the Google Groups "pynbody-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pynbody-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<Auto Generated Inline Image 1.png>

SungWon Kwak

unread,
Dec 21, 2018, 4:16:32 AM12/21/18
to pynbody-users
Oh, I found some gas particles (72 out of ~300000 particles) indeed have 0 mass.
I'm guessing somehow the gas particles with m=0 are not deleted after their masses are consumed/converted into a new star.
I will take out those arrays and re-draw it.

Happy holidays!
SungWon
Reply all
Reply to author
Forward
0 new messages