public double DailyIncomingRadiationIntensity(double lat, double lng, DateTime day, double cloudcover = 0.1)
        {
            mSunEarth.Latitude  = lat;
            mSunEarth.Longitude = lng;
            int hours = 24;

            double[] radis = new double[hours];

            for (int i = 0; i < hours; i++)
            {
                DateTime       dt = day.AddHours(i);
                SunCoordinates sc = mSunEarth.SunPostion(dt);
                if (sc.Azimuth > 0)
                {
                    radis[i] = 1366.2 * Math.Sin(sc.Azimuth * SunEarth.D2R) * (1 - 0.71 * cloudcover) * SkyAttenuation * 3600;
                }
            }
            return(radis.Sum());
        }
        public double[] HourlyIncomingRadiationIntensity(DateTime start, DateTime end, double cloudcover)
        {
            SunEarth se    = new SunEarth(Latitude, Longitude);
            TimeSpan ts    = end - start;
            int      hours = (int)ts.TotalHours;

            double[] radis = new double[hours];

            for (int i = 0; i < hours; i++)
            {
                DateTime       dt = start.AddHours(i);
                SunCoordinates sc = se.SunPostion(dt);
                if (sc.Azimuth > 0)
                {
                    radis[i] = 1366.2 * Math.Sin(sc.Azimuth * SunEarth.D2R) * (1 - 0.71 * cloudcover) * SkyAttenuation;
                }
            }
            return(radis);
        }
        public double[] HourlyIncomingRadiationIntensity(DateTime start, DateTime end, double[] cloudcovers)
        {
            SunEarth se    = new SunEarth(Latitude, Longitude);
            TimeSpan ts    = end - start;
            int      hours = (int)ts.TotalHours;

            double[] radis = new double[hours];

            if (cloudcovers.Length != hours)
            {
                throw new Exception("The number of cloud-cover values does not match with the hours");
            }

            for (int i = 0; i < hours; i++)
            {
                DateTime       dt = start.AddHours(i);
                SunCoordinates sc = se.SunPostion(dt);
                if (sc.Azimuth > 0)
                {
                    radis[i] = 1366.2 * Math.Sin(sc.Azimuth * SunEarth.D2R) * (1 - 0.71 * cloudcovers[i]) * SkyAttenuation;
                }
            }
            return(radis);
        }