litebird / litebird_sim

Simulation tools for LiteBIRD
GNU General Public License v3.0
19 stars 13 forks source link

HWP angle #336

Closed paganol closed 2 weeks ago

paganol commented 1 month ago

The array stored in observation.hwp_angle (or returned by observation.get_pointings()) contains twice the hwp angle, this has a historical reason and it is related to the way the pointing was handled before. Should we reconsider this behavior, and return just the hwp angle? What do you think, @ziotom78 @sgiardie @nraffuzz @ggalloni? Btw, this is also relevant for the beam convolution module #170. Also the documentation is not very clear on this aspect, and we should clarify this.

@njit
def _get_ideal_hwp_angle(
    output_buffer, start_time_s, delta_time_s, start_angle_rad, ang_speed_radpsec
):
    for sample_idx in range(output_buffer.size):
        angle = (
            start_angle_rad
            + (start_time_s + delta_time_s * sample_idx) * 2 * ang_speed_radpsec
        ) % (2 * np.pi)

        output_buffer[sample_idx] = angle