Ejemplo n.º 1
0
        public DataCube <float> GetTimeSeries(int segIndex, int rchIndex, int varid, DateTime start)
        {
            DataCube <float> ts = null;

            if (DataCube != null)
            {
                var        scaleFactor = ScaleFactor;
                var        index       = GetReachIndex(segIndex, rchIndex);
                var        vector      = DataCube.GetVector(varid, ":", index.ToString());
                DateTime[] dates       = new DateTime[DataCube.Size[1]];
                for (int t = 0; t < DataCube.Size[1]; t++)
                {
                    dates[t] = start.AddDays(t);
                }
                MatrixOperation.Mulitple(vector, (float)scaleFactor);
                ts = new DataCube <float>(vector, dates);
            }
            return(ts);
        }
Ejemplo n.º 2
0
        public DataCube <float> GetTimeSeries(int segIndex, int varid)
        {
            DataCube <float> ts = null;

            if (DataCube != null)
            {
                var        scaleFactor = ScaleFactor;
                var        vector      = DataCube.GetVector(varid, ":", segIndex.ToString());
                DateTime[] dates       = new DateTime[DataCube.Size[1]];
                for (int t = 0; t < DataCube.Size[1]; t++)
                {
                    dates[t] = DataCube.DateTimes[t];
                }
                MatrixOperation.Mulitple(vector, (float)scaleFactor);
                ts = new DataCube <float>(vector, dates);
                if (TimeUnits != Core.TimeUnits.Day)
                {
                    ts = TimeSeriesAnalyzer.Derieve(ts, NumericalDataType, TimeUnits);
                }
            }
            else if (DataCube != null)
            {
                var        scaleFactor = ScaleFactor;
                var        vector      = DataCube.GetVector(varid, ":", segIndex.ToString());
                DateTime[] dates       = new DateTime[DataCube.Size[1]];
                for (int t = 0; t < DataCube.Size[1]; t++)
                {
                    dates[t] = DataCube.DateTimes[t];
                }
                MatrixOperation.Mulitple(vector, (float)scaleFactor);
                ts = new DataCube <float>(vector, dates);
                if (TimeUnits != Core.TimeUnits.Day)
                {
                    ts = TimeSeriesAnalyzer.Derieve(ts, NumericalDataType, TimeUnits);
                }
            }
            return(ts);
        }