-
Notifications
You must be signed in to change notification settings - Fork 4
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
ArgumentError when loading variable #8
Comments
Small update: loading the values of that variable works fine: {:ok, variable} = NetCDF.Native.variable_values(file, "lon")
{:ok,
{[8.468606948852539, 8.481375694274902, 8.494144439697266, 8.506914138793945, 8.519682884216309,
8.532452583312988, 8.545222282409668, 8.557992935180664, 8.57076358795166, 8.583534240722656,
8.596304893493652, 8.609076499938965, 8.621847152709961, 8.63461971282959, 8.647391319274902,
8.660163879394531, 8.67293643951416, 8.685708999633789, 8.698481559753418, 8.711255073547363,
8.724028587341309, 8.736802101135254, 8.749576568603516, 8.762350082397461, 8.775124549865723,
8.7878999710083, 8.800674438476562, 8.81344985961914, 8.826225280761719, 8.839000701904297,
8.851777076721191, 8.864553451538086, 8.87732982635498, 8.890106201171875, 8.902883529663086,
8.91565990447998, 8.928437232971191, 8.941215515136719, 8.95399284362793, 8.966771125793457,
8.979549407958984, 8.992328643798828, 9.005106925964355, 9.0178861618042, 9.030665397644043,
9.043444633483887, 9.056224822998047, ...], :f32}} but loading the attributes raises the argument error: {:ok, variable} = NetCDF.Native.variable_attributes(file, "lon")
** (ArgumentError) argument error
(netcdf 0.2.2) NetCDF.Native.variable_attributes(%NetCDF.File{resource: #Reference<0.1547288168.4283564033.96725>, filename: "/Users/christoph/Projects/livebook/nowcast_202307030230.nc", variables: ["FX", "FF", "DD", "RR", "TT", "PT", "TD", "RH", "time", "y", "x", "lambert_conformal_conic", "lat", "lon"]}, "lon")
/Users/christoph/Projects/livebook/geosphere.livemd#cell:ghrbl4a23w2yw3n3wsxb7xqufg5jfwq7:3: (file) |
I could trace the error down to the netcdf/native/ex_netcdf/src/lib.rs Lines 169 to 174 in 44bb77b
As it seems the call to |
Oh, I found it: because there's no representation of NaN in BEAM, we can't map a |
I'm getting an ArgumentError when loading some variables from a NetCDF file:
Here's the
ncdump -h
of that file:I'm fairly new to Elixir (even newer to NIFs), but I'll try digging in to see what's happening here.
The text was updated successfully, but these errors were encountered: