bwinkel / pycraf

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

RAS pattern returns NaN if used with do_bessel=True #2

Closed bwinkel closed 6 years ago

bwinkel commented 6 years ago

If one uses pycraf.antenna.ras_pattern with the do_bessel=True option, it returns NaN even if it shouldn't:

from astropy import units as u
from pycraf import antenna

phi = 0 * u.deg
diameter = 3 * u.m
wavelen = 21 * u.cm
antenna.ras_pattern(phi, diameter, wavelen, do_bessel=True)
.../antenna/ras.py:122: RuntimeWarning: invalid value encountered in true_divide
  gain[mask] = gmax[mask] + 20 * np.log10(j1(2 * tmp_x) / tmp_x)
<Decibel nan dB>

Thanks to C. Monstein for pointing this out.