Using sshfs as a URL string to open remote dataset over SSH #6043
Replies: 2 comments
-
Dear @scottstanie, I am facing the same issue. |
Beta Was this translation helpful? Give feedback.
-
I think the following can work based on your example: xr.open_dataset('ssh://my-remote-machine/path/to/data.nc') I also think it should work if using xr.open_dataset(fs.get_mapper('/path/to/data.nc')) Note that if instead of opening a netCDF file you want to open a Zarr file, then the following applies. xr.open_zarr(fs.get_mapper('/path/to/data.zarr') However, for Zarr 3:
from fsspec.implementations.asyn_wrapper import AsyncFileSystemWrapper
from zarr.storage import FsspecStore
afs = AsyncFileSystemWrapper(fs)
# FsspecStore expects an AsyncFileSystem
ds = xr.open_zarr(FsspecStore(afs, path='/path/to/data.zarr')) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I've just discovered that you can use https://github.com/fsspec/sshfs as follows to open a remote dataset over SSH:
My questions is: are the URL strings, like
"gcs://<bucket-name>/path.zarr"
, supported for thesshfs
protocol? I can't seem to make it work with different attempts likeBeta Was this translation helpful? Give feedback.
All reactions