to_netcdf adding unwanted information #9538
Unanswered
HelixPiano
asked this question in
Q&A
Replies: 2 comments
-
Maybe something like this:
but without a file for testing I can't be sure. Can you upload an example file here? |
Beta Was this translation helpful? Give feedback.
0 replies
-
@HelixPiano have you considered using ncdata to fix your file during save? The Rename a dimension in xarray output example demonstrates how this is possible, and you can do a lot more than just renaming dimensions 😊 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone,
I am currently struggling with the
to_netcdf
routine.I have several hundred different netcdf files and some of them contain an unwanted attribute.
Furthermore, the files are for different variables, so they might contain various attributes and coordinates.
I run somthing simple like:
My problem is that xarray starts adding new information to the file that were originally not there.
Excerpt of the original file:
And this is how it looks modified:
As you can see "_FillValue" was added to
time
andchar rotated pole
turned intochar roated_pole(string1)
as well as havingrotated poles:coordinates
added.It is important that everything else (except for the dropped variable) stays the same.
The documentation for
to_netcdf
mentions that I can remove the_FillValue
by setting it in the encoding to None, but this would require a full dictenory with the entire encoding of every variable; not to mention that there are differences between my files.Is there any simple way to do that, or do I have to ditch xarray for that one?
Beta Was this translation helpful? Give feedback.
All reactions