Skip to content

Issues using ROMS readers over network drives (SSHFS/NIRD) #1753

@AndersOpdal

Description

@AndersOpdal

I have some challenges when trying to initialize OpenDrift readers for ROMS datasets (Norfjords 160m and NorKyst 800m) stored on a remote network drive (NIRD) mounted via SSHFS on a Windows machine. I have to the best of my abilities, and help from AI not managed to get this to work.

When using the standard initialization with a file pattern, Reader(path_to_files), I think the high latency of the SSHFS mount causes xr.open_mfdataset to struggle. I get the error ValueError: Could not find any dimension coordinates to use to order the datasets,

I tried to work around this by pre-loading the dataset manually using a different open_mfdataset configuration:

ds = xr.open_mfdataset(files, 
                       concat_dim='ocean_time', 
                       combine='nested', 
                       data_vars='minimal', 
                       coords='minimal', 
                       compat='override')

This works for creating an xarray Dataset. However, passing this ds object into OpenDrift readers does not work:

`reader_ROMS_native: `Even when passed a Dataset, the __init__ method seems to trigger a new open_mfdataset call on the underlying file paths, which brings back the network latency/ordering issue.

`reader_netCDF_CF_generic:` This reader correctly identifies the dataset as ROMS but then raises ValueError: 

ZeroDivisionError: When I try to strip the ROMS attributes to "trick" the CF reader, I get a `ZeroDivisionError` in `basereader/__init__.py `

Question

What is the recommended way to use OpenDrift readers over a network drive (NIRD) mounted via SSHFS on a Windows machine, or to use OpenDrift readers when the dataset is already opened as an xarray Dataset??

Is there a way to bypass the ROMS check in the generic reader, or a way to prevent the ROMS-native reader from re-scanning files when a Dataset is already provided?

Any help would be greatly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions