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:
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)
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