Skip to content

Commit

Permalink
updated standard mirror output to use resolution class.
Browse files Browse the repository at this point in the history
  • Loading branch information
braden6521 committed Jun 26, 2024
1 parent d0ee70e commit d0efed4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
15 changes: 2 additions & 13 deletions example/sofast_fringe/example_standard_mirror_plot_output.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import os
from os.path import join

from scipy.spatial.transform import Rotation

import opencsp.app.sofast.lib.load_saved_data as lsd
from opencsp.common.lib.csp.LightSourceSun import LightSourceSun
from opencsp.common.lib.csp.StandardPlotOutput import StandardPlotOutput
Expand All @@ -18,9 +16,7 @@ def example_single_facet() -> None:
1. Load Sofast measurement data
2. Define viewing/illumination geometry
3. Create an OpenCSP representation of an ideal facet
4. Create an OpenCSP representation of facet measured by Sofast
5. Create standard output plots:
3. Create standard output plots:
- Perform ray trace of facet
- Plot orthorectified slope maps
- Plot orthorectified slope error map
Expand Down Expand Up @@ -50,14 +46,7 @@ def example_single_facet() -> None:
v_target_normal = Vxyz((0, 0, -1))
source = LightSourceSun.from_given_sun_position(Uxyz((0, 0, -1)), resolution=40)

# 3. Create an OpenCSP representation of an measured/ideal facet
# =====================================================
r = Rotation.identity()
v = Vxyz((0, 0, 0))
optic_meas.set_position_in_space(v, r)
optic_ref.set_position_in_space(v, r)

# 4. Create standard output plots
# 3. Create standard output plots
# ===============================

# Define optics to plot
Expand Down
6 changes: 4 additions & 2 deletions opencsp/common/lib/csp/StandardPlotOutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import opencsp.common.lib.csp.RayTrace as rt
from opencsp.common.lib.csp.RayTraceable import RayTraceable
from opencsp.common.lib.csp.Scene import Scene
from opencsp.common.lib.geometry.RegionXY import Resolution
from opencsp.common.lib.geometry.Uxyz import Uxyz
from opencsp.common.lib.geometry.Vxyz import Vxyz
import opencsp.common.lib.render.figure_management as fm
Expand Down Expand Up @@ -46,7 +47,7 @@ class _OptionsCurvatureVis:
@dataclass
class _OptionsRayTraceVis:
to_ray_trace: bool = True
ray_trace_optic_res: int = 20
ray_trace_optic_res: float = 0.05
hist_bin_res: float = 0.07
hist_extent: float = 3
ensquared_energy_max_semi_width: float = 2
Expand Down Expand Up @@ -525,7 +526,8 @@ def _ray_trace_scene(self, obj: RayTraceable) -> rt.RayTrace:
scene.add_object(obj)

# Trace scene
trace = rt.trace_scene(scene, obj_resolution=self.options_ray_trace_vis.ray_trace_optic_res)
res = Resolution.separation(self.options_ray_trace_vis.ray_trace_optic_res)
trace = rt.trace_scene(scene, obj_resolution=res)

# Calculate intersection with plane
ray_trace = rt.RayTrace(scene)
Expand Down

0 comments on commit d0efed4

Please sign in to comment.