Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

If in a notebook you enter:

WolframAlphaResult["Sunrise june 25, 2013", {{"DaylightInformation", 1}, "ComputableData"},
                   PodStates -> {"DaylightInformation__More"}]  

you get:

{{"begin astronomical twilight","3:16 am EDT"},
{"begin nautical twilight","4:07 am EDT"},
{"begin civil twilight", "4:50 am EDT"},
{"sunrise","5:24 am EDT"}, 
{"sunset", "8:31 pm EDT"}, 
{"end civil twilight","9:05 pm EDT"},
{"end nautical twilight","9:48 pm EDT"}, 
{"end astronomical twilight","10:39 pm EDT"},
{"duration of daylight", {15, 8}}}  

as a result (I didn't know there was something called "nautical twilight," but now that I do, I want it). Unfortunately, the result is returned not as a nice list, but instead embedded in a complicated WolframAlphaResult format. Despite trying many different approaches, I have been unable to discover a way to get just a list of this data returned. It is possible?

share|improve this question
    
Have a look at AstronomicalData[]. –  b.gatessucks Nov 20 '12 at 13:53
1  
@b.gatessucks I did, but it seems to provide only sunrise and sunset (and, I think, moonrise and set). –  George Wolfe Nov 20 '12 at 14:03
    
@George Wolf nevermind, I guess there was a misunderstanding there. that's why I deleted my earlier comment ;) –  einbandi Nov 20 '12 at 14:45
add comment

2 Answers

up vote 4 down vote accepted
WolframAlpha["Sunrise june 25, 2013", {{"DaylightInformation", 1}, 
   "ComputableData"}, PodStates -> {"DaylightInformation__More"}]

gives

{{"begin astronomical twilight", "3:56 am PDT"}, {"begin nautical twilight", "4:40 am PDT"}, {"begin civil twilight", "5:18 am PDT"}, {"sunrise", "5:49 am PDT"}, {"sunset", "8:33 pm PDT"}, {"end civil twilight", "9:04 pm PDT"}, {"end nautical twilight", "9:43 pm PDT"}, {"end astronomical twilight", "10:26 pm PDT"}, {"duration of daylight", {14, 44}}}

share|improve this answer
    
Really? Just drop the "Results" from WolframAlphaResults? That's embarrassingly simple. I tried a lot of different things but somehow not that. Thanks. –  George Wolfe Nov 20 '12 at 14:42
    
Actually, your question is the first time I came across the function WolframAlphaResults, and I cannot find any information in the docs (Mma version 8.0.4 Windows) about it. How did you find this function? –  kguler Nov 20 '12 at 14:48
    
I expanded a wolfram alpha pod which displayed the extended twilight information. It contained the WolframAlphaResult[] function with the "DaylightInformation_More" PodState, and I copied it, not noticing the "Result" part added at the end. –  George Wolfe Nov 20 '12 at 15:28
    
Thank you, George. –  kguler Nov 20 '12 at 15:32
add comment

Oh, I was going to say the same thing. Here's a picture instead of me clicking in the little screw icon...

wolfram alpha

This pastes the query into your document (and runs it too):

WolframAlpha["Sunrise june 25, 2013", {{"DaylightInformation", 1}, 
  "ComputableData"}]

Then I assigned the results to a symbol for further processing.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.