ncdatasets

There functions were adapted from an old version of NCDatasets.jl

data and def modes

NetcdfIO.NCDatasetType
mutable struct NCDataset{TDS} <: CommonDataModel.AbstractDataset

Struct for a NetCDF dataset

Fields

  • parentdataset::Any: Parent dataset (nothing for the root dataset)

  • ncid::Int32: NetCDF dataset id

  • iswritable::Bool: Whether the NetCDF is writable

  • isdefmode::Ref{Bool}: Whether the NetCDF is in define mode (i.e. metadata can be added, but not data)

source
NetcdfIO.VariableType
struct Variable{T, N, TDS<:CommonDataModel.AbstractDataset} <: CommonDataModel.AbstractVariable{T, N}

Struct to represent a NetCDF variable

Fields

  • ds::CommonDataModel.AbstractDataset: Parent NetCDF dataset

  • varid::Int32: NetCDF variable id

  • dimids::NTuple{N, Int32} where N: NetCDF dimension ids

source
CommonDataModel.defVarFunction
defVar(ds::NCDataset,
       var_name::UnionNameTypes,
       var_type::DataType,
       var_attrib::UnionAttrTypes,
       dim_names::Vector{String};
       deflatelevel::Union{Int,Nothing} = nothing)

Create a new variable in the dataset, given

  • ds A netcdf dataset
  • name Name of the variable
  • vtype Type of the variable, for example Float64, Int32, String, etc.
  • attrib Variable attributes
  • dimnames Dimension names in the netcdf file
  • deflatelevel Compression level fro NetCDF, default is nothing
source