Skip to content

Commit

Permalink
fixed pattern2cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
tf17270 committed Apr 26, 2024
1 parent f4668fb commit cb3532e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions lyceanem/base_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ def __init__(
self.arbitary_pattern_format = arbitary_pattern_format
antenna_pattern_import_implemented = False
assert antenna_pattern_import_implemented
## needs implementing
self.import_pattern(file_location)
self.field_radius = 1.0
else:
Expand Down
1 change: 1 addition & 0 deletions lyceanem/electromagnetics/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def antenna_pattern_source(radius, import_antenna=False, antenna_file=None):
if import_antenna:
# import antenna pattern
pattern = antenna_pattern()
## import the pattern not implemented
pattern.import_pattern(antenna_file)
pattern.field_radius = radius
else:
Expand Down
16 changes: 15 additions & 1 deletion lyceanem/raycasting/rayfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,20 @@ def integratedRaycaster(ray_index, scattering_points, environment_local):

return final_index


# @njit
def patterntocloud(pattern_data, shell_coords, maxarea):
# takes the pattern_data and shell_coordinates, and creates an open3d point cloud based upon the data.
point_cloud = points2pointcloud(shell_coords)
points, elements = np.shape(pattern_data)
# normdata
viridis = cm.get_cmap("viridis", 40)
visible_elements = np.sum(pattern_data / maxarea, axis=1)
np_colors = viridis(visible_elements)
point_cloud.point_data["red"] = np_colors[:, 0]
point_cloud.point_data["green"] = np_colors[:, 1]
point_cloud.point_data["blue"] = np_colors[:, 2]

return point_cloud
def visiblespace(
source_coords,
source_normals,
Expand Down Expand Up @@ -468,6 +481,7 @@ def patterncreator(az_range, elev_range, source_coords, pointingindex, hit_index
return visible_patterns



def quickpatterncreator(
az_range, elev_range, source_coords, angles, vertex_area, hit_index
):
Expand Down

0 comments on commit cb3532e

Please sign in to comment.