Skip to content

Commit

Permalink
undo last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
RemDelaporteMathurin committed Jun 22, 2022
1 parent 92d633d commit 929e355
Showing 1 changed file with 31 additions and 13 deletions.
44 changes: 31 additions & 13 deletions regular_mesh_plotter/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
def plot_regular_mesh_values(
values: np.ndarray,
filename: Optional[str] = None,
scale=None, # LogNorm(),
vmin=None,
label="",
title=None,
base_plt=None,
extent=None,
x_label="X [cm]",
y_label="Y [cm]",
rotate_plot: float = 0,
**kwargs
):

if base_plt:
Expand All @@ -41,10 +42,17 @@ def plot_regular_mesh_values(
rot = transforms.Affine2D().rotate_deg_around(x_center, y_center, rotate_plot)

image_map = plt.imshow(
values, extent=extent, transform=rot + base, origin="lower", **kwargs
values,
norm=scale,
vmin=vmin,
extent=extent,
transform=rot + base,
origin="lower",
)
else:
image_map = plt.imshow(values, extent=extent, origin="lower", **kwargs)
image_map = plt.imshow(
values, norm=scale, vmin=vmin, extent=extent, origin="lower"
)

plt.xlabel(x_label)
plt.ylabel(y_label)
Expand All @@ -62,6 +70,8 @@ def plot_regular_mesh_values_with_geometry(
values: np.ndarray,
dagmc_file_or_trimesh_object,
filename: Optional[str] = None,
scale=None, # LogNorm(),
vmin=None,
label="",
title=None,
extent=None,
Expand All @@ -71,7 +81,6 @@ def plot_regular_mesh_values_with_geometry(
plane_normal: List[float] = [0, 0, 1],
rotate_mesh: float = 0,
rotate_geometry: float = 0,
**kwargs
):

slice = dgsp.plot_slice_of_dagmc_geometry(
Expand All @@ -84,14 +93,15 @@ def plot_regular_mesh_values_with_geometry(
both = plot_regular_mesh_values(
values=values,
filename=filename,
scale=scale, # LogNorm(),
vmin=vmin,
label=label,
title=title,
base_plt=slice,
extent=extent,
x_label=x_label,
y_label=y_label,
rotate_plot=rotate_mesh,
**kwargs
)

return both
Expand All @@ -102,6 +112,8 @@ def plot_regular_mesh_tally_with_geometry(
dagmc_file_or_trimesh_object,
std_dev_or_tally_value="tally_value",
filename: Optional[str] = None,
scale=None, # LogNorm(),
vmin=None,
label="",
title=None,
x_label="X [cm]",
Expand All @@ -112,7 +124,6 @@ def plot_regular_mesh_tally_with_geometry(
rotate_geometry: float = 0,
required_units=None,
source_strength: float = None,
**kwargs
):

if required_units is not None:
Expand All @@ -136,14 +147,15 @@ def plot_regular_mesh_tally_with_geometry(
plot = plot_regular_mesh_values(
values=value,
filename=filename,
scale=scale,
vmin=vmin,
label=label,
title=title,
base_plt=base_plt,
extent=extent,
x_label=x_label,
y_label=y_label,
rotate_plot=rotate_mesh,
**kwargs
)

return plot
Expand All @@ -152,6 +164,8 @@ def plot_regular_mesh_tally_with_geometry(
def plot_regular_mesh_tally(
tally,
filename: Optional[str] = None,
scale=None, # LogNorm(),
vmin=None,
label="",
title=None,
base_plt=None,
Expand All @@ -161,7 +175,6 @@ def plot_regular_mesh_tally(
required_units: str = None,
source_strength: float = None,
std_dev_or_tally_value="tally_value",
**kwargs
):

if required_units is not None:
Expand All @@ -180,14 +193,15 @@ def plot_regular_mesh_tally(
plot = plot_regular_mesh_values(
values=value,
filename=filename,
scale=scale,
vmin=vmin,
label=label,
title=title,
base_plt=base_plt,
extent=extent,
x_label=x_label,
y_label=y_label,
rotate_plot=rotate_plot,
**kwargs
)

return plot
Expand All @@ -196,6 +210,8 @@ def plot_regular_mesh_tally(
def plot_regular_mesh_dose_tally(
tally,
filename: Optional[str] = None,
scale=None, # LogNorm(),
vmin=None,
label="",
title=None,
base_plt=None,
Expand All @@ -205,7 +221,6 @@ def plot_regular_mesh_dose_tally(
required_units="picosievert / source_particle",
source_strength: float = None,
std_dev_or_tally_value: str = "tally_value",
**kwargs
):

if required_units is not None:
Expand All @@ -224,14 +239,15 @@ def plot_regular_mesh_dose_tally(
plot = plot_regular_mesh_values(
values=value,
filename=filename,
scale=scale,
vmin=vmin,
label=label,
title=title,
base_plt=base_plt,
extent=extent,
x_label=x_label,
y_label=y_label,
rotate_plot=rotate_plot,
**kwargs
)

return plot
Expand All @@ -241,6 +257,8 @@ def plot_regular_mesh_dose_tally_with_geometry(
tally,
dagmc_file_or_trimesh_object,
filename: Optional[str] = None,
scale=None, # LogNorm(),
vmin=None,
label="",
title=None,
x_label="X [cm]",
Expand All @@ -252,7 +270,6 @@ def plot_regular_mesh_dose_tally_with_geometry(
required_units="picosievert / source_particle",
source_strength: float = None,
std_dev_or_tally_value: str = "tally_value",
**kwargs
):

slice = dgsp.plot_slice_of_dagmc_geometry(
Expand All @@ -265,6 +282,8 @@ def plot_regular_mesh_dose_tally_with_geometry(
both = plot_regular_mesh_dose_tally(
tally=tally,
filename=filename,
scale=scale, # LogNorm(),
vmin=vmin,
label=label,
title=title,
base_plt=slice,
Expand All @@ -274,7 +293,6 @@ def plot_regular_mesh_dose_tally_with_geometry(
required_units=required_units,
source_strength=source_strength,
std_dev_or_tally_value=std_dev_or_tally_value,
**kwargs
)

return both

0 comments on commit 929e355

Please sign in to comment.