Function Repository Resource:

SolarEclipseIcon

Source Notebook

Create a simple icon representing the appearance of a solar eclipse

Contributed by: Jeff Bryant

ResourceFunction["SolarEclipseIcon"][datespec, locationspec]

generates an icon of a solar eclipse for the specified date and location.

Details and Options

ResourceFunction["SolarEclipseIcon"] can generate an icon for any date and location on Earth.
The datespec can be a DateObject expression.
Locations can be specified as Entity objects, assuming they represent objects with geographic coordinates, or GeoPosition objects.
ResourceFunction["SolarEclipseIcon"] takes the same options as Graphics, with the following additions and changes:
ImageSize100the absolute size at which to render the graphic
"SunClipping"Truewhether to clip the region around the Sun

Examples

Basic Examples (3) 

Generate an icon of the next solar eclipse during the time of maximum global eclipse as observed from Champaign:

In[1]:=
ResourceFunction[
 "SolarEclipseIcon", ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"][SolarEclipse[DateObject[]], Entity["City", {"Champaign", "Illinois", "UnitedStates"}]]
Out[1]=

Generate an icon of the next solar eclipse during the time of maximum local eclipse as observed from Champaign:

In[2]:=
ResourceFunction[
 "SolarEclipseIcon", ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"][
 DateObject[{2024, 4, 8, 13, 5, 12.26024962997326`}, "Instant", "Gregorian", -6.`], Entity["City", {"Champaign", "Illinois", "UnitedStates"}]]
Out[2]=

See the result for a moment during the 2017 total eclipse:

In[3]:=
ResourceFunction[
 "SolarEclipseIcon", ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"][SolarEclipse[DateObject@{2017, 8}], Entity["City", {"Champaign", "Illinois", "UnitedStates"}]]
Out[3]=

Options (3) 

Background (1) 

Change the background color:

In[4]:=
ResourceFunction[
 "SolarEclipseIcon", ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"][
 DateObject[{2024, 4, 8, 13, 5, 12.26024962997326`}, "Instant", "Gregorian", -6.`], Entity["City", {"Champaign", "Illinois", "UnitedStates"}], Background -> Black]
Out[4]=

ImageSize (1) 

Change the size of the icon:

In[5]:=
ResourceFunction[
 "SolarEclipseIcon", ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"][SolarEclipse[DateObject[]], Entity["City", {"Champaign", "Illinois", "UnitedStates"}], ImageSize -> 300]
Out[5]=

SunClipping (1) 

Remove the clipping mechanism and expand the plot range to view the entire Moon:

In[6]:=
ResourceFunction[
 "SolarEclipseIcon", ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"][SolarEclipse[DateObject[]], Entity["City", {"Champaign", "Illinois", "UnitedStates"}], "SunClipping" -> False, PlotRange -> .01]
Out[6]=

Neat Examples (2) 

Generate a sequence of icons throughout an eclipse:

In[7]:=
GraphicsGrid[{ResourceFunction[
     "SolarEclipseIcon", ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"][#, Entity["City", {"Champaign", "Illinois", "UnitedStates"}]] & /@ {DateObject[{2024, 4, 8, 12, 5, 12.26024962997326`}, "Instant", "Gregorian", -6.`], DateObject[{2024, 4, 8, 12, 35, 12.26024962997326`}, "Instant", "Gregorian", -6.`], DateObject[{2024, 4, 8, 13, 5, 12.26024962997326`}, "Instant", "Gregorian", -6.`], DateObject[{2024, 4, 8, 13, 35, 12.26024962997326`}, "Instant", "Gregorian", -6.`], DateObject[{2024, 4, 8, 14, 5, 12.26024962997326`}, "Instant", "Gregorian", -6.`]}}]
Out[7]=

See an annular eclipse:

In[8]:=
ResourceFunction[
 "SolarEclipseIcon", ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"][
 DateObject[{1994, 5, 10, 11, 6, 27.`}, "Instant", "Gregorian", -6.`],
  Entity["City", {"Anderson", "Indiana", "UnitedStates"}]]
Out[8]=

Requirements

Wolfram Language 13.0 (December 2021) or above

Version History

  • 1.0.1 – 14 February 2024
  • 1.0.0 – 13 December 2023

Related Resources

License Information