8
$\begingroup$

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?

$\endgroup$
  • $\begingroup$ Have a look at AstronomicalData[]. $\endgroup$ – b.gates.you.know.what Nov 20 '12 at 13:53
  • 1
    $\begingroup$ @b.gatessucks I did, but it seems to provide only sunrise and sunset (and, I think, moonrise and set). $\endgroup$ – George Wolfe Nov 20 '12 at 14:03
  • $\begingroup$ @George Wolf nevermind, I guess there was a misunderstanding there. that's why I deleted my earlier comment ;) $\endgroup$ – einbandi Nov 20 '12 at 14:45
6
$\begingroup$
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}}}

$\endgroup$
  • $\begingroup$ Really? Just drop the "Results" from WolframAlphaResults? That's embarrassingly simple. I tried a lot of different things but somehow not that. Thanks. $\endgroup$ – George Wolfe Nov 20 '12 at 14:42
  • $\begingroup$ 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? $\endgroup$ – kglr Nov 20 '12 at 14:48
  • $\begingroup$ 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. $\endgroup$ – George Wolfe Nov 20 '12 at 15:28
4
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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