Skip to content

Commit ec508b8

Browse files
committed
[skip ci] minor change
1 parent f89b18c commit ec508b8

1 file changed

Lines changed: 8 additions & 18 deletions

File tree

litebird_sim/mapmaking/h_maps.py

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,9 @@ def _accumulate_spin_terms_and_build_nobs_matrix(
146146

147147
for cur_pix_idx, cur_psi, cur_hwp_angle in zip(pix, psi, hwp_angle):
148148
info_pix = nobs_matrix[cur_pix_idx]
149-
if hwp_angle is not None:
150-
cos_n_m = np.cos(n * cur_psi + m * cur_hwp_angle)
151-
sin_n_m = np.sin(n * cur_psi + m * cur_hwp_angle)
152-
else:
153-
cos_n_m = np.cos(n * cur_psi)
154-
sin_n_m = np.sin(n * cur_psi)
149+
150+
cos_n_m = np.cos(n * cur_psi + m * cur_hwp_angle)
151+
sin_n_m = np.sin(n * cur_psi + m * cur_hwp_angle)
155152
if (n, m) == (0, 0):
156153
info_pix[0] = (
157154
1 # if n=m=0 we compute the hit count, beceause it is useful to combine h maps later on
@@ -189,22 +186,18 @@ def _build_nobs_matrix(
189186
n: int,
190187
m: int,
191188
nside: int,
192-
obs: Observation,
193-
pointings: npt.ArrayLike,
194189
pixidx: npt.ArrayLike,
195190
polang: npt.ArrayLike,
196-
detector_index: int,
197-
hwp_angle: npt.ArrayLike,
191+
hwp_angle: npt.ArrayLike | None,
198192
time_mask: npt.ArrayLike,
199-
output_coordinate_system: CoordinateSystem,
200-
pointings_dtype=np.float64,
201193

202194
) -> npt.ArrayLike:
203195
"""Build the nobs matrix for all detectors and pixels, it has shape (Npix,3) and contains the accumulated spin terms and hit counts of each pixel for the considered detector."""
204196
n_pix = HealpixMap.nside_to_npix(nside)
205197

206198
nobs_matrix = np.zeros((n_pix, 3))
207-
199+
if hwp_angle is None:
200+
hwp_angle=np.zeros_like(polang)
208201
_accumulate_spin_terms_and_build_nobs_matrix(
209202
n,
210203
m,
@@ -293,6 +286,8 @@ def make_h_maps(
293286

294287
hpx = Healpix_Base(nside, "RING")
295288
hwp_angle = _get_hwp_angle(obs=cur_obs, hwp=hwp, pointing_dtype=pointings_dtype)
289+
# print(np.shape(hwp_angle))
290+
# print(f"size of hwp array: {hwp_angle.nbytes}")
296291
duration=cur_obs.end_time_global
297292
sampling_rate=cur_obs.sampling_rate_hz
298293
pixidx, polang= _compute_pixel_indices_single_detector(
@@ -317,15 +312,10 @@ def make_h_maps(
317312
n,
318313
m,
319314
nside=nside,
320-
obs=cur_obs,
321-
pointings=cur_ptg,
322315
pixidx=pixidx,
323316
polang=polang,
324-
detector_index=idet,
325317
hwp_angle=hwp_angle,
326318
time_mask=cur_t_mask,
327-
output_coordinate_system=output_coordinate_system,
328-
pointings_dtype=pointings_dtype,
329319
)
330320
rhs = _extract_rhs(nobs_matrix)
331321
_solve_binning(nobs_matrix, rhs,n,m)

0 commit comments

Comments
 (0)