Skip to content

Does Xarray do lazy reads when opening netcdf from s3? #6404

Answered by rsignell-usgs
ianliu asked this question in Q&A
Discussion options

You must be logged in to vote

When you read NetCDF4 files (which are HDF5 files with certain conventions) from S3 using Xarray, only the metadata and coordinate variables are loaded eagerly, while the data variables are loaded lazily, just as if the NetCDF4 file were on a local filesystem.

Here's a Jupyter Notebook demonstrating opening a 25GB file from S3 in a few seconds, then reading data lazily.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@keewis
Comment options

@simlmx
Comment options

@keewis
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by andersy005
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants