Skip to content
Snippets Groups Projects
Commit 0810e2a5 authored by Ashwin Vishnu's avatar Ashwin Vishnu
Browse files

Cache bins in increment computation

parent 95fe0c78
No related branches found
No related tags found
1 merge request!8Improve structure function computation
......@@ -60,7 +60,7 @@
self.nrx = self.rxs.size
dict_arrays_1time = {"rxs": self.rxs, "nbins": self.nbins}
self._bins = np.arange(0.5, self.nbins, dtype=float) / self.nbins
self.keys_vars_to_compute = list(output.sim.state.state_phys.keys)
super(Increments, self).__init__(
......@@ -118,9 +118,7 @@
return dict_results
def compute_values_inc(self, valmin, valmax):
return valmin + (valmax - valmin) / self.nbins * np.arange(
0.5, self.nbins
)
return valmin + (valmax - valmin) * self._bins
def load(self):
"""load the saved pdf and return a dictionary."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment