galsci / pysm

PySM 3: Sky emission simulations for Cosmic Microwave Background experiments
https://pysm3.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
33 stars 23 forks source link

Provide a target_nside parameter to the smoothing function #91

Closed zonca closed 1 year ago

zonca commented 2 years ago

Originally posted by @zonca in https://github.com/galsci/pysm/issues/90#issuecomment-947830102

zonca commented 2 years ago

I'm already doing map2alm and alm2map in:

https://github.com/galsci/pysm/blob/main/pysm3/models/template.py#L99-L152

so it is as easy as providing an extra parameter target_nside and use that for alm2map

zonca commented 2 years ago

from @seclark:

Would make sense to me to let people configure this (with guidelines) but default to running at 2048 for output maps with N_side <= 1024, and default to run at 2*N_side for output maps with 1024 <= N_side<= 4096. i.e., default to our recommended choices.

zonca commented 2 years ago

suggestion my Martin Reinecke, what if we used Gauss Legendre (GL) pixelization internally?

https://github.com/galsci/pysm/issues/92#issuecomment-948962496

So:

I anyone used GL pixelization before, please jump in. Otherwise, I'll give it a try myself using ducc

zonca commented 2 years ago

thanks to @mreineck providing an example of using ducc0 and GL pixels, I made a comparison focused on PySM, I posted the notebook here where it is a bit easier to read (click on button to get the notebook and try it yourself):

https://zonca.dev/2021/11/healpix-gauss-legendre-pysm.html

mreineck commented 2 years ago

Good to see that this works well!

Just one word of caution: since the rings of a GL grid are not equidistant in theta, the GL map plots in the notebook can only be a rough approximantion to the real map; doing this accurately requires using the exact coordinates of every ring (obtainable, e.g., via ducc0.misc.GL_thetas()) and telling them to matplotlib.

zonca commented 2 years ago

will try with a more anisotropic map, for example the GNILC dust maps after adding small scales (#97), which is one of our use cases. We want to verify if error in HEALPix goes higher in such maps.

zonca commented 1 year ago

@seclark @brandonshensley I have added a section in the docs about dealing with Nside, see the commit reference above here.