From a3d68918cc3910e78db43d506921e7b94569541e Mon Sep 17 00:00:00 2001 From: Evan Harvey Date: Tue, 7 Jan 2025 11:56:00 -0700 Subject: [PATCH] Address feedback --- opencsp/common/lib/csp/LightPathEnsemble.py | 16 ----- opencsp/common/lib/csp/RayTrace.py | 68 -------------------- opencsp/common/lib/csp/StandardPlotOutput.py | 2 +- 3 files changed, 1 insertion(+), 85 deletions(-) diff --git a/opencsp/common/lib/csp/LightPathEnsemble.py b/opencsp/common/lib/csp/LightPathEnsemble.py index 5429aac10..703e6df27 100644 --- a/opencsp/common/lib/csp/LightPathEnsemble.py +++ b/opencsp/common/lib/csp/LightPathEnsemble.py @@ -190,19 +190,3 @@ def concatenate(self: 'LightPathEnsemble', lpe1: 'LightPathEnsemble'): new_lpe.points_lists = self.points_lists + (lpe1.points_lists) new_lpe.colors = self.colors + (lpe1.colors) return new_lpe - - def asLightPathList(self) -> list[LightPath]: - """ - Converts the ensemble into a list of LightPath objects. - - Returns - ------- - list[LightPath] - A list of LightPath objects constructed from the ensemble's data. - """ - # "ChatGPT 4o-mini" assisted with generating this docstring. - lps: list[LightPath] = [] - for cd, id, pl in zip(self.current_directions, self.init_directions, self.points_lists): - lp = LightPath(pl, id, cd) - lps.append(lp) - return lps diff --git a/opencsp/common/lib/csp/RayTrace.py b/opencsp/common/lib/csp/RayTrace.py index 1c5f9db1f..12446f88a 100644 --- a/opencsp/common/lib/csp/RayTrace.py +++ b/opencsp/common/lib/csp/RayTrace.py @@ -788,74 +788,6 @@ def trace_scene_parallel( return ray_trace -def plane_intersect_OLD( - ray_trace: RayTrace, v_plane_center: Vxyz, u_plane_norm: Uxyz, epsilon: float = 1e-6, verbose=False -) -> Vxy: - """ - Calculates the intersection points of light paths with a specified plane. - - This method is deprecated and may be removed in future versions. - - Parameters - ---------- - ray_trace : RayTrace - The RayTrace object containing the light paths. - v_plane_center : Vxyz - The center point of the plane. - u_plane_norm : Uxyz - The normal vector of the plane. - epsilon : float, optional - The threshold for determining if a ray is parallel to the plane (default is 1e-6). - verbose : bool, optional - If True, prints execution status (default is False). - - Returns - ------- - Vxy - The intersection points in the local plane XY reference frame. - - Notes - ----- - This method is deprecated. Use the `plane_intersect` function instead. - """ - # "ChatGPT 4o-mini" assisted with generating this docstring. - if verbose: - tot = len(ray_trace.light_paths) - ten_percent = np.ceil(tot / 10) - checkpoints = [n * ten_percent for n in range(10)] - - points_list = [] - - for idx, lp in enumerate(ray_trace.light_paths): - # Intersect if not parallel or hitting from behind - u = lp.current_direction - d = Vxyz.dot(u, u_plane_norm) - if np.abs(d) > epsilon: - p0 = lp.points_list[-1] - w = p0 - v_plane_center - fac = -Vxyz.dot(u_plane_norm, w) / d - v = u * fac - points_list.append(p0 + v) - # Print output - if verbose and idx in checkpoints: - print(f"{idx / tot:.2%} through finding intersections") - - # Merge into one Vxyz object - if verbose: - print("Merging vectors.") - intersection_points = Vxyz.merge(points_list) - - # Make relative to plane center - if verbose: - print("Rotating.") - intersection_points -= v_plane_center - intersection_points.rotate_in_place(u_plane_norm.align_to(Vxyz((0, 0, 1)))) - - if verbose: - print("Plane intersections caluculated.") - return intersection_points.projXY() - - def plane_intersect( ray_trace: RayTrace, v_plane_center: Vxyz, diff --git a/opencsp/common/lib/csp/StandardPlotOutput.py b/opencsp/common/lib/csp/StandardPlotOutput.py index e50b3a126..67165bc81 100644 --- a/opencsp/common/lib/csp/StandardPlotOutput.py +++ b/opencsp/common/lib/csp/StandardPlotOutput.py @@ -1,4 +1,4 @@ -"""Class used to display/save the suite of standard output plots after measuring a COutSP Mirror/FacetEnsemble. +"""Class used to display/save the suite of standard output plots after measuring a CSP Mirror/FacetEnsemble. """ from dataclasses import dataclass, field