hpc4cmb / toast

Time Ordered Astrophysics Scalable Tools
Other
44 stars 39 forks source link

Maybe a bug in crosslinking in toast3 #720

Open chervias opened 11 months ago

chervias commented 11 months ago

I think there might be a bug in the crosslinking operator for toast3. I have tested with 3.0.0a20 and 3.0.0a20.dev12. In this line I get the error Proc 0: ValueError: NumPy boolean array indexing assignment cannot assign 14739 input values to the 2053 output values where the mask is true. dtheta, dphi, tiny and ang are numpy arrays with the same shape N, however, you are trying to set all the elements of ang where tiny is true to an array with shape N, and presumably the number of elements in tiny that are true will be always smaller than N. If I replace this line with ang[tiny] = np.sign(dtheta[tiny]) * np.sign(dphi[tiny]) * np.pi / 2, then it works as it should I think.