improve format

This commit is contained in:
Noe Brucy
2020-12-14 16:05:04 +01:00
parent 1a7b33f662
commit 61da2aaa46
13 changed files with 134 additions and 132 deletions
+17 -14
View File
@@ -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