Aborts all changes since the last time the dataset entered in define mode.
See also: netcdf_reDef.
Close the NetCDF file with the id ncid.
See also: netcdf_open.
(ncid,varid,name,ncid_out,varid_out)
¶Copies the attribute named old_name of the variable varid in the data set ncid to the variable varid_out in the data set ncid_out. To copy a global attribute use netcdf_getConstant("global") for varid or varid_out.
See also: netcdf_getAtt,netcdf_getConstant.
ncid =
netcdf_create(filename,mode) ¶Creates the file named filename in the mode mode which can have the following values: "clobber" (overwrite existing files), "noclobber" (prevent to overwrite existing files) "64bit_offset" (use the 64bit-offset format), "netcdf4" (use the NetCDF4, i.e. HDF5 format) or "share" (concurrent reading of the dataset). mode can also be the numeric value return by netcdf_getConstant. In the later-case it can be combined with a bitwise-or.
mode = bitor(netcdf.getConstant("classic_model"), ... netcdf.getConstant("netcdf4")); ncid = netcdf.create("test.nc",mode);
See also: netcdf_close.
dimid =
netcdf_defDim(ncid,name,len) ¶Define the dimension with the name name and the length len in the dataset ncid. The id of the dimension is returned.
See also: netcdf_defVar.
new_ncid =
netcdf_defGrp(ncid,name) ¶Define a group in a NetCDF file.
See also: netcdf_inqGrps.
varid =
netcdf_defVar(ncid,name,xtype,dimids) ¶Defines a variable with the name name in the dataset ncid. xtype can be "byte", "ubyte", "short", "ushort", "int", "uint", "int64", "uint64", "float", "double", "char" or the corresponding number as returned by netcdf_getConstant. The parameter dimids define the ids of the dimension. For scalar this parameter is the empty array ([]). The variable id is returned.
See also: netcdf_open,netcdf_defDim.
(ncid,varid,storage,chunkSizes)
¶Define the chunking settings of NetCDF variable varid. If storage is the string "chunked", the variable is stored by chunk of the size chunkSizes. If storage is the string "contiguous", the variable is stored in a contiguous way.
See also: netcdf_inqVarChunking.
(ncid,varid,shuffle,deflate,deflate_level)
¶Define the compression settings NetCDF variable varid. If deflate is true, then the variable is compressed. The compression level deflate_level is an integer between 0 (no compression) and 9 (maximum compression).
See also: netcdf_inqVarDeflate.
Define the fill-value settings of the NetCDF variable varid. If no_fill is false, then the values between no-contiguous writes are filled with the value fill_value. This is disabled by setting no_fill to true.
See also: netcdf_inqVarFill.
Defines the checksum settings of the variable with the id varid in the data set ncid. If checksum is the string "FLETCHER32", then fletcher32 checksums will be turned on for this variable. If checksum is "NOCHECKSUM", then checksums will be disabled.
See also: netcdf_defVar,netcdf_inqVarFletcher32.
varid =
netcdf_defVlen(ncid,typename,basetype) ¶Defines a NC_VLEN variable length array type with the type name typename and a base datatype of basetype in the dataset ncid. basetype can be "byte", "ubyte", "short", "ushort", "int", "uint", "int64", "uint64", "float", "double", "char" or the corresponding number as returned by netcdf_getConstant. The new data type id is returned.
See also: netcdf_open,netcdf_defVar, netcdf_inqVlen.
Deletes the attribute named name of the variable varid in the data set ncid. To delete a global attribute use netcdf_getConstant("global") for varid.
See also: netcdf_defAtt,netcdf_getConstant.
(ncid)
¶Leaves define-mode of NetCDF file ncid.
See also: netcdf_reDef.
data =
netcdf_getAtt (ncid,varid,name)
¶Get the value of a NetCDF attribute. This function returns the value of the attribute called name of the variable varid in the NetCDF file ncid. For global attributes varid can be netcdf_getConstant("global").
See also: netcdf_putAtt.
[size, nelems, preemption] =
netcdf_getChunkCache() ¶Gets the default chunk cache settings in the HDF5 library.
See also: netcdf_setChunkCache.
value =
netcdf_getConstant(name) ¶Returns the value of a NetCDF constant called name.
See also: netcdf_getConstantNames.
value =
netcdf_getConstantNames() ¶Returns a list of all constant names.
See also: netcdf_getConstant.
data =
netcdf_getVar (ncid,varid)
¶data =
netcdf_getVar (ncid,varid,start)
¶data =
netcdf_getVar (ncid,varid,start,count)
¶data =
netcdf_getVar (ncid,varid,start,count,stride)
¶Get the data from a NetCDF variable. The data data is loaded from the variable varid of the NetCDF file ncid. start is the start index of each dimension (0-based and defaults to a vector of zeros), count is the number of elements of to be written along each dimension (default all elements) and stride is the sampling interval.
See also: netcdf_putVar.
vers =
netcdf_inqLibVers() ¶Returns the version of the NetCDF library.
See also: netcdf_open.
name =
netcdf_inqAttName (ncid,varid,attnum)
¶Get the name of a NetCDF attribute. This function returns the name of the attribute with the id attnum of the variable varid in the NetCDF file ncid. For global attributes varid can be netcdf_getConstant("global").
See also: netcdf_inqAttName.
attnum =
netcdf_inqAttID(ncid,varid,attname) ¶Return the attribute id attnum of the attribute named attname of the variable varid in the dataset ncid. For global attributes varid can be netcdf_getConstant("global").
See also: netcdf_inqAttName.
name =
netcdf_inqAttName (ncid,varid,attnum)
¶Get the name of a NetCDF attribute. This function returns the name of the attribute with the id attnum of the variable varid in the NetCDF file ncid. For global attributes varid can be netcdf_getConstant("global").
See also: netcdf_inqAttName.
[name,length] =
netcdf_inqDim(ncid,dimid) ¶Returns the name and length of a NetCDF dimension.
See also: netcdf_inqDimID.
dimid =
netcdf_inqDimID(ncid,dimname) ¶Return the id of a NetCDF dimension.
See also: netcdf_inqDim.
dimids =
netcdf_inqDimID(ncid) ¶dimids =
netcdf_inqDimID(ncid,include_parents) ¶Return the dimension ids defined in a NetCDF file. If include_parents is 1, the dimension ids of the parent group are also returned. Per default this is not the case (include_parents is 0).
See also: netcdf_inqDim.
format =
netcdf_inqFormat(ncid) ¶Return the NetCDF format of the dataset ncid. Format might be one of the following "FORMAT_CLASSIC", "FORMAT_64BIT", "FORMAT_NETCDF4" or "FORMAT_NETCDF4_CLASSIC"
See also: netcdf_inq.
grp_ncid =
netcdf_inqGrpFullNcid(ncid,name) ¶Return the group id based on the full group name.
See also: netcdf_inqGrpName.
name =
netcdf_inqGrpName(ncid) ¶Return group name in a NetCDF file.
See also: netcdf_inqGrps.
name =
netcdf_inqGrpNameFull(ncid) ¶Return full name of group in NetCDF file.
See also: netcdf_inqGrpName.
parent_ncid =
netcdf_inqGrpParent(ncid) ¶Return id of the parent group
See also: netcdf_inqGrpName.
ncids =
netcdf_inqGrps(ncid) ¶Return all groups ids in a NetCDF file.
See also: netcdf_inqGrps.
vers =
netcdf_inqLibVers() ¶Returns the version of the NetCDF library.
See also: netcdf_open.
grp_ncid =
netcdf_inqNcid(ncid,name) ¶Return group id based on its name
See also: netcdf_inqGrpFullNcid.
unlimdimids =
netcdf_inqUnlimDims(ncid) ¶Return the id of all unlimited dimensions of the NetCDF file ncid.
See also: netcdf_inq.
[typename, bytesize, basetypeid, numfields, classid] =
netcdf_inqUserType(ncid,typeid) ¶Provide information on a user defined type typeid in the dataset ncid.
The function returns the typename, bytesize, base type id, number of fields and class identifier of the type.
See also: netcdf_open, netcdf_defVlen, netcdf_inqVlen.
[no_fill,fillvalue] =
netcdf_inqVarFill(ncid,varid) ¶Determines the fill-value settings of the NetCDF variable varid. If no_fill is false, then the values between no-contiguous writes are filled with the value fill_value. This is disabled by setting no_fill to true.
See also: netcdf_defVarFill.
[storage,chunkSizes] =
netcdf_inqVarChunking (ncid,varid)
¶Determines the chunking settings of NetCDF variable varid. If storage is the string "chunked", the variable is stored by chunk of the size chunkSizes. If storage is the string "contiguous", the variable is stored in a contiguous way.
See also: netcdf_defVarChunking.
[shuffle,deflate,deflate_level] =
netcdf_inqVarDeflate (ncid,varid)
¶Determines the compression settings NetCDF variable varid. If deflate is true, then the variable is compressed. The compression level deflate_level is an integer between 0 (no compression) and 9 (maximum compression).
See also: netcdf_defVarDeflate.
[no_fill,fillvalue] =
netcdf_inqVarFill(ncid,varid) ¶Determines the fill-value settings of the NetCDF variable varid. If no_fill is false, then the values between no-contiguous writes are filled with the value fill_value. This is disabled by setting no_fill to true.
See also: netcdf_defVarFill.
checksum =
netcdf_inqVarFletcher32(ncid,varid) ¶Determines the checksum settings of the variable with the id varid in the data set ncid. If fletcher32 checksums is turned on for this variable, then checksum is the string "FLETCHER32". Otherwise it is the string "NOCHECKSUM".
See also: netcdf_defVar,netcdf_inqVarFletcher32.
varid =
netcdf_inqVarID (ncid,name)
¶Return the id of a variable based on its name.
See also: netcdf_defVar,netcdf_inqVarIDs.
varids =
netcdf_inqVarID (ncid)
¶Return all variable ids. This functions returns all variable ids in a NetCDF file or NetCDF group.
See also: netcdf_inqVarID.
[typename, bytesize, basetypeid] =
netcdf_inqVlen(ncid,typeid) ¶Provide information on a NC_VLEN variable length array type typeid in the dataset ncid.
The function returns the typename, bytesize, and base type id.
See also: netcdf_open, netcdf_defVlen.
ncid =
netcdf_open(filename,mode) ¶Opens the file named filename in the mode mode.
See also: netcdf_close.
(ncid,varid,name,data)
¶Defines a NetCDF attribute. This function defines the attribute called name of the variable varid in the NetCDF file ncid. The value of the attribute will be data. For global attributes varid can be netcdf_getConstant("global").
See also: netcdf_getAtt.
(ncid,varid,data)
¶(ncid,varid,start,data)
¶(ncid,varid,start,count,data)
¶(ncid,varid,start,count,stride,data)
¶Put data in a NetCDF variable. The data data is stored in the variable varid of the NetCDF file ncid. start is the start index of each dimension (0-based and defaults to a vector of zeros), count is the number of elements of to be written along each dimension (default all elements) and stride is the sampling interval.
See also: netcdf_endDef.
(ncid)
¶Enter define-mode of NetCDF file ncid.
See also: netcdf_endDef.
Renames the attribute named old_name of the variable varid in the data set ncid. new_name is the new name of the attribute. To rename a global attribute use netcdf_getConstant("global") for varid.
See also: netcdf_copyAtt,netcdf_getConstant.
Renames the dimension with the id dimid in the data set ncid. name is the new name of the dimension.
See also: netcdf_defDim.
Renames the variable with the id varid in the data set ncid. name is the new name of the variable.
See also: netcdf_defVar.
nelems, preemption)
¶Sets the default chunk cache settings in the HDF5 library. The settings applies to all files which are subsequently opened or created.
See also: netcdf_getChunkCache.
old_format =
netcdf_setDefaultFormat(format) ¶Sets the default format of the NetCDF library and returns the previous default format (as a numeric value). format can be "format_classic", "format_64bit", "format_netcdf4" or "format_netcdf4_classic".
See also: netcdf_open.