I'm working with large netcdf files (3D gridded atmospheric data) that live on a server in my department. And I'm having trouble importing them. I try something like this:
from netCDF4 import Dataset
filename = 'nfs://path-to-file/file.nc'
file = Dataset(filename)
This has worked perfectly fine for files stored within my root directory, but because the server exists behind/outside of my root, I get an error when I try to import the files into a jupyterlab notebook:
FileNotFoundError: [Errno 2] No such file or directory: b'nfs://path-to-file/file.nc'
But I copied the absolute path from finder (Mac OS) so I'm sure that it's there.
I've tried telling python to look in the server using
import sys
sys.path.insert(0, 'nfs://server-name/path-to-file/')
But that hasn't worked and gives the same error as above. Will I need to change something else using python's sys
or os
packages? The files are large so I don't want to copy them to my local machine.