[yt-dev] ProfileND: soliciting opinions

John ZuHone jzuhone at gmail.com
Mon Feb 3 15:40:34 PST 2014


> On Feb 3, 2014, at 6:29 PM, Sam Skillman <samskillman at gmail.com> wrote:
> 
> +1 on having .x be the bin centers, and .x_bins being edges.  That said, what is the protocol for calculating the center of logarithmically spaced bins? Is it 
> .x = (.x_bins[:1] + .x_bins[1:])/2 
> or 
> .x = 10**( (np.log10(.x_bins[:1]) + np.log10(.x_bins[1:]))/2 ) 

I'm not sure, but your second expression is reducible to:

.x = np.sqrt(.x_bins[:-1]*.x_bins[1:])

And I think you meant that to be ":-1"


More information about the yt-dev mailing list