public TimeAxisAvgFacade(Array axis, ITimeAxisProjection timeAxisProjection, IWeightProvider weightsProvider, IDataCoverageEvaluator coverageEvaluator) : base(axis) { this.timeAxisProjection = timeAxisProjection; this.weightsProvider = weightsProvider; this.coverageEvaluator = coverageEvaluator; }
/// <summary> /// /// </summary> /// <param name="axis"></param> /// <param name="areBoundingValuesTheSame">Indicates that the first and the last elements of the the axis are the same point (as the axis is cycled along longated)</param> public CycledLonsAvgFacade(Array axis, IWeightProvider weightsProvider, IDataCoverageEvaluator coverageEvaluator, bool areBoundingValuesTheSame = false) { this.coverageEvaluator = coverageEvaluator; this.weightsProvider = weightsProvider; this.areBoundingValuesTheSame = areBoundingValuesTheSame; Type dataType = axis.GetType().GetElementType(); if (dataType == typeof(double)) { initialData = (double[])axis; } else if (dataType == typeof(float)) { initialData = ((float[])axis).Select(a => (double)a).ToArray(); } else { throw new ArgumentException("Aggregator only supports axis of double and float types"); } initialLen = initialData.Length; int extendedLength = initialLen * 3; if (areBoundingValuesTheSame) { extendedLength -= 2; } extendedGrid = new double[extendedLength]; Buffer.BlockCopy(initialData, 0, extendedGrid, 0, initialLen * sizeof(double)); int doubledLen = initialLen * 2; int offset = 0; if (areBoundingValuesTheSame) { doubledLen -= 2; offset = 1; } for (int i = 0; i < doubledLen; i++) { extendedGrid[initialLen + i] = extendedGrid[i + offset] + 360.0; } }
public TimeRegionsAxisAvgFacade(Array axis, ITimeAxisProjection timeAxisProjection, IWeightProvider weightsProvider, IDataCoverageEvaluator coverageEvaluator) : base(ConvertAxis(axis), timeAxisProjection, weightsProvider, coverageEvaluator) { }
public GridIntegratorFacade(Array axis, IWeightProvider weightsProvider, IDataCoverageEvaluator coverageEvaluator) : base(axis) { this.coverageEvaluator = coverageEvaluator; this.weightsProvider = weightsProvider; }