LyceanEM Base

class lyceanem.base_classes.antenna_pattern(azimuth_resolution=37, elevation_resolution=37, pattern_frequency=1000000000.0, arbitary_pattern=False, arbitary_pattern_type='isotropic', arbitary_pattern_format='Etheta/Ephi', file_location=None)[source]

Antenna Pattern class which allows for patterns to be handled consistently across LyceanEM and other modules. The definitions assume that the pattern axes are consistent with the global axes set. If a different orientation is required, such as a premeasured antenna in a new orientation then the pattern rotate_function must be used.

Antenna Pattern Frequency is in Hz Rotation Offset is Specified in terms of rotations around the x, y, and z axes as roll,pitch/elevation, and azimuth in radians.

cartesian_points()[source]

exports the cartesian points for all pattern points.

directivity()[source]
Returns:

  • Dtheta (numpy array) – directivity for Etheta farfield

  • Dphi (numpy array) – directivity for Ephi farfield

  • Dtotal (numpy array) – overall directivity pattern

  • Dmax (numpy array) – the maximum directivity for each pattern

display_pattern(plottype='Polar', desired_pattern='both', pattern_min=-40, plot_max=0, plotengine='matplotlib')[source]

Displays the Antenna Pattern using lyceanem.electromagnetics.beamforming.PatternPlot()

Parameters:
  • plottype (str) – the plot type, either [Polar], [Cartesian-Surf], or [Contour]. The default is [Polar]

  • desired_pattern (str) – the desired pattern, default is [both], but is Pattern format is ‘Etheta/Ephi’ then options are [Etheta] or [Ephi], and if Pattern format is ‘ExEyEz’, then options are [Ex], [Ey], or [Ez].

  • pattern_min (float) – the desired scale minimum in dB, the default is [-40]

Return type:

None

export_pyvista_object()[source]

Return Antenna Pattern as a PyVista Structured Mesh Data Object

initilise_pattern()[source]

pattern initialisation function, providing an isotopic pattern or quasi-isotropic pattern

Return type:

Populated antenna pattern

resample_pattern(old_points, old_pattern, new_points)[source]
Parameters:
  • old_points (float xyz) – xyz coordinates that the pattern has been sampled at

  • old_pattern (2 or 3 by n complex array of the antenna pattern at the old_poitns) – DESCRIPTION.

  • new_points (desired_grid points in xyz float array) – DESCRIPTION.

Return type:

new points, new_pattern

resample_pattern_angular(new_azimuth_resolution, new_elevation_resolution)[source]

resample pattern based upon provided azimuth and elevation resolution

rotate_pattern(rotation_matrix=None)[source]

Rotate the self pattern from the assumed global axes into the new direction

Parameters:

new_axes (3x3 numpy float array) – the new vectors for the antenna x,y,z axes

Returns:

  • Updates self.pattern with the new pattern reflecting the antenna

  • orientation within the global models

transmute_pattern(desired_format='Etheta/Ephi')[source]

convert the pattern from Etheta/Ephi format to Ex, Ey,Ez format, or back again

class lyceanem.base_classes.antenna_structures(structures, points)[source]

Dedicated class to store information on a specific antenna, including aperture points as open3d.geometry.PointCloud data structures, and structure shapes as open3d.geometry.TriangleMesh data structures. Everything in the class will be considered an integrated unit, rotating and moving together. This inherits functions from the structures and points classes.

This class will be developed to include material parameters to enable more complex modelling.

Units should be SI, metres

pyvista_export()[source]

Export the aperture points and structures as easy to visualize pyvista objects.

Returns:

  • aperture_meshes (list) – aperture meshes included in the antenna structure class

  • structure_meshes (list) – list of the triangle mesh objects in the antenna structure class

class lyceanem.base_classes.array_pattern(azimuth_resolution=37, elevation_resolution=37, pattern_frequency=1000000000.0, arbitary_pattern=False, arbitary_pattern_type='isotropic', arbitary_pattern_format='Etheta/Ephi', position_mapping=array([0., 0., 0.], dtype=float32), rotation_offset=array([0., 0., 0.], dtype=float32), elements=2)[source]

Array Pattern class which allows for patterns to be handled consistently across LyceanEM and other modules. The definitions assume that the pattern axes are consistent with the global axes set. If a different orientation is required, such as a premeasured antenna in a new orientation then the pattern rotate_function must be used.

