galsci / pysm

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

Problem with loading synchrotron models 's4', 's5' etc. #159

Closed fazlurahman closed 1 year ago

fazlurahman commented 1 year ago

I am finding difficulty in loading synchrotron models from 's4' onwards. I am using the following line of code,

sync_4 = pysm.Sky(nside=nside, preset_strings=['s4'])

Till 's3', it works well, but for 's4' the following error appears:

urllib.error.URLError: <urlopen error Unable to open any source! Exceptions were {'https://portal.nersc.gov/project/cmb/pysm-data/synch/synch_template_nside2048.fits': <HTTPError 404: 'Not Found'>, 'http://www.astropy.org/astropy-data/synch/synch_template_nside2048.fits': <HTTPError 404: 'Not Found'>}>

which says that it is not able to locate the file synch_template_nside2048.fits in the above nersc directory. When I open the directory, the synch template filenames are different, with some dates added to it.

Can you please look into this issue?

zonca commented 1 year ago

Are you using 3.4.0 beta8?

zonca commented 1 year ago

the template is now named differently: https://github.com/galsci/pysm/blob/main/pysm3/data/presets.cfg#L242

I made it on purpose to avoid people using a older version of the model by mistake. It should work once you update to 3.4.0b8

fazlurahman commented 1 year ago

I see, I was actually using 3.4.0b6.

Thanks for the info. Let me update to b8

fazlurahman commented 1 year ago

It's working. Thanks a lot @zonca

This may be a naive question, but how should I get updated with the latest version of pysm3? When I use pip install pysm3

or

conda install -c conda-forge pysm3

it is installing some older version. And I had to specify the name of the version (like, pip install --upgrade pysm3==3.4.0b8) to get the latest one. For this, I need to know which one is the latest version.

Is there any easy way to do this?

zonca commented 1 year ago

Use --pre

fazlurahman commented 1 year ago

Okay, great. It worked. Thanks a lot.