-
Notifications
You must be signed in to change notification settings - Fork 57
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
How can i reslove this valueerror with MSIS model #154
Comments
How are you initializing "pt"? You could try something like:
(I haven't tested this code, but hopefully you get the idea) Let me know if you're still having problems and I'll look into it further. |
Hi @bharding512 Thank you again for your response. 1- First of all, Your code worked for me, but I didn't understand why we have to initialize "pt"and define ourselves indices to be able to have msis running. Thank you |
The philosophy with pyglow is that the top-level class is a "Point" and all the functions are called on that point. It's not meant to be a standalone MSIS wrapper, for example.
In theory, it's supposed to do that. But the sources of these indices have changed over the years, and pyglow is way behind on maintenance. See, for example, open issues #105 and #151. Pull requests are very welcome.
If you set user_ind=True, it won't overwrite the F10.7 or Ap before the MSIS call. |
Hi Everybody,
Please I would like to run msis model by executing the code below:
import numpy as np
from datetime import datetime, timedelta
import pyglow
lat = 31.37 #Morocco
lon = -7.5
alt = 250.
alts = np.arange(200,800,1)
dn_lt = datetime(2023, 11, 10, 0, 0)
pt.run_msis(version=2000)
I got this value error. How can i resolve this please?
ValueError Traceback (most recent call last)
Input In [10], in <cell line: 1>()
----> 1 pt.run_msis(version=2000)
File ~/.local/lib/python3.9/site-packages/pyglow/pyglow.py:273, in Point.run_msis(self, version)
266 """
267 Run the MSIS climatological model
268
269 :param version: Version of MSIS to run
270 """
272 # Run MSIS:
--> 273 self.msis.run(
274 self.location_time,
275 self.f107a,
276 self.f107p,
277 self.apmsis,
278 version=version,
279 )
281 # Assign output:
282 self.Tn_msis = self.msis.Tn
File ~/.local/lib/python3.9/site-packages/pyglow/msis.py:39, in MSIS.run(self, location_time, f107a, f107p, apmsis, version)
33 raise ValueError(
34 "Invalid version of '{}' for MSIS.\n".format(version) +
35 "2000 (default) is valid."
36 )
38 # Call MSIS:
---> 39 [d, t] = msis(
40 location_time.doy,
41 location_time.utc_sec,
42 location_time.alt,
43 location_time.lat,
44 np.mod(location_time.lon, 360),
45 location_time.slt_hour,
46 f107a,
47 f107p,
48 apmsis,
49 48,
50 )
52 # Neutral temperature:
53 self.Tn = t[1] # neutral temperature from MSIS (K)
ValueError: msis00py.msis00py.gtd7: failed to create array from the 9th argument
ap
-- 0-th dimension must be fixed to 7 but got 8The text was updated successfully, but these errors were encountered: