ValueError: Failed to make a sensible logarithmic image. This probably means there are no particles in the view.

43 views
Skip to first unread message

Eliza Diggins

unread,
Oct 1, 2022, 1:42:47 PM10/1/22
to pynbody-users
I'm trying to check if my GADGET-2 initial conditions files for a galaxy cluster are phenomenologically accurate, and I use 

 py.plot.image(data.dm,threaded=False,width='5000 kpc',vmin=10e-10),

which works flawlessly. Unfortunately, the same command for gas,

 py.plot.image(data.g,threaded=False,width='5000 kpc',vmin=10e-10)

returns

ValueError: Failed to make a sensible logarithmic image. This probably means there are no particles in the view.

I can confirm that the "smooth" key for the gas is zero for each particle, but I'm not sure why that is. There is definitely mass in the gas, and there are many particles. Am I missing something obvious here?

Thanks a bunch in advance,

Eliza

Pontzen, Andrew

unread,
Oct 1, 2022, 2:50:57 PM10/1/22
to Eliza Diggins, pynbody-users
Dear Eliza,

This is probably because your ICs file contains lots of zeros for the density/softening of the gas (these would be filled in later by gadget when it is initialised).

For DM this is not an issue, as density and softenings are not stored in the gadget file and therefore pynbody computes them from scratch.

To force pynbody to do the same for gas you can try 

data.g[’smooth’] = pynbody.sph.smooth(data.g)
data.g[‘rho’] = pynbody.sph.rho(data.g)

before you try plotting the image

All the best

Andrew
 

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/pynbody-users/1ae95561-1993-4e08-8211-d29e89d80ad8n%40googlegroups.com.

Eliza Diggins

unread,
Oct 1, 2022, 3:50:51 PM10/1/22
to pynbody-users
Awesome! This worked flawlessly! Thank you so much!
Reply all
Reply to author
Forward
0 new messages