NCDatasets.jl: define values of dimensions

Dear all,
Using NCDatasets,

To write a data to netcdf, i can define the dimensions with this way:

ds = NCDataset("/tmp/","c")

However, is there any way to define the values of my dimensions ??

Like, defDim(ds,"lon",collect(-179.5:179.5))

Similar way is doing NetCDF.jl :


A relative solution (but not that i want) i found here how to define the dimension value? · Issue #90 · Alexander-Barth/NCDatasets.jl · GitHub .

The values of the dimensions can be defined by defining a proper variable (defVar) which has the same name as the dimension and values the values you need.

As the issue you linked says, it is

ds = Dataset("./","c")
defDim(ds, "lon", length(15:55))
v = defVar(ds, "lon", Float32, ("lon",))
v[:] = 15:55

By definition the CF standard doesn’t define dimensions with values, only with the length they have.