public int GetDimensionLength(NetCdfDimension ncDimension)
        {
            IntPtr length;

            CheckResult(NetCdfWrapper.nc_inq_dimlen(id, ncDimension, out length));
            return(length.ToInt32());
        }
        public string GetDimensionName(NetCdfDimension ncDimension)
        {
            var nameBuilder = new StringBuilder((int)NetCdfWrapper.Limits.NC_MAX_NAME);

            CheckResult(NetCdfWrapper.nc_inq_dimname(id, ncDimension, nameBuilder));
            return(nameBuilder.ToString());
        }
Exemple #3
0
 public string GetDimensionName(NetCdfDimension ncDimension)
 {
     var nameBuilder = new StringBuilder((int)NetCdfWrapper.Limits.NC_MAX_NAME);
     CheckResult(NetCdfWrapper.nc_inq_dimname(id, ncDimension, nameBuilder));
     return nameBuilder.ToString();
 }
Exemple #4
0
 public int GetDimensionLength(NetCdfDimension ncDimension)
 {
     IntPtr length;
     CheckResult(NetCdfWrapper.nc_inq_dimlen(id, ncDimension, out length));
     return length.ToInt32();
 }
Exemple #5
0
 public NetCdfVariable AddVariable(string varName, Type type, NetCdfDimension[] ncDimensions)
 {
     int varId;
     CheckResult(NetCdfWrapper.nc_def_var(id, varName, NetCdfWrapper.GetNetCdf3DataType(type), ncDimensions.Length,
                                          ncDimensions.Select(d => (int)d).ToArray(), out varId));
     var ncVar = new NetCdfVariable(varId);
     
     // variable name is unique here, guaranteed by nc_def_var call above
     ncVariableLookupByName.Add(varName, ncVar);
     return ncVar;
 }