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

Agora tSZ and kSZ in PySM #186

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pysm3/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
WebSkyCIB,
WebSkySZ,
WebSkyRadioGalaxies,
AgoraSZ
)
53 changes: 53 additions & 0 deletions pysm3/models/websky.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,3 +314,56 @@ def __init__(
max_nside=max_nside,
map_dist=map_dist,
)


class AgoraSZ(Model):
def __init__(
self,
nside,
sz_type="kinetic",
max_nside=None,
map_dist=None,
):

if max_nside is None:
if sz_type == "kinetic":
max_nside = 8192
if sz_type == "thermal":
max_nside = 8192
super().__init__(nside=nside, max_nside=max_nside, map_dist=map_dist)
self.sz_type = sz_type
# self.remote_data = utils.RemoteData()
# filename = self.remote_data.get(self.get_filename())
filename = self.get_filename()
self.m = self.read_map(filename, field=0, unit=u.uK_CMB)

def get_filename(self):
"""Get SZ filenames for an agora version"""

if self.sz_type == "kinetic":
path = "/Users/kristen/Documents/GitHub/ACT-Simulations/agora/agora_lkszNGbahamas80_nside8192_uk.fits"
elif self.sz_type == "thermal":
path = "/Users/kristen/Documents/GitHub/ACT-Simulations/agora/agora_ltszNGbahamas80_nside8192_uk.fits"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kmsurrao are those maps already available publicly? if not can you copy them to NERSC in a folder accessible by the cmb group?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, these maps are publicly available here under tSZ and kSZ in "Simulation Products"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kmsurrao I tried logging in both with my globus ID and with my NERSC account but get access denied.
Can you copy the maps to NERSC in a folder accessible to the cmb group?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kmsurrao also, are the units uK_CMB?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the maps are in uK_CMB. Hmm this is strange, I now get access denied too. I'll look into this and get back to you

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yuuki should confirm but i think the globus link is pointing either to UChicago / Argonne computers.


return str(path)

@u.quantity_input
def get_emission(self, freqs: u.GHz, weights=None) -> u.uK_RJ:

freqs = pysm.check_freq_input(freqs)
weights = pysm.normalize_weights(freqs, weights)

# input map is in uK_CMB, we multiply the weights which are
# in uK_RJ by the conversion factor of uK_CMB->uK_RJ
# this is the equivalent of
weights = (weights * u.uK_CMB).to_value(
u.uK_RJ, equivalencies=u.cmb_equivalencies(freqs * u.GHz)
)

is_thermal = self.sz_type == "thermal"
output = (
get_sz_emission_numba(freqs, weights, self.m.value, is_thermal) << u.uK_RJ
)

# the output of out is always 2D, (IQU, npix)
return output
Loading