Thanks Jeff!

That is just a perfect solution!!

arto

2009/8/24 Jeff Whitaker
Arto Oksanen wrote:
Thanks for your prompt reply. I should have given a more detailed explanation. I do know the solar position and then the latitude and longitude of the point on globe where the Sun is on the zenith. And as the sun illuminates always half of the globe, I just need to draw a "dark half globe" over the normal globe. Is this possible? That should be a lot simpler than drawing continents etc. :-)

arto

Arto:  Here's something  - is this what you're looking for?  It computes the day-night terminator, then shades one side of the terminator gray on  a map.

-Jeff

P.S.  I've cc-ed the matplotlib users list in case anyone else has ideas.

2009/8/24 Jeff Whitaker <jeffrey.s.whitaker@noaa.gov <mailto:jeffrey.s.whitaker@noaa.gov>>

Arto Oksanen wrote:

Hello from Finland!

I am writing an utility for quickly seeing where astronomical
events (like a GRB) are visible on Earth. I have installed
Basemap and it generates very nice Earth views, but I still need
to somehow display the day and night on the globe. Any sample
code somewhere or some pointers how to do this?

I am looking for something like this:
http://www.fourmilab.ch/cgi-bin/Earth?imgsize=320&opt=-l&lat=57.1667&ns=North&lon=49.125&ew=West&alt=372461&img=learth.evif
<http://www.fourmilab.ch/cgi-bin/Earth?imgsize=320&opt=-l&lat=57.1667&ns=North&lon=49.125&ew=West&alt=372461&img=learth.evif>
<http://www.fourmilab.ch/cgi-bin/Earth?imgsize=320&opt=-l&lat=57.1667&ns=North&lon=49.125&ew=West&alt=372461&img=learth.evif
<http://www.fourmilab.ch/cgi-bin/Earth?imgsize=320&opt=-l&lat=57.1667&ns=North&lon=49.125&ew=West&alt=372461&img=learth.evif>>

TIA!

arto

--        Arto Oksanen
arto.oksanen@jklsirius.fi <mailto:arto.oksanen@jklsirius.fi>
<mailto:arto.oksanen@jklsirius.fi
<mailto:arto.oksanen@jklsirius.fi>>
Muurame, Finland

Arto:  This might help:

http://en.wikipedia.org/wiki/Sunrise_equation

-Jeff

--
Arto Oksanen
arto.oksanen@jklsirius.fi <mailto:arto.oksanen@jklsirius.fi>
Muurame, Finland

--
Jeffrey S. Whitaker         Phone  : (303)497-6313
Meteorologist               FAX    : (303)497-6449
NOAA/OAR/PSD  R/PSD1        Email  : Jeffrey.S.Whitaker@noaa.gov
325 Broadway                Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web    : http://tinyurl.com/5telg

--
Arto Oksanen
arto.oksanen@jklsirius.fi
Muurame, Finland