To add to what Suoqing said, the profile objects will also calculate the variance. So if you do: p = yt.create_profile(...)
You can then do: print (p.variance)
On Sat, Apr 11, 2020 at 12:09 PM Ji, Suoqing email@example.com wrote:
You can do variance with yt. For any field x, you can make compute two profiles (weighted by cell-volume so you get the mean value) for x and x^2 separately, then the variance of x = <x^2> - <x>^2, where “<>” denotes the mean values computed in the profiles.
For median values, as far as I’m concerned, 1D profile in yt does not give you this option. But you can easily use binned_statistic in scipy:
and in your case, it would be something like
ad = ds.all_data() … = binned_statistic(ad[“density”].v.ravel(), ad[“temperature”].v.ravel() , statistic=‘median', bins=your_bin_number)
Best wishes, — Suoqing Ji Sherman Fairchild Fellow TAPIR & Walter Burke Institute for Theoretical Physics California Institute of Technology http://www.tapir.caltech.edu/~suoqing
On Apr 11, 2020, at 1:34 AM, Salome Mtchedlidze firstname.lastname@example.org wrote:
As far as I understand when yt makes 1D profile e.g. temperature vs density, the temperature is summed up within the bins and currently, there is no possibility to profile not the sums but the variance or median of the binned field, right? Or is there a possibility to export this data before yt sums up field values in the bins?
Thanks, Salome _______________________________________________ yt-users mailing list -- email@example.com To unsubscribe send an email to firstname.lastname@example.org
yt-users mailing list -- email@example.com To unsubscribe send an email to firstname.lastname@example.org