zblz / naima

Derivation of non-thermal particle distributions through MCMC spectral fitting
http://naima.readthedocs.io
BSD 3-Clause "New" or "Revised" License
45 stars 54 forks source link

Problem with plotting blobs #172

Closed ottaviofornieri closed 5 years ago

ottaviofornieri commented 5 years ago

Hi! I have a problem with plotting the metadata blobs, in particular I would like to get the energy of the parent distribution, We, but I get the following error: WARNING: plot_blob failed for $W_e$: only dimensionless scalar quantities can be converted to Python scalars [naima.analysis] so I am not able to save this result.

The command that computes the We is: *We = IC.compute_We(Eemin=1u.TeV)**

I am also getting it for a code found in the 'examples' page of the package.

Thanks a lot in advance for the help!

zblz commented 5 years ago

Hi @ottavio89-INFN, thanks for reporting the bug. Indeed, this was broken by new behaviour of astropy quantities. I've pushed a fix in #174 that should work for scalar blobs and model output that shares the energy values from the data but has incompatible units with the data flux.

ottaviofornieri commented 5 years ago

Thank you very much for answering me! But I am not sure to understand the meaning... Is the problem fixed so that I can reinstall naima, or there is some commands I have to add to the script? Please, use simple words, I am very new to this... :)

zblz commented 5 years ago

@ottavio89-INFN - The behaviour you reported was clearly a problem with the naima package itself. In the PR I linked I have implemented a fix for it. It has already been merged and released as version 0.8.3, so in order to fix the issue you just need to upgrade naima by doing:

pip install --upgrade naima
ottaviofornieri commented 5 years ago

Thanks a lot, it's all clear!