Antenna Pattern Frequency is in Hz Rotation Offset is Specified in terms of rotations around the x, y, and z axes as roll,pitch/elevation, and azimuth in radians.

cartesian_points()[source]

exports the cartesian points for all pattern points.

directivity()[source]
Returns:

  • Dtheta (numpy array) – directivity for Etheta farfield

  • Dphi (numpy array) – directivity for Ephi farfield

  • Dtotal (numpy array) – overall directivity pattern

  • Dmax (numpy array) – the maximum directivity for each pattern

display_pattern(plottype='Polar', desired_pattern='both', pattern_min=-40)[source]

Displays the Antenna Array Pattern using lyceanem.electromagnetics.beamforming.PatternPlot() and the stored weights

Parameters:
  • plottype (str) – the plot type, either [Polar], [Cartesian-Surf], or [Contour]. The default is [Polar]

  • desired_pattern (str) – the desired pattern, default is [both], but is Pattern format is ‘Etheta/Ephi’ then options are [Etheta] or [Ephi], and if Pattern format is ‘ExEyEz’, then options are [Ex], [Ey], or [Ez].

  • pattern_min (float) – the desired scale minimum in dB, the default is [-40]

Return type:

None

initilise_pattern()[source]

pattern initialisation function, providing an isotopic pattern or quasi-isotropic pattern

Return type:

Populated antenna pattern

class lyceanem.base_classes.points(points=None)[source]

Structure class to store information about the geometry and materials in the environment, holding the seperate shapes as open3d.geometry.TriangleMesh data structures. Everything in the class will be considered an integrated unit, rotating and moving together. This class will be developed to include material parameters to enable more complex modelling.

Units should be SI, metres

This is the default class for passing structures to the different models.

add_points(new_points)[source]

adds a component or components from the structure

Parameters:

new_points (open3d.geometry.PointCloud) – the point cloud to be added to the point cloud collection

Return type:

None

export_points(point_index=None)[source]

combines all the points in the collection as a combined point cloud for modelling

Return type:

combined points

remove_points(deletion_index)[source]

removes a component or components from the class

Parameters:

deletion_index (list) – list of integers or numpy array of integers to the solids to be removed

Return type:

None

rotate_points(rotation_vector, rotation_centre=array([[0.], [0.], [0.]], dtype=float32))[source]

rotates the components of the structure around a common point, default is the origin

Parameters:
  • rotation_matrix (open3d rotation vector) – 3,1numpy array

  • rotation_centre (1*3 numpy float array) – centre of rotation for the structures

Return type:

None

translate_points(vector)[source]

translates the point clouds in the class by the given cartesian vector (x,y,z)

Parameters:

vector (1*3 numpy array of floats) – The desired translation vector for the structures

Return type:

None

class lyceanem.base_classes.structures(solids=None)[source]

Structure class to store information about the geometry and materials in the environment, holding the seperate shapes as open3d.geometry.TriangleMesh data structures. Everything in the class will be considered an integrated unit, rotating and moving together. This class will be developed to include material parameters to enable more complex modelling.

Units should be SI, metres

This is the default class for passing structures to the different models.

add_structure(new_solids)[source]

adds a component or components from the structure

Parameters:

new_solids (open3d.geometry.TriangleMesh) – the solid to be added to the structure

Return type:

None

remove_structure(deletion_index)[source]

removes a component or components from the class

Parameters:

deletion_index (list) – list of integers or numpy array of integers to the solids to be removed

Return type:

None

rotate_structures(rotation_matrix, rotation_centre=array([[0.], [0.], [0.]], dtype=float32))[source]

rotates the components of the structure around a common point, default is the origin

Parameters:
  • rotation_matrix (numpy array of appropriate shape (4,4)) –

  • rotation_centre (1*3 numpy float array) – centre of rotation for the structures

Return type:

None

translate_structures(vector)[source]

translates the structures in the class by the given cartesian vector (x,y,z)

Parameters:

vector (1*3 numpy array of floats) – The desired translation vector for the structures

Return type:

None

triangles_base_raycaster()[source]

generates the triangles for all the open3d.geometry.TriangleMesh objects in the structure, and outputs them as a continuous array of triangle_t format triangles

Parameters:

None

Returns:

triangles – a continuous array of all the triangles in the structure

Return type:

N by 1 numpy array of triangle_t triangles