Skip to content

Commit ccf151a

Browse files
committed
Correct polang offset mistake in derivatives_weights
1 parent 5f8fd79 commit ccf151a

File tree

1 file changed

+9
-24
lines changed

1 file changed

+9
-24
lines changed

src/toast/ops/derivatives_weights.py

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ def _exec(self, data, detectors=None, use_accel=None, **kwargs):
233233
# FIXME: temporary hack until instrument classes are also pre-staged
234234
# to GPU
235235
focalplane = ob.telescope.focalplane
236+
focalplane.detector_data
236237
#Get the boresight pointing
237238
qbore = ob.shared["boresight_radec"]
238239
nsamp = len(qbore)
@@ -241,37 +242,21 @@ def _exec(self, data, detectors=None, use_accel=None, **kwargs):
241242
psi = np.empty(nsamp)
242243
# Get the per-detector pointing for orientation/sine theta purposes
243244
for idet, d in enumerate(dets):
244-
if idet==0:
245-
log.info_rank(f"Keys in the detector {d}: {focalplane[d].keys()}", data.comm.comm_world)
246-
247245
theta, _, psi = to_iso_angles(mult(qbore, focalplane[d]["quat"]))
246+
psi -= focalplane[d]["pol_angle"].value
248247
wc = np.cos(psi)
249248
wc2 = np.cos(2*psi)
250249
ws = np.sin(psi)
251250
ws2 = np.sin(2*psi)
252251
inv_tan_theta = np.cos(theta)/np.sin(theta)
253252
# Get the per-detector calibration. For now we sidestep with the Nones
254-
cal = focalplane[d].get("cal")
255-
fwhm = focalplane[d].get("fwhm")
256-
dx = focalplane[d].get("dx")
257-
dy = focalplane[d].get("dy")
258-
dsigma = focalplane[d].get("dsigma")
259-
dp = focalplane[d].get("dp")
260-
dc = focalplane[d].get("dc")
261-
if cal is None:
262-
cal = 1.0
263-
if fwhm is None:
264-
fwhm = np.radians(10./60.)
265-
if dx is None:
266-
dx = 0.0
267-
if dy is None:
268-
dy = 0.0
269-
if dsigma is None:
270-
dsigma = 0.0
271-
if dp is None:
272-
dp = 0.0
273-
if dc is None:
274-
dc = 0.0
253+
cal = focalplane[d].get("cal", 1.0)
254+
fwhm = focalplane[d].get("FWHM", 1.4*u.arcmin).to(u.rad).value
255+
dx = focalplane[d].get("dx", 0.0)
256+
dy = focalplane[d].get("dy", 0.0)
257+
dsigma = focalplane[d].get("dsigma", 0.0)
258+
dp = focalplane[d].get("dp", 0.0)
259+
dc = focalplane[d].get("dc", 0.0)
275260

276261
b_std = fwhm/np.sqrt(8*np.log(2)) #beam standard deviation
277262

0 commit comments

Comments
 (0)