Effacer les filtres
Effacer les filtres

How can I edit the _FillValue attribute in a NetCDF file.

8 vues (au cours des 30 derniers jours)
munsense
munsense le 28 Nov 2017
Commenté : Walter Roberson le 28 Nov 2017
When editing NetCDF files, ncwriteatt works for editing any attribute except for the _FillValue attribute. So how can I change the value of the _FillValue attribute in NetCDF files that have already been created?

Réponse acceptée

Guillaume Galibert
Guillaume Galibert le 28 Nov 2017
You will need to create a new variable with this new _FillValue, read the data from the original variable, update any value with FillValue with the new FillValue, store this data in your new variable and then you can delete the original variable.
  2 commentaires
munsense
munsense le 28 Nov 2017
Thanks
Walter Roberson
Walter Roberson le 28 Nov 2017
It seems to me that the actual fill value is stored in the data, so changing it requires that something scan the data and assign new values to the locations that currently have the fill value. netCDF files do not have a table of which values are valid or not with the fill value being substituted for the invalid values when the data is read: they just store the data handed to them and it is up to the program to compare the data read back to the fillvalue to determine which locations were valid.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by