Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes due to NaN with date "2011-01-01" #23

Open
petermao opened this issue Mar 28, 2022 · 0 comments
Open

Crashes due to NaN with date "2011-01-01" #23

petermao opened this issue Mar 28, 2022 · 0 comments

Comments

@petermao
Copy link

Traces to space-physics/geomagindices#5. Can this code be hardened against NaNs?

In [14]: m = msis.run("2011-01-01", (65,5,300), -49.5,69.5)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-14-4a12093822f8> in <module>
----> 1 m = msis.run("2011-01-01", (65,5,300), -49.5,69.5)

~/Library/Python/3.7/lib/python/site-packages/msise00/base.py in run(time, altkm, glat, glon, indices)
     62     # %% altitude 1-D
     63     if glat.size == 1 and glon.size == 1 and isinstance(time, (str, date, datetime, np.datetime64)):
---> 64         atmos = rungtd1d(time, altkm, glat.squeeze()[()], glon.squeeze()[()], indices)
     65     # %% lat/lon grid at 1 altitude
     66     else:

~/Library/Python/3.7/lib/python/site-packages/msise00/base.py in rungtd1d(time, altkm, glat, glon, indices)
    148     f107s = indices["f107s"]
    149     if not np.isfinite(f107s):
--> 150         raise ValueError("f107s is not finite.")
    151 
    152     f107s = indices["f107s"]

ValueError: f107s is not finite.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant