@@ -130,7 +130,7 @@ def generate_maps(self, work_item: PlotWorkItem):
130130 filter_cpp = openmc .lib .filters [params ["filter_id" ]]
131131
132132 # Single call replaces id_map + property_map + get_plot_bins
133- ids_map , properties = openmc .lib .raster_plot (
133+ geom_data , property_data = openmc .lib .raster_plot (
134134 origin = params ["origin" ],
135135 width = (params ["width" ], params ["height" ]),
136136 basis = params ["basis" ],
@@ -140,7 +140,7 @@ def generate_maps(self, work_item: PlotWorkItem):
140140 filter = filter_cpp ,
141141 )
142142
143- self .finished .emit (work_item .view_params , ids_map , properties )
143+ self .finished .emit (work_item .view_params , geom_data , property_data )
144144 except Exception as exc :
145145 self .error .emit (str (exc ))
146146
@@ -233,12 +233,12 @@ def _start_next(self):
233233 self .work_requested .emit (work_item )
234234
235235 @Slot (object , object , object )
236- def _on_worker_finished (self , view_params , ids_map , properties ):
236+ def _on_worker_finished (self , view_params , geom_data , property_data ):
237237 request = self ._in_flight_request
238238 self ._in_flight_request = None
239239 if request is not None :
240240 self .plot_finished .emit (request .view_snapshot ,
241- view_params , ids_map , properties )
241+ view_params , geom_data , property_data )
242242 if self ._pending_request is not None :
243243 self ._start_next ()
244244 else :
@@ -275,10 +275,10 @@ class PlotModel:
275275 Dictionary mapping material IDs to openmc.Material instances
276276 ids : NumPy int array (v_res, h_res, 1)
277277 Mapping of plot coordinates to cell/material ID by pixel
278- ids_map : NumPy int32 array (v_res, h_res, 3)
279- Mapping of cell and material ids
280- properties : Numpy float array (v_res, h_res, 3 )
281- Mapping of cell temperatures and material densities
278+ geom_data : NumPy int32 array (v_res, h_res, 3) or (v_res, h_res, 4 )
279+ Geometry data with cell IDs, instances, material IDs, and optionally filter bins
280+ property_data : Numpy float array (v_res, h_res, 2 )
281+ Property data with cell temperatures and material densities
282282 image : NumPy int array (v_res, h_res, 3)
283283 The current RGB image data
284284 statepoint : StatePointModel
@@ -319,9 +319,9 @@ def __init__(self, use_settings_pkl, model_path, default_res):
319319 # Cell/Material ID by coordinates
320320 self .ids = None
321321
322- # Return values from id_map and property_map
323- self .ids_map = None
324- self .properties = None
322+ # Return values from raster_plot
323+ self .geom_data = None
324+ self .property_data = None
325325 self .map_view_params = None
326326
327327 self .version = __version__
@@ -499,32 +499,28 @@ def get_active_mesh_material_filter_id(self, view: "PlotView") -> Optional[int]:
499499 return None
500500
501501 def can_reuse_maps (self , view : "PlotView" ):
502- if self .ids_map is None or self .properties is None :
502+ if self .geom_data is None or self .property_data is None :
503503 return False
504504 return self .map_view_params == self .view_params_payload (view )
505505
506506 def makePlot (self , view : Optional ["PlotView" ] = None ,
507- ids_map = None , properties = None ):
508- """ Generate new plot image from active view settings
509-
510- Creates corresponding .xml files from user-chosen settings.
511- Runs OpenMC in plot mode to generate new plot image.
512- """
507+ geom_data = None , property_data = None ):
508+ """Generate new plot image from active view settings"""
513509 if view is None :
514510 view = self .activeView
515511 # update/call maps under 2 circumstances
516- # 1. this is the intial plot (ids_map/properties are None)
512+ # 1. this is the intial plot (geom_data/property_data are None)
517513 # 2. The active (desired) view differs from the current view parameters
518- if ids_map is None or properties is None :
514+ if geom_data is None or property_data is None :
519515 if (self .currentView .view_params != view .view_params ) or \
520- (self .ids_map is None ) or (self .properties is None ):
516+ (self .geom_data is None ) or (self .property_data is None ):
521517 # Determine if we need filter bins for MeshMaterialFilter tally
522518 filter_cpp = None
523519 filter_id = self .get_active_mesh_material_filter_id (view )
524520 if filter_id is not None :
525521 filter_cpp = openmc .lib .filters [filter_id ]
526522
527- self .ids_map , self .properties = openmc .lib .raster_plot (
523+ self .geom_data , self .property_data = openmc .lib .raster_plot (
528524 origin = view .origin ,
529525 width = (view .width , view .height ),
530526 basis = view .basis ,
@@ -535,8 +531,8 @@ def makePlot(self, view: Optional["PlotView"] = None,
535531 )
536532 self .map_view_params = self .view_params_payload (view )
537533 else :
538- self .ids_map = ids_map
539- self .properties = properties
534+ self .geom_data = geom_data
535+ self .property_data = property_data
540536 self .map_view_params = self .view_params_payload (view )
541537
542538 # update current view
@@ -584,15 +580,15 @@ def makePlot(self, view: Optional["PlotView"] = None,
584580 # tally data
585581 self .tally_data = None
586582
587- self .properties [self .properties < 0.0 ] = np .nan
583+ self .property_data [self .property_data < 0.0 ] = np .nan
588584
589- self .temperatures = self .properties [..., _PROPERTY_INDICES ['temperature' ]]
590- self .densities = self .properties [..., _PROPERTY_INDICES ['density' ]]
585+ self .temperatures = self .property_data [..., _PROPERTY_INDICES ['temperature' ]]
586+ self .densities = self .property_data [..., _PROPERTY_INDICES ['density' ]]
591587
592588 minmax = {}
593589 for prop in _MODEL_PROPERTIES :
594590 idx = _PROPERTY_INDICES [prop ]
595- prop_data = self .properties [:, :, idx ]
591+ prop_data = self .property_data [:, :, idx ]
596592 minmax [prop ] = (np .min (np .nan_to_num (prop_data )),
597593 np .max (np .nan_to_num (prop_data )))
598594
@@ -1043,14 +1039,14 @@ def _do_op(array, tally_value, ax=0):
10431039 selected_scores .append (idx )
10441040 data = _do_op (data [np .array (selected_scores )], tally_value )
10451041
1046- # Extract filter bins from ids_map (computed during raster_plot call)
1047- # ids_map has shape (v_res, h_res, 4) when filter was included
1048- if self .ids_map .shape [2 ] < 4 :
1042+ # Extract filter bins from geom_data (computed during raster_plot call)
1043+ # geom_data has shape (v_res, h_res, 4) when filter was included
1044+ if self .geom_data .shape [2 ] < 4 :
10491045 raise RuntimeError (
10501046 "Filter bins not available. Ensure raster_plot was called with "
10511047 "the appropriate filter for MeshMaterialFilter tallies."
10521048 )
1053- bins = self .ids_map [:, :, 3 ]
1049+ bins = self .geom_data [:, :, 3 ]
10541050
10551051 # set image data
10561052 image_data = np .full_like (self .ids , np .nan , dtype = float )
@@ -1065,15 +1061,15 @@ def _do_op(array, tally_value, ax=0):
10651061
10661062 @property
10671063 def cell_ids (self ):
1068- return self .ids_map [:, :, 0 ]
1064+ return self .geom_data [:, :, 0 ]
10691065
10701066 @property
10711067 def instances (self ):
1072- return self .ids_map [:, :, 1 ]
1068+ return self .geom_data [:, :, 1 ]
10731069
10741070 @property
10751071 def mat_ids (self ):
1076- return self .ids_map [:, :, 2 ]
1072+ return self .geom_data [:, :, 2 ]
10771073
10781074
10791075class ViewParam (openmc .lib .plot ._PlotBase ):
0 commit comments