python4oceanographers

Turning ripples into waves

Is my dataset CF-compliant?

If you never heard about the Climate and Forecast (CF)) Metadata Conventions you are probably living under a rock deep down the Mariana Trench.

Now, hearing about it is one thing, claiming to fully understand it is another. First, it is under constant change, second, it seems to be more complex than the Brazilian constitution.

Still, CF-rules are a necessary evil. It allows us to create tools that will read any dataset in a standardize way. That is a big deal for climate scientists.

I won't get too technical here. I won't even mention the rules! To be honest, I do not know all most of them. But I do try to copy good examples from datasets similar to mine when I am saving my netcdf files.

But how to determine if a particular netcdf file is a good example of CF-compliance? There is a very promising project from the IOOS group, but it s not ready yet. In the meanwhile we have two alternatives. The first one is to try to load the data with iris, the second is running cdat's cfchecker.

Iris uses the Python Knowledge Engine PyKE to create a set of rules that enforces CF standards. But sometimes the error messages are not that helpful at all to understand what is wrong if the metadata. On the other hand, cfchecker returns a report that on the compliance itself, but requires to upload the dataset to test it using the online checker) to install [cdat] (https://pypi.python.org/pypi/cdat-lite/6.0rc2).

If you find that installing cdat is a challenge, do not fear! Appeal to conda and follow these instructions. You will get chchecker working in no time.

In [2]:
HTML(html)
Out[2]:

This post was written as an IPython notebook. It is available for download or as a static html.

Creative Commons License
python4oceanographers by Filipe Fernandes is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Based on a work at https://ocefpaf.github.io/.

Comments