Re: AstronomicalData and assumed geographic position
- To: mathgroup at smc.vnet.net
- Subject: [mg94192] Re: AstronomicalData and assumed geographic position
- From: jmbryant12 at gmail.com
- Date: Sat, 6 Dec 2008 19:57:47 -0500 (EST)
- References: <ghdmsj$fo7$1@smc.vnet.net>
Thanks for noticing the issue. There was indeed a problem with the non latitude/longitude specified form. I've narrowed this down and should have a fixed version by early next week if all goes well. The nice thing about these data functions is that they are not necessarily tied to a specific release and so problems like this can be fixed quickly. I'll need to get the fix implemented and rebuilt and should be able to get it tested early next week. Once approved, you should be able to re-evaluate in a fresh kernel and you'll get the fixed behavior. As for speed, the following takes just less than 8 seconds on my somewhat slow home machine: Plot[AstronomicalData[ "Sun", {"Altitude", {2008, 12, 5, h , 0, 0}, {40.11, -88.24}}], {h, 0, 23}] This is querying AstronomicalData 278 times, one for each sampling point in the graphic. One individual call takes only .031 seconds on my machine so that's pretty fast. Plot does automatic sampling of this call and results in more calls than you probably thought were being made. For example, by turning off recursion in the Plot, it now takes slightly over 1 second on my machine: Plot[AstronomicalData[ "Sun", {"Altitude", {2008, 12, 5, h , 0, 0}, {40.11, -88.24}}], {h, 0, 23}, MaxRecursion -> 0] I can speed it up further by reducing the default sampling rate which takes about .3 seconds on my machine. Plot[AstronomicalData[ "Sun", {"Altitude", {2008, 12, 5, h , 0, 0}, {40.11, -88.24}}], {h, 0, 23}, MaxRecursion -> 0, PlotPoints -> 10] Its not AstronomicalData that is slow, but what you are doing with it. Hope this helps. Thanks again, -Jeff Bryant Wolfram Research, Inc. On Dec 6, 5:15 am, "sjoerd.c.devr... at gmail.com" <sjoerd.c.devr... at gmail.com> wrote: > Hi folks, > > According to the documentation for AstronomicalData "The default > location on Earth to assume is given by the value of $GeoLocation." > > This means that > AstronomicalData["Sun",{"Altitude",{2008,12,5,13,0,0}] and > AstronomicalData["Sun",{"Altitude",{2008,12,5,13,0,0},$GeoLocation}] > > should yield the same results. In fact, they do not. > > Moreover, plotting one daily cycle with > > Plot[AstronomicalData[ "Sun", {"Altitude", {2008, 12, 5, h 0, 0}}], > {h, 0, 23}] suggests a completly static sun. > > Therefore, it seems that AstronomicalData without explicit lat,long > coordinates does not work properly. Or am I doing something wrong? > > By the way, it's a pity there is no built-in sun path function. Using > AstronomicalData to get the sun position is about 20 times slower than > using the VSB functions by Greg Pelletier (http://www.ecy.wa.gov/ > programs/eap/models/twilight.zip) that I converted to Mathematica > code. AstronomicalData seems to be less accurate as well, but that may > be due to differences in modelling of atmospheric refraction. > > Cheers -- Sjoerd