Skip to content

Commit

Permalink
Changed the plot_ray_intensity argument of `optika.systems.Abstract…
Browse files Browse the repository at this point in the history
…SequentialSystem.plot()` to `plot_rays_vignetted`.
  • Loading branch information
byrdie committed Oct 24, 2023
1 parent 02bd549 commit 8634a10
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions optika/systems.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ def plot(
transformation: None | na.transformations.AbstractTransformation = None,
components: None | tuple[str, ...] = None,
plot_rays: bool = True,
plot_ray_intensity: bool = True,
plot_rays_vignetted: bool = False,
kwargs_rays: None | dict[str, Any] = None,
**kwargs,
) -> na.AbstractScalar | dict[str, na.AbstractScalar]:
Expand Down Expand Up @@ -488,16 +488,16 @@ def plot(
if kwargs_rays is None:
kwargs_rays = dict()

if plot_ray_intensity:
where = True
if not plot_rays_vignetted:
intensity = raytrace.outputs[dict(surface=~0)].intensity
intensity = intensity / intensity.max()
intensity = intensity.to(u.dimensionless_unscaled).value
kwargs_rays["alpha"] = intensity
where = intensity != 0

result["rays"] = na.plt.plot(
raytrace.outputs.position,
ax=ax,
axis=self.axis_surface,
where=where,
transformation=transformation,
components=components,
**kwargs_rays,
Expand Down

0 comments on commit 8634a10

Please sign in to comment.