       weather blog and ListStreamPlot sampling

• To: mathgroup at smc.vnet.net
• Subject: [mg96187] weather blog and ListStreamPlot sampling
• From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
• Date: Mon, 9 Feb 2009 05:31:48 -0500 (EST)

```Among the Wolfram blogs there is an interesting blog about WeatherData
(http://blog.wolfram.com/2009/01/13/visualizing-weather-patterns-in-
mathematica-7/#more-976).

I have been looking into one particular example, visualizing the wind
flow in Italy:

Show[Graphics[{GrayLevel[.7], CountryData["Italy", "Polygon"]}],
ListStreamPlot[
Table[{{x,
y}, -Through[{Sin, Cos}[
WeatherData[{y, x}, "WindDirection"] \[Degree]]]}, {x, 6, 18,
3}, {y, 36, 48, 3}]]]

I feel there is a small inaccuracy in this code, as it assumes that
the wind direction is obtained for the actual coordinates that the
Table function runs through.

Actually, WeatherData does not use these coordinates. Instead, it
takes data from weather stations that are closest to the provided
coordinates. If the stations were packed sufficiently densely together
this wouldn't be a problem but especially at sea larger deviations are
evident.

The following code shows the location errors as a vector plot:

Show[Graphics[{GrayLevel[.7], CountryData["Italy", "Polygon"]}],
ListVectorPlot[
Table[{{x, y}, {x, y} -
Reverse[WeatherData[{y, x}, "Coordinates"]]}, {x, 6, 18, 3}, {y,
36, 48, 3}], VectorPoints -> All]]

So, I thought I'd use the correct station positions as a basis for the
ListVectorPlot:

Show[Graphics[{GrayLevel[.7], CountryData["Italy", "Polygon"]}],
ListStreamPlot[
Table[{Reverse[
WeatherData[{y, x},
"Coordinates"]], -Through[{Sin, Cos}[
WeatherData[{y, x}, "WindDirection"] \[Degree]]]}, {x, 6, 18,
3}, {y, 36, 48, 3}]]]

Strangely, the original stream plot now turns in a set of disconnected
vector domains that has lost much of its appeal. This is strange as
the documentation shows that ListStreamPlot can handle irregular
spaced data (see under ListStreamPlot Scope/Sampling).

Any idea what's going on here?

Cheers -- Sjoerd

```

• Prev by Date: Re: How to simplify?
• Next by Date: Re: How to simplify?
• Previous by thread: Re: Problem importing HTML with Mathematica
• Next by thread: Re: weather blog and ListStreamPlot sampling