comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Day/Night Terminator on Map Projection
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Day/Night Terminator on Map Projection [message #48311] Fri, 07 April 2006 17:26 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Hi Folks,

Does anyone have IDL code for calculating the day/night
terminator on a map projection? Or perhaps an example of
a map in which you have done this?

If the code is not proprietary, maybe I'll write an article
about this. It can't be the first time someone has needed
such a thing. Direct graphics, is what has been requested of
me. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Day/Night Terminator on Map Projection [message #48347 is a reply to message #48311] Thu, 13 April 2006 16:15 Go to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Fri, 07 Apr 2006 18:26:15 -0600, David Fanning wrote:

> Hi Folks,
>
> Does anyone have IDL code for calculating the day/night
> terminator on a map projection? Or perhaps an example of
> a map in which you have done this?
>
> If the code is not proprietary, maybe I'll write an article
> about this. It can't be the first time someone has needed
> such a thing. Direct graphics, is what has been requested of
> me. :-)

I guess you saw this page too:

http://fermi.jhuapl.edu/s1r/idl/s1rlib/sphere/earth.html#sun clock

Those twilight bands are cool (usually defined as where the sun is 6, 12,
and 18 degrees below the horizon). You might have some fun adding those.

JD
Re: Day/Night Terminator on Map Projection [message #48363 is a reply to message #48311] Thu, 13 April 2006 08:20 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> You can see the code I came up with and a nice picture
> here:
>
> http://www.dfanning.com/map_tips/terminator.html
>
> To run the code, you will need to have both the Coyote
> Library and the JHUAPL Library on your IDL path.

Yikes! Matt Savoie just pointed out a very interesting
problem with the code on LINUX machines. It seems that
on LINUX (and possibly UNIX, I don't know) that issuing
a MAP_SET command changes the state of !P.MULTI. This
causes problems with TVIMAGE that I wasn't aware of.

Here is an IDL session on my LINUX box:

IDL> Print, !P.MULTI
0 0 0 0 0
IDL> Map_Set, /Cylindrical
IDL> Print, !P.MULTI
-1 0 0 0 0

An obvious workaround is to put a !P.MULTI=0 command
after every MAP_SET, but maybe there is something less
ugly than that available. I'll poke around a bit.

But in the meantime, I've put new code on my web page
that contains the workaround.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Day/Night Terminator on Map Projection [message #48365 is a reply to message #48311] Thu, 13 April 2006 05:10 Go to previous message
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
Thanks for sharing! Haje


"David Fanning" <davidf@dfanning.com> wrote in message
news:MPG.1ea796ded95b4343989c0c@news.frii.com...
> David Fanning writes:
>
>> Does anyone have IDL code for calculating the day/night
>> terminator on a map projection? Or perhaps an example of
>> a map in which you have done this?
>
> Thanks to Kelly Dean and Andrew Cool for suppling me
> with a few (slightly buggy!) examples of how to do this. :-)
>
> After spending most of the day scratching my head and
> pondering yet again the shear beauty of Ray Sterner's
> JHUAPL code, I finally came up with something I like.
>
> Rather than just drawing the day/night terminator, I wanted
> to see it in living color. So I used the AVHRR data set that
> comes in the IDL demo directory for this purpose. It makes
> a very pretty map, if I do say so myself!
>
> You can see the code I came up with and a nice picture
> here:
>
> http://www.dfanning.com/map_tips/terminator.html
>
> To run the code, you will need to have both the Coyote
> Library and the JHUAPL Library on your IDL path.
>
> I'll probably spend some time tomorrow making a little
> stand-alone application out of this with widgets so you
> can change the time interactively. It's more interesting
> than I would have thought to change the time and watch
> the sun and shadows move though the day and year. :-)
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Day/Night Terminator on Map Projection [message #48366 is a reply to message #48311] Wed, 12 April 2006 23:00 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> Does anyone have IDL code for calculating the day/night
> terminator on a map projection? Or perhaps an example of
> a map in which you have done this?

Thanks to Kelly Dean and Andrew Cool for suppling me
with a few (slightly buggy!) examples of how to do this. :-)

After spending most of the day scratching my head and
pondering yet again the shear beauty of Ray Sterner's
JHUAPL code, I finally came up with something I like.

Rather than just drawing the day/night terminator, I wanted
to see it in living color. So I used the AVHRR data set that
comes in the IDL demo directory for this purpose. It makes
a very pretty map, if I do say so myself!

You can see the code I came up with and a nice picture
here:

http://www.dfanning.com/map_tips/terminator.html

To run the code, you will need to have both the Coyote
Library and the JHUAPL Library on your IDL path.

I'll probably spend some time tomorrow making a little
stand-alone application out of this with widgets so you
can change the time interactively. It's more interesting
than I would have thought to change the time and watch
the sun and shadows move though the day and year. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Finding a value in a array efficiently
Next Topic: Re: Possible problem with GDL environment variables under Fedora 5

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 12:06:17 PDT 2025

Total time taken to generate the page: 0.04633 seconds