Add preliminary power spectrum integration

This commit is contained in:
Noe Brucy
2020-05-14 15:55:01 +02:00
committed by Noe Brucy
parent bb6f1091eb
commit 1a07edb5b7
4 changed files with 175 additions and 40 deletions
+7
View File
@@ -1,5 +1,6 @@
# coding: utf-8
import pandas as pd
import pspec_new
from baseprocessor import *
mass_func = lambda dset: dset["rho"] * dset["dx"] ** 3 # Mass function
@@ -584,6 +585,11 @@ class PostProcessor(HDF5Container):
return sinks_dict
def _pspec(self):
outfile = self.path_out + "/pspec.h5"
pspec_new.pspec(repo=self.path, iouts=[self.num], outfile=outfile)
return outfile
def def_rules(self):
self.rules = {
@@ -674,6 +680,7 @@ class PostProcessor(HDF5Container):
"Teff": cst.K,
},
),
"pspec": Rule(self, self._pspec, "Power spectrum", "/hdf5"),
# Helpers
"radial_bins": Rule(self, self._radial_bins, "Radial bins", "/radial"),
"rr": Rule(self, self._rr, "Coordinate map", "/maps"),