BiasCorrectQ.Program.AdjMonthlyBoundary C# (CSharp) Method

AdjMonthlyBoundary() private static method

private static AdjMonthlyBoundary ( List biasedFinal ) : void
biasedFinal List
return void
        private static void AdjMonthlyBoundary(List<Point> biasedFinal)
        {
            /* note: loop over (biasedFinal.Count - 1) is intentional to ignore
             * the last value in the list */
            for (int i = 0; i < biasedFinal.Count - 1; i++)
            {
            var pt = biasedFinal[i];
            if (pt.Date.Day == DateTime.DaysInMonth(pt.Date.Year, pt.Date.Month))
            {
                var ptNext = biasedFinal[i + 1];

                var val = pt.Value;
                var valNext = ptNext.Value;

                pt.Value = (3 * val + valNext) / 4;
                ptNext.Value = (val + 3 * valNext) / 4;
            }
            }
        }