Commit 917825d9 authored by Domanski, Marian M.'s avatar Domanski, Marian M.

modify normalization so 0 is rb and 1 is lb

parent bf591f85
......@@ -264,12 +264,15 @@ class FullResults(Results):
def _normalize_axis(self, position_axis):
if position_axis == 0:
abs_length = self._domain_length
positions = \
self._positions[:, :, position_axis] / self._domain_length
elif position_axis == 1:
abs_length = self._width
positions = \
self._positions[:, :, position_axis] / self._width + 0.5
elif position_axis == 2:
abs_length = self._depth
positions = self._positions[:, :, position_axis] / abs_length
positions = \
self._positions[:, :, position_axis] / self._depth
return positions
def positions(self, normalize=()):
......
......@@ -107,12 +107,15 @@ class FullResultsRecorder(ResultsRecorder):
def _normalize_axis(self, position_axis):
if position_axis == 0:
abs_length = self._domain_length
positions = \
self._positions[:, :, position_axis] / self._domain_length
elif position_axis == 1:
abs_length = self._width
positions = \
self._positions[:, :, position_axis] / self._width + 0.5
elif position_axis == 2:
abs_length = self._depth
positions = self._positions[:, :, position_axis] / abs_length
positions = \
self._positions[:, :, position_axis] / self._depth
return positions
def depth(self):
......@@ -222,7 +225,7 @@ class QuantileResultsRecorder(ResultsRecorder):
width = hydraulic_results.width()
normalized_positions[:, 0] = current_position[:,
0] / self._domain_length
normalized_positions[:, 1] = current_position[:, 1] / width
normalized_positions[:, 1] = current_position[:, 1] / width + 0.5
normalized_positions[:, 2] = current_position[:, 2] / depth
self._positions[:, time_index, :] = np.quantile(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment