Skip to content

Writing out a siphon'd xarray dataset as a netCDF #762

@ThomasMGeo

Description

@ThomasMGeo

Hello! I am trying to write out a netCDF file from a siphon'd xarray dataset. Writing out to Zarr works fine. This may be in the wrong spot (see image).

That is the input:

catUrl = "https://thredds.ucar.edu/thredds/catalog/grib/NCEP/GFS/Global_onedeg_ana/catalog.xml";
datasetName = "Full Collection Dataset";

catalog = TDSCatalog(catUrl)

ds2 = catalog.datasets[datasetName].remote_access(use_xarray=True)
print('ds is a:', type(ds2))

and writing it out:

# Write the second dataset (ds2) to NetCDF format and print the output path
ds2.to_netcdf(paths['ds2'])
print(f"Second dataset written to {paths['ds2']} in NetCDF format.")
  • Problem description: this should explain why the current behavior is a problem and why
    the expected output is a better solution.

I just wanted to write out a netCDF file, I didn't modify the file to my knowledge. Happier to share a more in depth workflow. The error I get is below:

RuntimeError: NetCDF: Name contains illegal characters

  • Which platform
    MacOS, python 3.10
  • Versions. Include the output of:

siphon version 0.9
8tg06w

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions