You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I received the following error when I tried to run the test example. I would appreciate it if someone could help me.
import igrf
mag = igrf.igrf('2010-07-12', glat=65, glon=-148, alt_km=100)
I received the error message :
TypeError: Using a DataArray object to construct a variable is ambiguous, please extract the data using the .data property.
The error was corrected after I re-installed igrf and run build() in Python.
However, I have to change the commands described in the documentation to make it work. I am running Linux.
after installation, run Python and
import igrf
igrf.base.build()
run the example
from igrf.base import igrf
mag = igrf ('2010-07-12', glat=65, glon=-148, alt_km=100)
I received the following error when I tried to run the test example. I would appreciate it if someone could help me.
import igrf
mag = igrf.igrf('2010-07-12', glat=65, glon=-148, alt_km=100)
I received the error message :
TypeError: Using a DataArray object to construct a variable is ambiguous, please extract the data using the .data property.
details:
Cell In[35], line 3
1 import igrf
----> 3 mag = igrf.igrf('2010-07-12', glat=65, glon=-148, alt_km=100)
File ~/miniconda3/lib/python3.8/site-packages/igrf/base.py:144, in igrf(time, glat, glon, alt_km, isv, itype)
131 mag = xarray.Dataset(
132 {
133 "north": ("alt_km", Bnorth),
(...)
139 attrs={"time": time, "isv": isv, "itype": itype, "glat": glat, "glon": glon},
140 )
142 decl, incl = mag_vector2incl_decl(mag.north, mag.east, mag.down)
--> 144 mag["incl"] = ("alt_km", incl)
145 mag["decl"] = ("alt_km", decl)
147 return mag
File ~/miniconda3/lib/python3.8/site-packages/xarray/core/variable.py:123, in as_variable(obj, name)
121 elif isinstance(obj, tuple):
122 if isinstance(obj[1], DataArray):
--> 123 raise TypeError(
124 "Using a DataArray object to construct a variable is"
125 " ambiguous, please extract the data using the .data property."
126 )
127 try:
128 obj = Variable(*obj)
TypeError: Using a DataArray object to construct a variable is ambiguous, please extract the data using the .data property.
The text was updated successfully, but these errors were encountered: