Esempio n. 1
0
        public int GetDimensionLength(NetCdfDimension ncDimension)
        {
            IntPtr length;

            CheckResult(NetCdfWrapper.nc_inq_dimlen(id, ncDimension, out length));
            return(length.ToInt32());
        }
Esempio n. 2
0
        public int[] GetShape(NetCdfVariable ncVariable)
        {
            var dimIds = GetDimensionIds(ncVariable);
            var nDims  = dimIds.Length;
            var shape  = new int[nDims];

            for (int i = 0; i < nDims; ++i)
            {
                IntPtr len;
                CheckResult(NetCdfWrapper.nc_inq_dimlen(id, dimIds[i], out len));
                shape[i] = len.ToInt32();
            }

            return(shape);
        }