Beispiel #1
0
        internal CsvVariableScalar(CsvDataSet dataSet, CsvColumn column)
            : base(dataSet, column)
        {
            if (column.Rank != 0)
            {
                throw new Exception("This is a scalar variable and is being created with different rank.");
            }

            data = new ArrayWrapper(0, typeof(DataType));            //new OrderedArray1d(typeof(DataType), false);

            Initialize();
        }
        internal CsvVariableMd(CsvDataSet dataSet, CsvColumn column)
            : base(dataSet, column)
        {
            if (column.Rank <= 2)
            {
                throw new Exception("This is multidimensional variable and is being created with different rank.");
            }

            data = new ArrayWrapper(column.Rank, typeof(DataType));

            Initialize();
        }
        internal CsvVariable(CsvDataSet dataSet, CsvColumn column)
            : base(dataSet, column.VariableName, column.Dims)
        {
            DisplayName  = column.Header;
            MissingValue = column.MissingValue;
            if (column.ID > 0)
            {
                this.ID = column.ID;
            }

            Metadata[CsvDataSet.CsvColumnKeyName] = column.Index;
        }
        internal CsvVariable(CsvDataSet dataSet, CsvColumn column)
            : base(dataSet, column.VariableName, column.Dims)
        {
            DisplayName = String.IsNullOrEmpty(column.Header) ? column.VariableName : column.Header;
            if (column.MissingValue != null || !column.Type.IsValueType)
            {
                MissingValue = column.MissingValue;
            }
            if (column.ID > 0)
            {
                this.ID = column.ID;
            }

            Metadata[CsvDataSet.CsvColumnKeyName] = column.Index;
        }