NetCDF cell boundaries following CF

I’m trying to visualise piecewise constant data written into a netcdf file. The CF convention, as I understand it, allows to specify piecewise constant data in a cell through cell boundary definitions. I believe I have built a correct netcdf cf-compliant file. However, the NetCDFReader appears to simply ignore the cell boundaries.

The grid topology and the data is all correct, but it is still represented as point data, and not as cell data.

I wonder if this is simply not supported by the reader (as suggested by this thread from 2017, or there is something wrong in my netcdf file (343.9 KB)

This may be related to this other post

Hi Daniel,

I have authored the second post you have linked. Not sure I am getting your question right, maybe not, but when plotting it, I can see the netcdf content all right:

Is this what you where looking for?

Marco,

Well, that’s what I render too. However, the idea would be that instead of having a vertex value at the cell centre (what renders in red in your pic), I would get a piece-wise constant cell value.
Basically obtain the behaviour that CELL_DATA achieves in VTK.

My point is that either the reader ignores de cell boundary information in the netcdf file (i.e., does not convert it to cell data), or I did not understand correctly how to inform the netcdf file (via CF-convention) of those cell bounds within which the data should be considered constant.

It’s nice to have some discussion about this issue.

Did you have a look at this?
https://www.kitware.com/a-new-embossing-representations-plugin-for-paraview/

The “Extrusion surface” is designed to work with cell data and behaves like a histogram. The cells are extruded based on their value in the selected array and a factor in the properties panel.

Histograms could be, to some extent, considered as piecewise constant cells. If this is till not what you are, the next step I could possibly think of, is pre-processing your data in xarray maybe?

Yeah, it’s nice discussing about this. Thanks for your feedback.

Yes, I recall already seeing this when I first was looking for a solution. But wouldn’t the issue still be that the original input data is read as point data?
My question in that sense, is whether the netCDF reader simply ignores the cell boundary definitions and will always treat the data in the arrays as point data on the cell vertices… if so, then, well, I need a new reader I guess :slight_smile: I really, really would like to see piece-wise constant data.