I think the code is simply using the terms "variance" and "standard deviation" interchangeably here.
You can see how the `variance` array attached to the profile object is calculated here:
I haven't looked up the mathematical definitions in detail, but I believe that this is the sample variance at each profile bin (*not* the standard deviation of the mean).
If you'd like, please feel free to send a pull request to update that cookbook recipe to label the variance with "variance" instead of "standard deviation". The code for the cookbook recipe is located here in the repository:
On Sun, Jan 1, 2017 at 8:30 AM Andrew Cunningham firstname.lastname@example.org wrote:
In the following cookbook example:
the variance along the profile is extracted:
variance = prof.variance['gas', 'velocity_magnitude'].value
but is then labelled as the standard deviation when the plot is created:
plt.loglog(radius, variance, label='Standard Deviation')
So, does "prof.variance" return the standard deviation and not the variance? Or, is the plot mislabelled? Should the plot instead be:
plt.loglog(radius, np.sqrt(variance), label='Standard Deviation')
yt-users mailing list