Skip to content

Beam

Beam module.

Subclass of Sensor. Used for beam sensors

Beam dataclass

Bases: Sensor

Defines Beam sensor class.

Location attribute from superclass is assumed to be a Coordinate class object containing 2 locations, the first of the sensor and the second of the retro.

Attributes:

Name Type Description
n_beam_knots int

Number of beam knots to evaluate along a single beam

Source code in src/pyelq/sensor/beam.py
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
@dataclass
class Beam(Sensor):
    """Defines Beam sensor class.

    Location attribute from superclass is assumed to be a Coordinate class object containing 2 locations, the first of
    the sensor and the second of the retro.

    Attributes:
        n_beam_knots (int, optional): Number of beam knots to evaluate along a single beam

    """

    n_beam_knots: int = 50

    @property
    def midpoint(self) -> np.ndarray:
        """np.ndarray: Midpoint of the beam."""
        return np.mean(self.location.to_array(), axis=0)

    def make_beam_knots(self, ref_latitude, ref_longitude, ref_altitude=0) -> np.ndarray:
        """Create beam knot locations.

        Creates beam knot locations based on location attribute and n_beam_knot attribute.
        Results in an array of beam knot locations of shape [n_beam_knots x 3]. Have to provide a reference point in
        order to create the beam knots in a local frame, spaced in meters

        Args:
            ref_latitude (float): Reference latitude in degrees
            ref_longitude (float): Reference longitude in degrees
            ref_altitude (float, optional): Reference altitude in meters

        """
        temp_location = self.location.to_enu(
            ref_latitude=ref_latitude, ref_longitude=ref_longitude, ref_altitude=ref_altitude
        ).to_array()
        beam_knot_array = np.linspace(temp_location[0, :], temp_location[1, :], num=self.n_beam_knots, endpoint=True)
        return beam_knot_array

midpoint: np.ndarray property

np.ndarray: Midpoint of the beam.

make_beam_knots(ref_latitude, ref_longitude, ref_altitude=0)

Create beam knot locations.

Creates beam knot locations based on location attribute and n_beam_knot attribute. Results in an array of beam knot locations of shape [n_beam_knots x 3]. Have to provide a reference point in order to create the beam knots in a local frame, spaced in meters

Parameters:

Name Type Description Default
ref_latitude float

Reference latitude in degrees

required
ref_longitude float

Reference longitude in degrees

required
ref_altitude float

Reference altitude in meters

0
Source code in src/pyelq/sensor/beam.py
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
def make_beam_knots(self, ref_latitude, ref_longitude, ref_altitude=0) -> np.ndarray:
    """Create beam knot locations.

    Creates beam knot locations based on location attribute and n_beam_knot attribute.
    Results in an array of beam knot locations of shape [n_beam_knots x 3]. Have to provide a reference point in
    order to create the beam knots in a local frame, spaced in meters

    Args:
        ref_latitude (float): Reference latitude in degrees
        ref_longitude (float): Reference longitude in degrees
        ref_altitude (float, optional): Reference altitude in meters

    """
    temp_location = self.location.to_enu(
        ref_latitude=ref_latitude, ref_longitude=ref_longitude, ref_altitude=ref_altitude
    ).to_array()
    beam_knot_array = np.linspace(temp_location[0, :], temp_location[1, :], num=self.n_beam_knots, endpoint=True)
    return beam_knot_array