csobey / ionFR

A code that allows you to predict the ionospheric Faraday rotation for a specific line-of-sight, geographic location, and epoch
GNU General Public License v3.0
9 stars 9 forks source link

bug in ippcoor_v1.py #5

Open wcfiore opened 11 months ago

wcfiore commented 11 months ago

When running the suggested test command in the README (ionFRM.py 08h37m05.6s+06d10m14.5s 52d54m54.6sn 6d52m11.7se 2011-10-20T00:00:00 codg2930.11i), I get the following error:

Traceback (most recent call last):
  File "/Users/william/Software/ionFR/ionFRM.py", line 89, in <module>
    offLat,offLon,AzPunct,ZenPunct = ippcoor.PuncIonOffset(LatO,AzS,ZenS,AltIon)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/william/Software/ionFR/PunctureIonosphereCoord/ippcoor_v1.py", line 41, in PuncIonOffset
    if AzSou > pi:
               ^^
NameError: name 'pi' is not defined

It seems that in my current, relatively fresh install of python/scipy, from scipy import * does not import scipy.pi. This can be fixed by changing that line to from scipy import pi, since that is all that is needed from scipy here. This reveals a second bug in the same script, but all that is required is to also import math. The command works after I make those changes.