예제 #1
0
 def get_dim_info(workspace, n: int) -> dict:
     """
     returns dict of (minimum :float, maximum :float, number_of_bins :int,
                      width :float, name :str, units :str, type :str, can_rebin: bool, qdim: bool) for dimension n
     """
     dim = workspace.getDimension(n)
     return {
         'minimum': dim.getMinimum(),
         'maximum': dim.getMaximum(),
         'number_of_bins': dim.getNBins(),
         'width': dim.getBinWidth(),
         'name': dim.name,
         'units': dim.getUnits(),
         'type': WorkspaceInfo.get_ws_type(workspace).name,
         'can_rebin':
         WorkspaceInfo.can_support_dynamic_rebinning(workspace),
         'qdim': dim.getMDFrame().isQ()
     }