Skip to content

Convert in-memory cdflib.CDF into xarray? #312

@jphastings

Description

@jphastings

I can't figure out how to turn a CDF instance (eg. one read from s3, rather than a filename) into an xarray without copying the data into memory or onto disk, can anyone help?

  • I can see the xarray helper functions let me convert from a filename into an xarray
  • I can see that cdflib.CDF allows me to load a CDF directly from S3 (using the s3_read_method = 3 argument) to reduce memory & disk usage
  • cdflib.xarray.cdf_to_xarray doesn't accept S3 URIs like cdflib.CDF does

Am I missing something?

Would the maintainers appreciate me creating a PR which allows cdflib.xarray.cdf_to_xarray to accept a filename or a CDF instance: cdf_to_xarray(filename_or_cdf: str | CDF, ...?

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions