Skip to content

Commit

Permalink
mapmaking fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
paganol committed Nov 4, 2024
1 parent 5f96d92 commit fc1503e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion litebird_sim/mapmaking/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def _compute_pixel_indices(
if output_coordinate_system == CoordinateSystem.Galactic:
curr_pointings_det = rotate_coordinates_e2g(curr_pointings_det)

polang_all[idet] = curr_pointings_det[:, 2] + hwp_angle
polang_all[idet] = curr_pointings_det[:, 2] + 2 * hwp_angle

pixidx_all[idet] = hpx.ang2pix(curr_pointings_det[:, :2])

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ include = [

[tool.poetry.dependencies]
python = ">=3.9,<3.13"
numba = "^0.60.0"
numba = "^0.57.1"
numpy = "^1.24"
astropy = "5.3.4"
tomlkit = "^0.12.1"
Expand Down
7 changes: 6 additions & 1 deletion test/test_scanning.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,15 @@ def test_simulation_pointings_hwp_mjd(tmp_path):
pointings_and_orientation, hwp_angle = obs.get_pointings("all")

pointings_and_orientation[..., 2] += 2 * hwp_angle
pointings_and_orientation[..., 2] = np.mod(
pointings_and_orientation[..., 2], 2 * np.pi
)

filename = Path(__file__).parent / f"reference_obs_pointings_hwp{idx:03d}.npy"
reference = np.load(filename, allow_pickle=False)
assert np.allclose(pointings_and_orientation, reference)
reference[..., 2] = np.mod(reference[..., 2], 2 * np.pi)

assert np.allclose(pointings_and_orientation, reference, rtol=1e-5)


def test_scanning_quaternions(tmp_path):
Expand Down
19 changes: 10 additions & 9 deletions test/test_simulations.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,17 +520,18 @@ def test_smart_pointings_angles(tmp_path):
desired=np.array(
[
5.0,
0.71681469,
2.71681469,
4.71681469,
0.43362939,
2.43362939,
4.43362939,
0.15044408,
2.15044408,
4.15044408,
6.0,
0.716815,
1.716815,
2.716815,
3.716815,
4.716815,
5.716815,
0.433629,
1.433629,
]
),
rtol=1e-6,
)


Expand Down

0 comments on commit fc1503e

Please sign in to comment.