Skip to content

Compute pitch angles for telescopes

el_paso.processing.compute_pitch_angles_for_telescopes.compute_pitch_angles_for_telescopes

compute_pitch_angles_for_telescopes

Calculates the particle pitch angles for specific telescope orientations.

This function computes the angle between the local magnetic field vector and the velocity vectors of particles entering the telescopes.

Parameters:

Name Type Description Default
b_tele_aligned Variable

The magnetic field vector already rotated into the sensor-aligned reference frame. Expected to be a time-series array of shape (n_times, 3).

required
tele_alpha_angles Variable

The telescope alpha angles (elevation-like). These are converted to radians internally before processing.

required
tele_beta_angles Variable

The telescope beta angles (azimuth-like). These are converted to radians internally before processing.

required

Returns:

Type Description
Variable

ep.Variable: A variable containing the computed pitch angles in radians. The data shape will be (n_times, n_telescopes).

Notes

We thank Juan V. Rodriguez (University of Colorado CIRES) for his help with the pitch-angle calculations.

Source code in el_paso/processing/compute_pitch_angles_for_telescopes.py
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
def compute_pitch_angles_for_telescopes(
    b_tele_aligned: ep.Variable,
    tele_alpha_angles: ep.Variable,
    tele_beta_angles: ep.Variable,
) -> ep.Variable:
    """Calculates the particle pitch angles for specific telescope orientations.

    This function computes the angle between the local magnetic field vector and the
    velocity vectors of particles entering the telescopes.

    Args:
        b_tele_aligned (ep.Variable): The magnetic field vector already rotated
            into the sensor-aligned reference frame. Expected to be a
            time-series array of shape (n_times, 3).
        tele_alpha_angles (ep.Variable): The telescope alpha angles (elevation-like).
            These are converted to radians internally before processing.
        tele_beta_angles (ep.Variable): The telescope beta angles (azimuth-like).
            These are converted to radians internally before processing.

    Returns:
        ep.Variable: A variable containing the computed pitch angles in radians.
            The data shape will be (n_times, n_telescopes).

    Notes:
        We thank Juan V. Rodriguez (University of Colorado CIRES) for his help with the
        pitch-angle calculations.

    """
    pitch_angle_data = _compute_pitch_angles_for_telescopes(
        b_tele_aligned.get_data().astype(np.float32),
        tele_alpha_angles.get_data(u.rad).astype(np.float32),
        tele_beta_angles.get_data(u.rad).astype(np.float32),
    )

    return ep.Variable(data=pitch_angle_data, original_unit=u.rad)