Exemplo n.º 1
0
        public string[] ReadStringArray(string variableName)
        {
            Variable variable = _file.findVariable(variableName);

            ucar.ma2.Array array1 = variable.read();

            int[]    shape = array1.getShape();
            string[] ret   = new string[shape[0]];

            for (int c = 0, arrayIndex = 0; c < ret.Length; c++)
            {
                StringBuilder sb = new StringBuilder(shape[1]);
                for (int d = 0; d < shape[1]; d++, arrayIndex++)
                {
                    sb.Append(array1.getChar(arrayIndex));
                }
                ret[c] = sb.ToString();
            }

            return(ret);
        }