I'm attempting to download a daily ocean temperature reanalysis product (GLORYS2V4 from CMEMS) for the North Atlantic, but the only download option is FTP access with large (2GB) global files. Is it possible to use open_mfdataset on an FTP directory to take the subset I need without downloading all the data to my local machine? If so, how would I set up the path or url?
Currently I'm connecting to the FTP and then trying to give xarray the url, but it's interpreting the url as a path in my working directory. E.g. if I were trying to open just one file for January 1, 2000:
ftp = FTP("my.cmems-du.eu", username, password) sample_directory = '/Core/GLOBAL_REANALYSIS_PHY_001_031/global-reanalysis-phy-001-031-grepv2-daily/2000/01' ftp.cwd (sample_directory) ftp_path = 'ftp://my.cmems-du.eu/Core/GLOBAL_REANALYSIS_PHY_001_031/global-reanalysis-phy-001-031-grepv2-daily/2000/01/grepv2_daily_20000101.nc' ds = xr.open_dataset (ftp_path)
This yields a FileNotFoundError:
[Errno 2] No such file or directory: b'U:\\Documents\\conda_dir\\ftp:\\my.cmems-du.eu\\Core\\GLOBAL_REANALYSIS_PHY_001_031\\global-reanalysis-phy-001-031-grepv2-daily\\2000\\01\\grepv2_daily_20000101.nc' where 'U:\Documents\conda_dir' is my working directory.