bwinkel / pycraf

pycraf is a package that provides functions and procedures for various tasks in spectrum-management compatibility studies.
35 stars 18 forks source link

Getting astropy.units.core.UnitsError when trying examples from bwinkel.github.io #33

Closed RB61 closed 4 years ago

RB61 commented 4 years ago

I followed instructions from https://bwinkel.github.io/pycraf/atm/ the process of installation went fine. The examples "Height profiles" and "Specific attenuation" worked well (some users may have to add "plt.show()" at the end of scripts to actually see something on the screen). I am having trouble getting example '"Total attenuation" to work. This is what I get:

File "pycraf_tst3.py", line 25, in freq_grid, elevation, obs_alt, profile, t_bg=2.73 * u.K File "/home/rachid/anaconda3/envs/my_env/lib/python3.7/site-packages/pycraf/utils/decorators.py", line 273, in wrapper target_unit.to_string() astropy.units.core.UnitsError: Argument 'elevation' to function 'atten_slant_annex1' must be in units convertible to 'deg'

Thanks for helping.

bwinkel commented 4 years ago

Hi @RB61, thanks a lot for your question. There seems to be an issue indeed with the manual. The atm sub-package was much improved a while ago, to make it faster. Unfortunately, there was a minor API change. The latest documentation shows how to use it.

That said, the changes were already made with release 1.0 and should obviously be reflected in the "stable" manual. Something must be wrong with the automatic generation of this. I'll look into it asap.

Again, thanks for letting us know.

RB61 commented 4 years ago

Hi @RB61, thanks a lot for your question. There seems to be an issue indeed with the manual. The atm sub-package was much improved a while ago, to make it faster. Unfortunately, there was a minor API change. The latest documentation shows how to use it.

That said, the changes were already made with release 1.0 and should obviously be reflected in the "stable" manual. Something must be wrong with the automatic generation of this. I'll look into it asap.

Again, thanks for letting us know.

The latest: https://bwinkel.github.io/pycraf/latest/atm/index.html#slant-path-through-layers-of-earth-s-atmosphere works perfectly Thanks a lot.

bwinkel commented 4 years ago

I fixed the problem with the generation of the HTML manual for stable releases.