space-physics / igrf

International Geomagnetic Reference Field IGRF13 in Python and Matlab
https://www.ngdc.noaa.gov/IAGA/vmod/
MIT License
66 stars 28 forks source link

installation failed #7

Closed cnsnln closed 3 years ago

cnsnln commented 3 years ago

I received an error with the message: TypeError: Using a DataArray object to construct a variable is ambiguous, please extract the data using the .data property.

How do I fix the error?

Chin Lin

buaa-luzhi commented 3 years ago

@cnsnln Did you solve it?

cnsnln commented 3 years ago

Not quite. I ran the example code using jupyter-lab. I received a syntax error, SyntaxError: expression cannot contain assignment, perhaps you meant "==". So I changed to the following codes, and got some outputs. However, the outputs disagree with those shown in the example. glat = 65 glon = -148 alt_km=100 mag=igrf.igrf('2017-07-12',glat,glon,alt_km) output Data variables: north (alt_km) float64 1.139e+04 east (alt_km) float64 3.589e+03 down (alt_km) float64 5.277e+04 total (alt_km) float64 5.411e+04 incl (alt_km) float64 77.25 decl (alt_km) float64 17.49

So, I think there are still some unresolved issues.

buaa-luzhi commented 3 years ago

thanks for your reply. Could you tell me how the code was modified. Thank again!

buaa-luzhi commented 3 years ago

I have solved the problem. pip install xarray==0.15.0

cnsnln commented 3 years ago

@buaa-luzhi Do you get the same answers as the given example? I pip install xarray==0.15.0. It runs, but its outputs are not the same as the example.

buaa-luzhi commented 3 years ago

@cnsnln is the same.

dasanaei commented 3 years ago

I had the same issue. xarray==0.15.0 solved it for me. I strongly suggest changing the requirements to specify the version of xarray during installation.

scivision commented 3 years ago

This was fixed in v13.0.1, thank you