diff --git a/example/sofast_fringe/example_standard_mirror_plot_output.py b/example/sofast_fringe/example_standard_mirror_plot_output.py index a48130552..a9a00e9fc 100644 --- a/example/sofast_fringe/example_standard_mirror_plot_output.py +++ b/example/sofast_fringe/example_standard_mirror_plot_output.py @@ -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 @@ -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 @@ -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 diff --git a/opencsp/common/lib/csp/StandardPlotOutput.py b/opencsp/common/lib/csp/StandardPlotOutput.py index 24622aa1b..a58726a6e 100644 --- a/opencsp/common/lib/csp/StandardPlotOutput.py +++ b/opencsp/common/lib/csp/StandardPlotOutput.py @@ -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 @@ -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 @@ -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)