inigodelportillo / ITU-Rpy

A python implementation of the ITU-R P. Recommendations for atmospheric attenuation modeling
http://itu-rpy.readthedocs.io/en/latest/index.html
MIT License
121 stars 163 forks source link

cannot run #54

Closed ianleework closed 3 years ago

ianleework commented 3 years ago

I have installed itur as instructions, but when I run examples, there are still a lot of warnings and errors. for example, I run import itur import numpy as np import matplotlib.pyplot as plt import astropy.units as u from astropy.units import imperial u.imperial.enable() f = 22.5 itur.u.GHz # Link frequency D = 1 itur.u.m # Size of the receiver antenna el = 60 # Elevation angle constant of 60 degrees p = 3 # Percentage of time that attenuation values are exceeded. Generate a regular grid latitude and longitude points with 1 degrees resolution lat, lon = itur.utils.regular_lat_lon_grid() Comute the atmospheric attenuation Att = itur.atmospheric_attenuation_slant_path(lat, lon, f, el, p, D) itur.utils.plot_in_map(Att.value, lat, lon, cbar_text='Atmospheric attenuation [dB]')

then I get:

itur\models\itu618.py:220: RuntimeWarning: invalid value encountered in sqrt np.sqrt(Lr * gammar) / f*2 - 0.45)) C:\Users\LENOVO\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\itur\models\itu618.py:242: RuntimeWarning: divide by zero encountered in log -(0.655 + 0.033 np.log(p) - 0.045 * np.log(A001) - Traceback (most recent call last): File "D:\test.py", line 18, in itur.utils.plot_in_map(Att.value, lat, lon, cbar_text='Atmospheric attenuation [dB]') AttributeError: module 'itur.utils' has no attribute 'plot_in_map'

inigodelportillo commented 3 years ago

Hi Ian,

Warnings are expected, so you shouldn't worry about that.

Regarding the plotting issue, we recently moved this from the utils module to the plotting package. The line below should work. I will be updating the documentation.

itur.plotting.plot_in_map(Att.value, lat, lon, cbar_text='Atmospheric attenuation [dB]')
inigodelportillo commented 3 years ago

I have updated the documentation appropriately. I will close this issue for now, but if try to run again and you find any issues, please, reopen it.