[yt-dev] removing empty bins from radial profiles

Matthew Turk matthewturk at gmail.com
Fri Aug 31 06:23:25 PDT 2012


Hi Wolfram,

All profiles have a supplemental field called "UsedBins" which is a
boolean field.  It's True wherever the bin has been touched, and False
wherever it hasn't.  You could use something like numpy's masked
arrays to handle this, but it could also just be as simple as:

u = prof["UsedBins"]
pyplot.loglog(prof["Density"][u], prof["Temperature"][u])

for the same effect.

Hope that helps!

-Matt

On Fri, Aug 31, 2012 at 8:57 AM, Wolfram Schmidt
<schmidt at astro.physik.uni-goettingen.de> wrote:
> Hi all,
>
> I am calculating radial profiles with BinnedProfile1D, where the profile
> values happen to be zero in a few bins. This causes interruptions in the
> graphs when I plot the the profiles with pylab.loglog. I don't want to make
> the bins broader. So I would like to get rid of the empty bins (i.e., bins
> with zero values) by removing them from the profile lists or somehow tell
> the loglog function of pylab to ignore all zero values. Unfortunately, I
> have found a solution either way.
>
> Can anyone help?
>
> Wolfram
> _______________________________________________
> yt-dev mailing list
> yt-dev at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org



More information about the yt-dev mailing list