-
Notifications
You must be signed in to change notification settings - Fork 28
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
Reading OpenDAP #141
Comments
It should work like in python, but it requires the dap support to be included in the library linked (netcdf-c). It should be possible to force this by adding |
Hi @mulimoen
But now I get:
Any help is appreciated, |
Could you check if |
I fixed an incompatability for the static and dap features. Instead of the above, could you run |
That fixed it, thanks a lot! |
OK, I reopened because although it compiled, I'm still having one issue. This works in Python: from netCDF4 import Dataset
nc = Dataset("https://icdc.cen.uni-hamburg.de/thredds/dodsC/ftpthredds/hamtide/k1.hamtide11a.nc") But the same URL won't work with the Rust NetCDF API: use netcdf;
let url = "https://icdc.cen.uni-hamburg.de/thredds/dodsC/ftpthredds/hamtide/k1.hamtide11a.nc";
let nc = netcdf::open(&url.to_string());
dbg!(&nc); Results in:
Any ideas on how to fix this? |
Bit of a journey finding out what needed to be fixed here. The basic problem is curl not being able to find the certificate. The solution is to tell it where to find them. This functionality was fixed in |
New versions are up, you might want to update using |
Thanks for checking this, but unfortunately, even after doing netcdf = { version = "0.9.2", features = ["static", "ndarray"] }
netcdf-sys = { version = "0.6.2", features = ["dap", "static", "memio"] } I still get the same error:
|
Did you call |
Ah, that explains it! I added it and it worked as expected. Note: I did read #144 but I misunderstood that this call had been added as an explicit call inside the library. |
Happy to hear it works for you. I find it strange that the curl library does not use a sane default, I don't know what e.g. ncdump does to handle this. |
I found https://www.github.com/alexcrichton/curl-rust/pull/446 which describes why a default path is not set for the static build. |
Cool, thanks for the refs! I hid the call on my struct constructor and made it conditional for #[cfg(unix)] and if it's not already set. This should be sufficient for the time being. Rust is awesome! The fact that no one else had caught this means Rust is still growing, but the fact that it was fixed so quickly means it's growing fast! |
I want to apologize in advance if this is not the right place to ask, if I'm asking a "silly" question or if this question has been asked hundreds of times.
I have been porting all of my Python work into Rust with a considerably high degree of success.
Currently, when using netCDF4.Dataset in Python, one can directly open an DAP connection directly and just request the variables needed.
The netcdf docs for Rust mention the capability of opening a DAP connection directly, but I haven't seen examples, and I have tried doing it in Rust with no success. It seems like I'd need to download the netcdf files and open them locally. Is there a way to mimic the "streaming" behavior of the netCDF4.Dataset using georust/netcdf ?
Thanks again!
-J.
The text was updated successfully, but these errors were encountered: