예제 #1
0
        // return values are in sun.arunodaya, sun.rise, sun.set, sun.noon, sun.length
        // if values are less than zero, that means, no sunrise, no sunset in that day
        //
        // brahma 1 = calculation at brahma muhurta begining
        // brahma 0 = calculation at sunrise



        public void SunCalc(GPGregorianTime vct, GPLocationProvider earth)
        {
            if (sunPosMethod == SUNPOSMETHOD_CALCULATOR)
            {
                GPSun s_rise = new GPSun();
                GPSun s_set  = new GPSun();

                // first calculation
                // for 12:00 universal time
                s_rise.calculateRise(vct, earth);

                // first calculation
                // for 12:00 universal time
                s_set.calculateSet(vct, earth);

                // calculate times
                longitude_arun_deg  = s_rise.eclipticalLongitude - (24.0 / 365.25);
                eclipticalLongitude = s_rise.eclipticalLongitude;
                rightAscession      = s_rise.rightAscession;
                longitude_set_deg   = s_set.eclipticalLongitude;

                sunrise_deg = s_rise.sunrise_deg;
                sunset_deg  = s_set.sunset_deg;
            }
            else
            {
                calculateRiseSet(vct, earth, 180);
                double gmt = vct.getJulianGreenwichNoon();

                longitude_arun_deg  = GPAstroEngine.sunLongitudeMethodM(julianDayRise - 96 / 1440.0);
                eclipticalLongitude = GPAstroEngine.sunLongitudeMethodM(julianDayRise);
                longitude_set_deg   = GPAstroEngine.sunLongitudeMethodM(julianDaySet);
            }

            updateSunriseTimes(vct, earth);
            updateNoonTimes(vct, earth);
            updateSetTimes(vct, earth);

            List <GPLocationChange> chr = earth.getChangesForJulianDay(arunodaya.getJulianGreenwichNoon());

            processTravellingChanges(chr);

            // finally calculate length of the daylight
            DayLength = (set.getJulianGreenwichTime() - rise.getJulianGreenwichTime()) * 24.0;
        }