Closed chervias closed 4 years ago
can you update astropy
and numba
and check if you get still the same error?
also, please run inside IPython
or Jupyter Notebook
and run the debugger with %debug
, then print all the inputs to get_emission_numba
(use p variablename
)
I updated numba (version 0.51.2) and astropy (version 4.0.1.post1), and I still get the same error. I run in a Jupyter notebook, but I don't really know how to use the debug. I run %debug
after the error, and it let me print the values of the variables value
, tp
and tb
, which are the variables in the last function at the end of the error chain, but I cannot print the other variables up the error chain.
Use u and d to navigate down and up the stack. Or Google for using Python debugger pdb
ok thanks, that makes sense. These are all the inputs to get_emission_numba
. They seem to be fine.
ipdb> u
> /home/chervias/Software/anaconda3/envs/healpy/lib/python3.8/site-packages/pysm3/models/dust.py(99)get_emission()
97 freqs = utils.check_freq_input(freqs)
98 weights = utils.normalize_weights(freqs, weights)
---> 99 outputs = get_emission_numba(
100 freqs,
101 weights,
ipdb> p freqs
array([100.])
ipdb> p weights
array([1.])
ipdb> p self.I_ref.value
array([10.423211, 11.16924 , 12.853205, ..., 10.598779, 11.974686,
12.612513], dtype=float32)
ipdb> p self.Q_ref.value
array([ 0.04630192, -0.08084465, 0.25656074, ..., -0.0712268 ,
-0.20725448, -0.09635498], dtype=float32)
ipdb> p self.U_ref.value
array([-0.45459473, 0.19183296, -0.338591 , ..., -0.0786793 ,
-0.17652838, 0.3338661 ], dtype=float32)
ipdb> p self.freq_ref_I.value
545.0
ipdb> p self.freq_ref_P.value
353.0
ipdb> p self.mbb_index.value
array([1.5440001, 1.5506256, 1.5408113, ..., 1.5711942, 1.567093 ,
1.5721948], dtype=float32)
ipdb> self.mbb_temperature.value
array([22.504211, 23.154001, 23.610268, ..., 24.235737, 24.127972,
24.384308], dtype=float32)
ok, I can reproduce the issue, I'll work on a fix
ok thanks!
ok, I believe it is a bug in numba
, which I reported at https://github.com/numba/numba/issues/6228.
So you either downgrade numba
to 0.49.1
or install pysm from the master
branch as soon as I commit the fix.
I updated to the latest vesion 3.2.2, but I cannot run a model that includes dust. For example, if I run this example
import pysm3
import pysm3.units as u
import healpy as hp
import numpy as np
import warnings
warnings.filterwarnings("ignore")
sky = pysm3.Sky(nside=128, preset_strings=["d1", "s1"])
map_100GHz = sky.get_emission(100 * u.GHz)
I get this error