10
10
11
11
from mantid .api import MatrixWorkspace , MultipleExperimentInfos
12
12
from mantid .kernel import SpecialCoordinateSystem
13
- from mantid .plots .datafunctions import get_indices
13
+ from mantid .plots .datafunctions import get_indices , get_normalization , get_md_data2d_bin_bounds
14
14
from mantid .simpleapi import BinMD , IntegrateMDHistoWorkspace , TransposeMD
15
15
16
16
from .base_model import SliceViewerBaseModel
@@ -181,10 +181,9 @@ def get_ws_MDE(
181
181
182
182
def get_data_MDH (self , slicepoint , transpose = False ):
183
183
indices , _ = get_indices (self .get_ws (), slicepoint = slicepoint )
184
- if transpose :
185
- return np .ma .masked_invalid (self .get_ws ().getSignalArray ()[indices ]).T
186
- else :
187
- return np .ma .masked_invalid (self .get_ws ().getSignalArray ()[indices ])
184
+ mdh_normalization , _ = get_normalization (self .get_ws ())
185
+ _ , _ , z = get_md_data2d_bin_bounds (self .get_ws (), mdh_normalization , indices , not (transpose ))
186
+ return z
188
187
189
188
def get_data_MDE (self , slicepoint , bin_params , dimension_indices , limits = None , transpose = False ):
190
189
"""
@@ -196,10 +195,10 @@ def get_data_MDE(self, slicepoint, bin_params, dimension_indices, limits=None, t
196
195
should be provided in the order of the workspace not the display
197
196
:param transpose: If true then transpose the data before returning
198
197
"""
199
- if transpose :
200
- return np . ma . masked_invalid ( self . get_ws_MDE ( slicepoint , bin_params , limits , dimension_indices ). getSignalArray (). squeeze ()). T
201
- else :
202
- return np . ma . masked_invalid ( self . get_ws_MDE ( slicepoint , bin_params , limits , dimension_indices ). getSignalArray (). squeeze ())
198
+ mdh = self . get_ws_MDE ( slicepoint , bin_params , limits , dimension_indices )
199
+ mdh_normalization , _ = get_normalization ( mdh )
200
+ _ , _ , z = get_md_data2d_bin_bounds ( mdh , mdh_normalization , transpose = not ( transpose ))
201
+ return z
203
202
204
203
def get_properties (self ):
205
204
"""
0 commit comments