SunPosition

SunPosition[]
gives the position of the Sun for the current date and location.

SunPosition[datespec]
gives the position of the Sun for the specified date.

SunPosition[locationspec]
gives the positions of the Sun for the specified location.

SunPosition[locationspec,datespec]
gives the position of the Sun for the specified date and location.

SunPosition[{{location1,date1},{location2,date2},}]
gives the positions of the Sun for all specified locations on the specified dates.

SunPosition[locationspec,datespec,func]
uses func to determine what to return for extended locations.

Details and OptionsDetails and Options

  • SunPosition[] makes use of $GeoLocation and $TimeZone to determine your location and time zone.
  • The default form of the results is in the form .
  • Locations can be specified as Entity objects, assuming they represent objects with geographic coordinates, GeoGraphics primitives, or they can be latitude/longitude pairs, assuming degrees as units.
  • Dates can be specified as a DateObject or as a string that resolves to a date.
  • locationspec and datespec can be either individual items or lists of them.
  • If datespec is a list of dates, then the results will contain TimeSeries objects.
  • datespec can be specified as for compatibility with DateRange specifications.
  • Corrections for atmospheric refraction and light time delay are not included.
  • SunPosition[,func] is used to specify the format of output when locations are specified.
  • Possible settings for func include:
  • Automaticreturns intervals for extended locations only
    Intervalreturns intervals for all specified locations
    Meanreturns mean value for extended locations
    Minreturns minimum values for extended locations
    Maxreturns maximum values for extended locations
    StandardDeviationreturns standard deviation for extended locations
  • SunPosition[CelestialSystem->"Equatorial"] gives the right ascension and declination of the Sun.
  • SunPosition can accept the following options:
  • CelestialSystem"Horizon"whether to return azimuth/altitude or right ascension/declination
  • Possible settings for CelestialSystem include:
  • "Horizon"returns results as a pair of altitude/azimuth (alt/az) values
    "Equatorial"returns results as a pair of right ascension/declination (/) values

ExamplesExamplesopen allclose all

Basic Examples  (5)Basic Examples  (5)

Compute the current position of the Sun for your location:

In[1]:=
Click for copyable input
Out[1]=

Compute the position of the Sun for a specified date:

In[1]:=
Click for copyable input
Out[1]=

Compute the current position of the Sun for a specified location:

In[1]:=
Click for copyable input
Out[1]=

Compute the position of the Sun for a specified latitude/longitude and date:

In[1]:=
Click for copyable input
Out[1]=

Compute the position of the Sun for a specified city and date:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2014
(10.0)