Re: day or night [message #82636] |
Thu, 27 December 2012 08:06 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Gompie writes:
> I have more than 62000 points that are spread over different seasons and lat lons ,on which I have to apply the day/night test.
>
> Is it possible to map the lat lon onto the image coordinates of the image output of cgterminator or sunclock and get a number telling me if it is day or night at that point.
>
> PS:
> sunclock routine in the link you gave ( http://fermi.jhuapl.edu/s1r/idl/s1rlib/local_idl.html) looks promising if takes care of seasonal variations.
>
> If I use cgterminator, due to its problem with flip, I have visually inspect each of the 62000 points so practically not possible unless you give a way out.
Well, if there is a way out, you aren't going to get it
from me. I'm spending the day with the family celebrating
a late Christmas. I'm just say that IF there is an
answer, it will probably be found among the JHUAPL
time routines.
It is certainly possible to map lat/lon positions to
image coordinates. I find Value_Locate, used in conjunction
with projected XY values, to be invaluable for this purpose.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
Re: day or night [message #82637 is a reply to message #82636] |
Thu, 27 December 2012 04:03  |
Gompie
Messages: 76 Registered: August 2012
|
Member |
|
|
Hi David
Thanks !!!
I have more than 62000 points that are spread over different seasons and lat lons ,on which I have to apply the day/night test.
Is it possible to map the lat lon onto the image coordinates of the image output of cgterminator or sunclock and get a number telling me if it is day or night at that point.
PS:
sunclock routine in the link you gave ( http://fermi.jhuapl.edu/s1r/idl/s1rlib/local_idl.html) looks promising if takes care of seasonal variations.
If I use cgterminator, due to its problem with flip, I have visually inspect each of the 62000 points so practically not possible unless you give a way out.
Gompie
|
|
|
Re: day or night [message #82638 is a reply to message #82637] |
Wed, 26 December 2012 22:52  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
> On about line 240 or so you see a number of calls to the "time"
> functions of the Johns Hopkins University Applied Physics Lab.
> I feel 100 percent certain that the answer to this question
> is going to be found in the IDL routines that can be found
> there:
>
> http://fermi.jhuapl.edu/s1r/idl/s1rlib/local_idl.html
I'm trying to stay awake so I can pick up the kids at
the airport. Their flight has been delayed, so that they
don't arrive now until 2AM. :-(
Anyway, while I'm sitting here I thought it would be
a profitable use of time to go visit the JHUAPL time
routines again myself. Goodness. I'm always amazed
at how complicated the answer can be when you ask
a simple question like "what time is it?"
If, for some reason, you are up late, too, here are
a couple of my favorite articles on my web page
concerning "time":
http://www.idlcoyote.com/misc_tips/julianday.html
http://www.idlcoyote.com/misc_tips/julday.html
http://www.idlcoyote.com/code_tips/dayofyear.html
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
Re: day or night [message #82639 is a reply to message #82638] |
Wed, 26 December 2012 22:21  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Gompie writes:
> I know the lat lon and time of a place on earth. How do I know if it is day or night.
Well, that's a good question. For which I don't have
a off-the-top-of-my-head answer, although I'm sure the
astronomers will and I'm reasonably sure the answer
is going to involve converting the time to a Julian time.
What does come immediately to mind, of course, is
my cgTerminatorMap program, which has to do something
reasonable similar.
http://www.idlcoyote.com/idldoc/cg/cgterminatormap.html
On about line 240 or so you see a number of calls to the "time"
functions of the Johns Hopkins University Applied Physics Lab.
I feel 100 percent certain that the answer to this question
is going to be found in the IDL routines that can be found
there:
http://fermi.jhuapl.edu/s1r/idl/s1rlib/local_idl.html
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|