cosmodesi / pypower

power spectrum and window function estimation
BSD 3-Clause "New" or "Revised" License
17 stars 6 forks source link

restricting window multipoles crashes #22

Open pmcdonal opened 1 year ago

pmcdonal commented 1 year ago

Trying to drop l=2,4 from a window by: W.select_proj(projsout=[0]) I get a crash here https://github.com/cosmodesi/pypower/blob/fdf9471637f9b158aaed96a2702e2d3ae4d06ece/pypower/wide_angle.py#L329 because theory and obs k vectors aren't the same length... doesn't look right, but of course I don't really know what I'm doing... ... I think it gets to that point when it shouldn't because old_projs['out'] has wa_order=None while self.projsout has wa_order = 0 ... maybe?

/global/cfs/cdirs/desi/survey/catalogs/Y1/LSS/iron/LSScats/v0.2/blinded/pk/jmena/wmatrix_smooth_LRG_GCcomb_0.4_1.1_default_FKP_lin.npy

adematti commented 1 year ago

Yes, I know, not very convenient. Indeed:

from pypower import BaseMatrix
fn = '/global/cfs/cdirs/desi/survey/catalogs/Y1/LSS/iron/LSScats/v0.2/blinded/pk/jmena/wmatrix_smooth_LRG_GCcomb_0.4_1.1_default_FKP_lin.npy'

m = BaseMatrix.load(fn)
m.select_proj(projsout=[(0, None)])

should work. or

from pypower import Projection
...
m.select_proj(projsout=[Projection(0, None)])

(I have just added a more explicit message in 8be53565dc4b02d41484c058f92e4b914d4cf255)