Hi Salome,

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:

https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.binned_statistic.html

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 <salomchedlidze@gmail.com> wrote:

Hello everyone,

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 -- yt-users@python.org
To unsubscribe send an email to yt-users-leave@python.org