sunrise by gegeshandong

VIEWS: 9 PAGES: 2

									Calculation of local times of sunrise, solar noon, and sunset based on the calculation procedure
              by NOAA (http://www.srrb.noaa.gov/highlights/sunrise/sunrise.html)

Input
latitude in decimal degrees (positive in northern hemisphere)                                34.000
longitude in decimal degrees (negative for western hemisphere)                               -78.000
year                                                                                         2002
month                                                                                        9
day                                                                                          21
time zone in hours relative to GMT/UTC (PST= -8, MST= -7, CST= -6, EST= -5)                  -5
daylight savings time (no= 0, yes= 1)                                                        1

Output (local time in days)
sunrise                                                                                      #NAME?
solar noon                                                                                   #NAME?
sunset                                                                                       #NAME?



   NOTE: Five functions are available for use from Excel worksheets:

     - sunrise(lat, lon, year, month, day, timezone, dlstime)
     - solarnoon(lat, lon, year, month, day, timezone, dlstime)
     - sunset(lat, lon, year, month, day, timezone, dlstime)
     - solarazimuth(lat, lon, year, month, day, hour, minute, second, timezone, dlstime)
     - solarelevation(lat, lon, year, month, day, hour, minute, second, timezone, dlstime)

   The sign convention for inputs to the functions named sunrise, solarnoon, sunset, solarazimuth,
   and solarelevation is:

     - positive latitude decimal degrees for northern hemisphere
     - negative longitude degrees for western hemisphere
     - negative time zone hours for western hemisphere

   The other functions in the VBA module use the original NOAA sign convention of positive
   longitude in the western hemisphere.

   The calculations in the NOAA Sunrise/Sunset and Solar Position Calculators are based on
   equations from Astronomical Algorithms, by Jean Meeus. NOAA also included atmospheric
   refraction effects. The sunrise and sunset results were reported by NOAA to be accurate to
   within +/- 1 minute for locations between +/- 72° latitude, and within ten minutes outside of those
   latitudes.

   This Excel VBA translation was tested for selected locations and found to provide results within
   +/- 1 minute of the original NOAA Javascript code.

   This VBA translation does not include calculation of prior or next susets for locations above the
   Arctic Circle and below the Antarctic Circle, when a sunrise or sunset does not occur.

   Translated from NOAA's Javascript to Excel VBA by:

   Greg Pelletier
   Olympia, WA
   e-mail: pelican@vei.net




                       eabd71c8-6f5c-4bc8-ad24-fc9ac09b68ac.xls, 12/7/2011
    Calculation of solar azimuth and elevation based on the calculation procedure by NOAA
                     (http://www.srrb.noaa.gov/highlights/sunrise/azel.html)

Input
latitude in decimal degrees (positive in northern hemisphere)                             47.600
longitude in decimal degrees (negative for western hemisphere)                            -122.317
year                                                                                      2001
month                                                                                     6
day                                                                                       21
hours                                                                                     13
minutes                                                                                   11
seconds                                                                                   0
time zone in hours relative to GMT/UTC (PST= -8, MST= -7, CST= -6, EST= -5)               -8
daylight savings time (no= 0, yes= 1)                                                     1

Output
solar azimuth (degrees clockwise from north)                                              #NAME?
solar elevation (degrees from horizon)                                                    #NAME?



   NOTE: Five functions are available for use from Excel worksheets:

     - sunrise(lat, lon, year, month, day, timezone, dlstime)
     - solarnoon(lat, lon, year, month, day, timezone, dlstime)
     - sunset(lat, lon, year, month, day, timezone, dlstime)
     - solarazimuth(lat, lon, year, month, day, hour, minute, second, timezone, dlstime)
     - solarelevation(lat, lon, year, month, day, hour, minute, second, timezone, dlstime)

   The sign convention for inputs to the functions named sunrise, solarnoon, sunset, solarazimuth,
   and solarelevation is:

     - positive latitude decimal degrees for northern hemisphere
     - negative longitude degrees for western hemisphere
     - negative time zone hours for western hemisphere

   The other functions in the VBA module use the original NOAA sign convention of positive
   longitude in the western hemisphere.

   The calculations in the NOAA Sunrise/Sunset and Solar Position Calculators are based on
   equations from Astronomical Algorithms, by Jean Meeus. NOAA also included atmospheric
   refraction effects. The sunrise and sunset results were reported by NOAA to be accurate to
   within +/- 1 minute for locations between +/- 72° latitude, and within ten minutes outside of those
   latitudes.

   This Excel VBA translation was tested for selected locations and found to provide results within
   +/- 1 minute of the original NOAA Javascript code.

   This VBA translation does not include calculation of prior or next susets for locations above the
   Arctic Circle and below the Antarctic Circle, when a sunrise or sunset does not occur.

   Translated from NOAA's Javascript to Excel VBA by:

   Greg Pelletier
   Olympia, WA
   e-mail: pelican@vei.net




                       eabd71c8-6f5c-4bc8-ad24-fc9ac09b68ac.xls, 12/7/2011

								
To top