I'm having trouble getting some pretty simple functions using AstronomicalData
to perform at anywhere near the speed I need them to.
For example, I have many places where I need to compute something like
ParametricPlot[
{AstronomicalData[
"Mercury", {"RightAscension",
DatePlus[Date[], d], {$GeoLocation[[1]] , $GeoLocation[[2]]}}], d},
{d, 0, 365}, AspectRatio -> 1/1.6]
but find that it takes far to long for even this simple fragment to run. I want to put several such fragments (e.g. one for each of several astronomical objects) into a single figure, and even to dynamically change the parameters for the figure (such as location and date) inside a Manipulate
, which would be prohibitively slow given the times I'm seeing with even the simple fragment above.
Why is AstronomicalData
so slow? Is there something I can do to speed it up so I can use it as I hope to?
Answer
Once can see by using Trace
that an apparently simple call is far more complex than you might imagine. Why it is designed this way, and if it needs to be, is an entirely different matter.
Be prepared to forcefully terminate Mathematica (or at least Quit[]
the kernel) and then run:
AstronomicalData["Mercury",
{"RightAscension", {2012, 10, 11, 12, 13, 14}, $GeoLocation}
] // TracePrint
A lot more going on behind the scenes than a simple database look-up, eh?
Comments
Post a Comment