Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

websky extragalactic models #129

Merged
merged 34 commits into from
Nov 8, 2022
Merged

websky extragalactic models #129

merged 34 commits into from
Nov 8, 2022

Conversation

xzackli
Copy link
Contributor

@xzackli xzackli commented Oct 26, 2022

This commit contains a basic interface for accessing extragalactic models from websky, like in so_pysm_models.

  • I've removed the mention of E/C coordinates and the special case of nside \leq 512 for now
  • radio galaxies are exactly like CIB
  • I haven't finished validating the SZ yet, will push it soon
  • testing these with a www folder on the CITA cluster for now, should be simple to paste them into the models directory at NERSC when merging

There's an important detail for the SZ: the sky map is not band-limited due to the cuspy nature of the halos, and this has been shown to cause issues at the 10% level. It would be better if I could supply a map generated in real space with a fiducial 1 arcmin beam, and provide an interface for reconvolving a user-supplied beam. I don't think this will make it into DC-1.

@marcelo-alvarez
Copy link

marcelo-alvarez commented Oct 26, 2022

Thanks a lot for this @xzackli!

There is some mitigation of the SZ maps not being band-limited through normalization of the overall profile to preserve the total y-distortion of each halo and be consistent with the pixel window function when halos are poorly resolved, but there are some residual effects as you describe that will hopefully be addressed in subsequent updates.

It's likely there will be some re-scaling of CIB in order to reduce the small-scale power slightly and optimize these maps for cluster finding, by @sriniraghunathan. @zonca do you suggest we do this here or merge without any scaling applied and document that step in a separate PR?

@zonca
Copy link
Member

zonca commented Oct 26, 2022

Thanks can you also specify which files I should copy over and in what target folder?

@zonca
Copy link
Member

zonca commented Oct 26, 2022

Can you also fix the codestyle errors so the unit tests can run?

pysm3/models/websky.py Outdated Show resolved Hide resolved
@zonca
Copy link
Member

zonca commented Oct 26, 2022

It's likely there will be some re-scaling of CIB in order to reduce the small-scale power slightly and optimize these maps for cluster finding, by @sriniraghunathan. @zonca do you suggest we do this here or merge without any scaling applied and document that step in a separate PR?

either way is fine

@xzackli
Copy link
Contributor Author

xzackli commented Oct 29, 2022

To get the maps, please copy the contents of for_nersc_www directory from my scratch to pysm-data/websky/0.4.

mkdir /global/project/projectdirs/cmb/www/pysm-data/websky
cp -r /global/cscratch1/sd/xzackli/for_nersc_www /global/project/projectdirs/cmb/www/pysm-data/websky/0.4

@xzackli
Copy link
Contributor Author

xzackli commented Oct 29, 2022

I added the CMB map from so_pysm_models but let me know if pysm3 has advanced past that for the purpose of lensing the map with the potential.

@zonca
Copy link
Member

zonca commented Oct 29, 2022

I added the CMB map from so_pysm_models but let me know if pysm3 has advanced past that for the purpose of lensing the map with the potential.

I always assumed that we want to use the same CMB parameters of Websky for consistency, so we are stuck with that CMB. However, should we reconsider? @xzackli @marcelo-alvarez, do you have a clear answer to this? or know who else we can ask?

@xzackli
Copy link
Contributor Author

xzackli commented Oct 31, 2022

To clarify, I was wondering if pysm3 now has the ability to lens a Gaussian unlensed CMB realisation with the websky potential. Anyway, for the purposes of this PR I think the existing CMB map is totally fine.

@marcelo-alvarez
Copy link

I added the CMB map from so_pysm_models but let me know if pysm3 has advanced past that for the purpose of lensing the map with the potential.

I always assumed that we want to use the same CMB parameters of Websky for consistency, so we are stuck with that CMB. However, should we reconsider? @xzackli @marcelo-alvarez, do you have a clear answer to this? or know who else we can ask?

