Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netCDF conversion issue #218

Open
tylere opened this issue Jan 23, 2025 · 2 comments
Open

netCDF conversion issue #218

tylere opened this issue Jan 23, 2025 · 2 comments
Assignees
Labels

Comments

@tylere
Copy link
Collaborator

tylere commented Jan 23, 2025

Discussed in #143

Originally posted by daviddkovacs February 15, 2024
Hi all,

I have successfully retrieved my dataset of interest in xarray.Dataset format, however I would like to export it to process it further locally. My isssue is that when I try to use the dataset.to_netcdf() function, I get the following error:

ValueError                                Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/xarray/backends/api.py](https://localhost:8080/#) in to_netcdf(dataset, path_or_file, mode, format, group, engine, encoding, unlimited_dims, compute, multifile, invalid_netcdf)
   1257         if isinstance(target, BytesIO):
-> 1258             store.sync()
   1259             return target.getvalue()

14 frames
ValueError: 1337 is not in list

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/scipy/io/_netcdf.py](https://localhost:8080/#) in _write_var_metadata(self, name)
    479         self._pack_int(len(var.dimensions))
    480         for dimname in var.dimensions:
--> 481             dimid = self._dims.index(dimname)
    482             self._pack_int(dimid)
    483 

ValueError: 1337 is not in list

Any help would be appreciated
Untitled

@tylere tylere added bug Something isn't working triage A new issue that needs to be triaged and removed bug Something isn't working labels Jan 23, 2025
@tylere
Copy link
Collaborator Author

tylere commented Jan 24, 2025

@daviddkovacs could you provide a Minimum Reproducible Example that demonstrates this issue, or let us know if this issue is obsolete?

@spatialthoughts
Copy link

I ran into this recently as well and this can be resolved by installing the netCDF4 Python package as suggested in #194

!pip install netCDF4

@naschmitz naschmitz self-assigned this Jan 28, 2025
@naschmitz naschmitz added P2 and removed triage A new issue that needs to be triaged labels Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants