Streams from Xarray?

From SO:

I was wondering if there was a way to stream data directly from a NetCDF file as it’s being written with xarray.

I think I can “create” a non-buffered file like this?

import io
ts_file_stream ="/some/file/being/written/", mode='rb', buffering=-1)

I also know that I can open this with Xarray:

import xarray as xr
ds = xr.open_dataset(ts_file_stream)

However, I am unsure if the arrays will then continually be updated? The purpose of this whole thing is as follows: I have a numerical model producing output, and I’d like to visualize some variables as the model runs to get a feeling for the current state. I know this is supported by the Holoviews people:

Would this require me to make my own stream with the streamz library?

Any hints on how to get that to work for netcdf would be wonderful!


1 Like

Did you make any progress on this? I’m facing a similar situation here.

1 Like