I think it's fair to say we are stuck with some of the websky cosmo parameters, for consistency of lensing with the primary, but not necessarily stuck with the same realization of the primary or parameters whose variation doesn't significantly affect the lensing, such as the scalar to tensor ratio r.

@zonca
Copy link
Member

zonca commented Oct 31, 2022

To clarify, I was wondering if pysm3 now has the ability to lens a Gaussian unlensed CMB realisation with the websky potential. Anyway, for the purposes of this PR I think the existing CMB map is totally fine.

no, we don't have any lensing software inside PySM

@zonca
Copy link
Member

zonca commented Oct 31, 2022

I copied the input maps to the pysm-data area at NERSC:

https://portal.nersc.gov/project/cmb/pysm-data/websky/0.4/

@zonca
Copy link
Member

zonca commented Oct 31, 2022

here a Notebook on Gist (or Google Colab, see link at the top of the notebook) to test this branch: https://gist.github.com/zonca/3e1df26fa69d279ae4a9e05658d408a1#file-test-websky-cib-pysm-3-ipynb

@xzackli
Copy link
Contributor Author

xzackli commented Nov 2, 2022

This PR lacks tests, but I believe it is otherwise ready for merging. Adding tests in the form of a set of downgraded (nside 512) wouldn't be too difficult though, is that desirable?

@zonca
Copy link
Member

zonca commented Nov 2, 2022

thanks @xzackli I am working on importing the old tests, I can take care of that.
Could you please import the docs from so-pysm-models and make sure they are updated for 0.4?

@zonca
Copy link
Member

zonca commented Nov 2, 2022

also we need to create PySM names for the components, I think we can do:

  • cib1
  • rg1
  • ksz1
  • tsz1

For CMB:

  • c2: unlensed
  • c3: lensed
  • REMOVED c4: lensed with solar dip

@giuspugl
Copy link
Contributor

giuspugl commented Nov 2, 2022

thanks a lot for this PR!
i am a bit against c4, coadding multiple signals can be misleading for the user. perhaps it might be more useful to have a separated component dipole that can eventually be coadded to the other signals..
the other names are fine to me!

@xzackli
Copy link
Contributor Author

xzackli commented Nov 2, 2022

The names look good to me!

@marcelo-alvarez
Copy link

What is c1? I would have thought it was unlensed primary, i.e. the numbers start counting from one for each of the different flavors of each component.

@zonca
Copy link
Member

zonca commented Nov 2, 2022

What is c1? I would have thought it was unlensed primary, i.e. the numbers start counting from one for each of the different flavors of each component.

c1 is the PySM 2 CMB https://pysm3.readthedocs.io/en/latest/models.html#cmb

@marcelo-alvarez
Copy link

I see, thanks. I like this naming convention and it should be easy to document.

zonca added 4 commits November 2, 2022 15:22
Mistake in interpolation code, the weighting was exchanged,
so it would interpolate 17 GHz as 0.7 10 GHz and 0.3 20 GHz.
also make constructor explicit for usability
@zonca
Copy link
Member

zonca commented Nov 6, 2022

@xzackli the instrument model for S4 that I am using requires a map at 17.5 Ghz or below, could you please generate it for CIB and Radio Galaxies?

@xzackli
Copy link
Contributor Author

xzackli commented Nov 7, 2022

Yes, I'm going to add some of my favorite radio bands (S, C, X, etc)

"1.4", "2.7", "5", "10.7", "14.5", "17.5"

@xzackli
Copy link
Contributor Author

xzackli commented Nov 8, 2022

Quick update: CIB at these low freq bands is done, but I still need to do some radio abundance matching. I'll give a directory to copy once I'm set up.

@zonca zonca merged commit f40d05a into galsci:main Nov 8, 2022
@zonca
Copy link
Member

zonca commented Nov 8, 2022

thanks @xzackli
implementation is done so I merged the PR, please notify me when you have the data available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants