improve format
This commit is contained in:
+17
-14
@@ -1,13 +1,15 @@
|
||||
# coding: utf-8
|
||||
import pickle
|
||||
|
||||
import astropy.units as u
|
||||
import pandas as pd
|
||||
import pymses.utils.regions as reg
|
||||
from fil_finder import FilFinder2D
|
||||
from pymses.filters import RegionFilter
|
||||
from skimage.morphology import medial_axis
|
||||
|
||||
import pspec_new
|
||||
from baseprocessor import *
|
||||
import pymses.utils.regions as reg
|
||||
from pymses.filters import RegionFilter
|
||||
import astropy.units as u
|
||||
from fil_finder import FilFinder2D
|
||||
import pickle
|
||||
from skimage.morphology import medial_axis
|
||||
|
||||
# Getters
|
||||
|
||||
@@ -82,6 +84,15 @@ def mean_by_bins(
|
||||
# For each cell, bin_number contains the number of the bins it belongs to
|
||||
bin_number = np.zeros(len(y))
|
||||
|
||||
# Go through the min value of x of each bin
|
||||
for x_min in x_bins[1:-1]:
|
||||
bin_number = bin_number + (x > x_min).astype(int)
|
||||
|
||||
# Compute the mean in each bin
|
||||
y_mean = np.zeros(len(x_bins) - 1)
|
||||
for i in range(len(y_mean)):
|
||||
y_mean[i] = np.mean(y[bin_number == i])
|
||||
|
||||
# Get the center of each bin
|
||||
if logbins:
|
||||
centers = 10 ** (0.5 * (np.log10(x_bins[1:]) + np.log10(x_bins[:-1])))
|
||||
@@ -1044,14 +1055,6 @@ class PostProcessor(HDF5Container):
|
||||
alpha_g = (2.0 / 3) * alpha_g
|
||||
return alpha_g
|
||||
|
||||
alpha_g = self._ax_avg(getter_alpha_grav, "z", unit=cst.none, surf_qty=True) / (
|
||||
coldens * T_avg
|
||||
)
|
||||
|
||||
# alpha
|
||||
alpha_g = (2.0 / 3) * alpha_g
|
||||
return alpha_g
|
||||
|
||||
def _sinks(self):
|
||||
csv_name = (
|
||||
self.path
|
||||
|
||||
Reference in New Issue
Block a user