Skip to content
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

Problem connecting to a THREDDS OPeNDAP dataset #257

Closed
dolphins4all opened this issue May 1, 2024 · 6 comments
Closed

Problem connecting to a THREDDS OPeNDAP dataset #257

dolphins4all opened this issue May 1, 2024 · 6 comments

Comments

@dolphins4all
Copy link

Hi...I am unable to connect to the doppio ROMS dataset with the NCDatasets.jl package; however, I can connect using Python.

This is the catalog I am trying to access (OPeNDAP version):
https://tds.marine.rutgers.edu/thredds/roms/doppio/catalog.html?dataset=DopAnV3R3-ini2007_da_averages

In Julia, I have tried:

url = "https://tds.marine.rutgers.edu/thredds/dodsC/roms/doppio/DopAnV3R3-ini2007_da/avg"
ds = NCDataset(url)

and get this error:

Note:Caching=1
Error:curl error: SSL peer certificate or SSH remote key was not OK
curl error details: 
Warning:oc_open: Could not read url
ERROR: NetCDF error: Opening path https://tds.marine.rutgers.edu/thredds/dodsC/roms/doppio/DopAnV3R3-ini2007_da/avg: NetCDF: I/O failure (NetCDF error code: -68)
Stacktrace:
 [1] nc_open(path::String, mode::UInt16)
   @ NCDatasets ~/.julia/packages/NCDatasets/w3iru/src/netcdf_c.jl:274
 [2] NCDataset(filename::String, mode::String; format::Symbol, share::Bool, diskless::Bool, persist::Bool, memory::Nothing, attrib::Vector{Any})
   @ NCDatasets ~/.julia/packages/NCDatasets/w3iru/src/dataset.jl:205
 [3] NCDataset
   @ ~/.julia/packages/NCDatasets/w3iru/src/dataset.jl:165 [inlined]
 [4] NCDataset(filename::String)
   @ NCDatasets ~/.julia/packages/NCDatasets/w3iru/src/dataset.jl:165
 [5] top-level scope
   @ ~/Documents/research/roms/nc_doppio.jl:7

In python, the following works:

file = 'https://tds.marine.rutgers.edu/thredds/dodsC/roms/doppio/DopAnV3R3-ini2007_da/avg'
ds = xroms.open_netcdf(file)
ds, xgrid = xroms.roms_dataset(ds, include_cell_volume=True)
ds.xroms.set_grid(xgrid)

I thought it might be a problem with my system/curl/ssl setup, but would it work in python?

I'm using Linux Mint 21.1, Julia 1.9, python 3.10.10

Also, I wasn't sure if this was the right place to ask questions (versus file bug). Apologies if there is a better place to ask for help.

Thank you! --Robert

@ctroupin
Copy link
Collaborator

ctroupin commented May 1, 2024

Hello Robert,

I've tested on my laptop (Ubuntu 22.04, Julia 1.10.2 and NCDatasets v0.14.3), the file could be read:

julia> ds = NCDataset(url)
Dataset: https://tds.marine.rutgers.edu/thredds/dodsC/roms/doppio/DopAnV3R3-ini2007_da/avg
Group: /

Dimensions
   boundary = 4
   eta_psi = 105
   eta_rho = 106
   eta_u = 106
   eta_v = 105
   ocean_time = 6207
  ...

Which version of NCDatasets are you using?

@dolphins4all
Copy link
Author

I was using NCDatasets v0.14.0, which was what installed without specifying a version. Was this because I was using Julia 1.9?

I upgraded the package and specified v0.14.3 and it worked! Thank you very much!

Is this the right place to ask user questions about NCDatasets? Or are one of the julia forums a better place?

Thanks again - Robert

@ctroupin
Copy link
Collaborator

ctroupin commented May 2, 2024

I'm not really sure why it worked now...

Yes I think you can your questions here, it's easier for us to see, except if @Alexander-Barth prefers something else.

@ctroupin ctroupin closed this as completed May 2, 2024
@Alexander-Barth
Copy link
Member

When you file an issue next time, can you provide all information asked in the issue template? This is very helpful for us to find the issue quickly without too much guessing what could be the problem.

What would be important here is the output of using Pkg; Pkg.status(mode=PKGMODE_MANIFEST) to know the version of the package NetCDF_jll (the netcdf C library used by NCDatasets) as the error is raised in the C layer.
You might have an old version of NetCDF_jll.
You example works also for me using NCDatasets 0.14.4 and NetCDF_jll 400.902.211. You can upgrade NetCDF_jll using

]add NetCDF_jll@400.902.211

@dolphins4all
Copy link
Author

@Alexander-Barth @ctroupin Thank you for your help. I'll make sure to follow the template for issues.

Where is the best place to get help on usage when it is probably not a package issue? I'm not a physical oceanographer and my questions are more likely to be lack of experience with netcdf and roms.

Thanks!

@Alexander-Barth
Copy link
Member

You are welcome! For general help on julia would go here:
https://discourse.julialang.org/c/domain/geo/18

For help on ROMS:
https://www.myroms.org/forum/index.php

For NetCDF question, maybe here:
https://github.com/Unidata/netcdf-c/discussions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants