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

web sky issue in tsz simulations #182

Closed Debabrataadak closed 1 month ago

Debabrataadak commented 2 months ago

File "/anaconda3/lib/python3.7/site-packages/pysm3/sky.py", line 179, in get_emission output += comp.getemission(freq, weights=weights) File "/.local/lib/python3.7/site-packages/astropy/units/decorators.py", line 253, in wrapper return = wrapped_function(*func_args, **func_kwargs) File "/anaconda3/lib/python3.7/site-packages/pysm3/models/websky.py", line 264, in get_emission get_sz_emission_numba(freqs, weights, self.m.value, is_thermal) << u.uK_RJ TypeError: expected dtype object, got 'numpy.dtype[float32]'

zonca commented 2 months ago

Please provide minimal runnable code that produces this error.

Debabrataadak commented 2 months ago

import pysm3 import pysm3.units as u sky = pysm3.Sky(nside=128, preset_strings=["cib1", "tsz1"]) map= sky.get_emission(115.3 * u.GHz)

both CIB and SZ has returned same error...

p.s: I am seeing co maps are all zero values as well.

zonca commented 2 months ago

Just to make sure that it is not a problem with Python 3.7 please first try with a newer version of python.

Debabrataadak commented 2 months ago

thanks..yes problem resolved for tsz.

However, none of the co's can generate non-zero maps. Values at all pixels are all zero.

zonca commented 2 months ago

CO are line emissions, you need to specify the exact line frequency up to whatever decimals are in the code.

Debabrataadak commented 2 months ago

Can we simulate multiple realisations of CIB and SZ? I do not find to set seed of the realisation in these classes.

zonca commented 2 months ago

No

Debabrataadak commented 2 months ago

I was trying to simulate band-pass integrated maps of CIB.... sky = pysm3.Sky(nside=512, preset_strings=["cib1"]) map_100GHz_bandpass = sky.get_emission(x[1:]*u.GHz, y[1:])

got following warning with all zero values : /Users/debabrata/anaconda3/envs/py39/lib/python3.9/site-packages/pysm3/models/interpolating.py:103: UserWarning: Frequency not supported, requested 0.505515992641449 Ghz < lower bound 1.0 GHz warnings.warn(

map_100GHz_bandpass <Quantity [[0., 0., 0., ..., 0., 0., 0.], [0., 0., 0., ..., 0., 0., 0.], [0., 0., 0., ..., 0., 0., 0.]] uK_RJ>

zonca commented 1 month ago

Please provide minimal runnable code that produces this error.

Debabrataadak commented 1 month ago

sky = pysm3.Sky(nside=512, preset_strings=["cib1"]) map_100GHz_bandpass = sky.get_emission(x[1:]*u.GHz, y[1:])

x and y contains bandpass frequencies and corresponding bandpass response. map_100GHz_bandpass <Quantity [[0., 0., 0., ..., 0., 0., 0.], [0., 0., 0., ..., 0., 0., 0.], [0., 0., 0., ..., 0., 0., 0.]] uK_RJ>

zonca commented 1 month ago

How do I test without them? Please prepare the simplest x and y that show the problem and share an entirely runnable code I can paste and execute.

zonca commented 1 month ago

2 weeks without follow-up, closing. Please open another issue with a runnable code snippet if still need help