Skip to content

Commit 2126bb7

Browse files
committed
Updating relative error units. Some other small typos too
1 parent d624a39 commit 2126bb7

2 files changed

Lines changed: 14 additions & 15 deletions

File tree

openmc_plotter/main_window.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ def openStatePoint(self):
521521
except (FileNotFoundError, OSError):
522522
message = 'Error opening statepoint file: {}'
523523
msg_box = QMessageBox()
524-
msg = "Could open statepoint file: \n\n {} \n"
524+
msg = "Could not open statepoint file: \n\n {} \n"
525525
msg_box.setText(msg.format(filename))
526526
msg_box.setIcon(QMessageBox.Warning)
527527
msg_box.setStandardButtons(QMessageBox.Ok)
@@ -628,7 +628,7 @@ def editColorBy(self, domain_kind, apply=False):
628628
self.applyChanges()
629629

630630
def editUniverseLevel(self, level, apply=False):
631-
if level == 'all':
631+
if level in ('all', ''):
632632
self.model.activeView.level = -1
633633
else:
634634
self.model.activeView.level = int(level)
@@ -1047,7 +1047,7 @@ def restoreModelSettings(self):
10471047
self.model.statepoint = model.statepoint
10481048
except OSError:
10491049
msg_box = QMessageBox()
1050-
msg = "Could open statepoint file: \n\n {} \n"
1050+
msg = "Could not open statepoint file: \n\n {} \n"
10511051
msg_box.setText(msg.format(self.model.statepoint.filename))
10521052
msg_box.setIcon(QMessageBox.Warning)
10531053
msg_box.setStandardButtons(QMessageBox.Ok)

openmc_plotter/plotmodel.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -328,14 +328,14 @@ def create_tally_image(self, view=None):
328328
scores,
329329
nuclides,
330330
view)
331-
image_data = np.divide(std_dev_data[0],
332-
mean_data[0],
333-
out=np.zeros_like(mean_data[0]),
334-
where=mean_data != 0)
331+
image_data = 100 * np.divide(std_dev_data[0],
332+
mean_data[0],
333+
out=np.zeros_like(mean_data[0]),
334+
where=mean_data != 0)
335335
extents = mean_data[1]
336336
data_min = np.min(image_data)
337337
data_max = np.max(image_data)
338-
return image_data, extents, data_min, data_max, units_out
338+
return image_data, extents, data_min, data_max, '% error'
339339

340340
else:
341341
image = self._create_tally_mesh_image(tally,
@@ -353,15 +353,15 @@ def create_tally_image(self, view=None):
353353
scores,
354354
nuclides,
355355
view)
356-
dev_data = self._create_tally_domain_image(tally,
356+
std_dev_data = self._create_tally_domain_image(tally,
357357
'std_dev',
358358
scores,
359359
nuclides,
360360
view)
361-
image_data = np.divide(std_dev_data[0],
362-
mean_data[0],
363-
out=np.zeros_like(mean_data[0]),
364-
where=mean_data != 0)
361+
image_data = 100 * np.divide(std_dev_data[0],
362+
mean_data[0],
363+
out=np.zeros_like(mean_data[0]),
364+
where=mean_data != 0)
365365
# adjust for NaNs in bins without tallies
366366
image_data = np.nan_to_num(image_data,
367367
nan=0.0,
@@ -370,7 +370,7 @@ def create_tally_image(self, view=None):
370370
extents = mean_data[1]
371371
data_min = np.min(image_data)
372372
data_max = np.max(image_data)
373-
return image_data, extents, data_min, data_max, units_out
373+
return image_data, extents, data_min, data_max, '% error'
374374
else:
375375
image = self._create_tally_domain_image(tally,
376376
tally_value,
@@ -383,7 +383,6 @@ def _create_tally_domain_image(self, tally, tally_value, scores, nuclides, view=
383383
# data resources used throughout
384384
if view is None:
385385
view = self.currentView
386-
sp = self.statepoint
387386

388387
data = tally.get_reshaped_data(tally_value)
389388
data_out = np.full(self.ids.shape, -1.0)

0 commit comments

Comments
 (0)