Create a `Raster` from OPeNDAP (netCDF)

The netCDF library has a builtin capability of lazily reading data from an OPeNDAP server as the following code demonstrates. I was wondering how to tell Raster to do the same.

using NCDatasets: NCDataset
using Rasters

url = "" *
varname = "tmn"

#-- works ---
NCDataset(url) do ds

#-- works if you have the file --
rs = Raster(""; name = "slp")

#-- fails ---
rs = Raster(url; name = varname)

The first problem is there is no way to tell this is a NetCDF and you should use the NCDatasets.jl backend, as there is no .nc extension. So you need to use source=Rasters.NCDfile.

But then there is a check for if the file exists, and of course that fails.

What we should do is skip file checks if the path starts with http and similar.

Can you make a github issue for this?

1 Like