With following code I am trying to show the mean wind speed patterns for a few geographic locations.
cords = Select[
Reverse[CityData[#, "Coordinates"]] & /@ {"Oslo", "Vadso","Hammerfest"},
Head@# == List &
];
ListContourPlot[
Join @@ {#,List@WeatherData[#,
"MeanWindSpeed",
{{2013, 1, 25}, {2013, 5, 1}, "Day"}
][[1,2]]} & /@ cords
]
How can I improve the code to solve following problems:
Even if the requested date window is wider (a few days), it only takes one day data from
WeatherData
and when I am changing the partitioning part to[[All,2]]
the plot doesn't work and says the format it wrong.For even wider data range (a few years), there are some missing data for some days. How can I also filter that bad data in the code?
Remember, I need them exactly on the geographic location no matter how wide my data range is.
[[1,2]]
takes the first windspeed from every location. So, it doesn't help to increase the data range. 2.[[All,2]]
results in passing a list of windspeeds for every location toListContourPlot
. However,ListContourPlot
expects a single dependent value for each point not a list. How would you interpret that? You need to applyMean
on that list to get a single, average value. 3) You can deleteMissing[...]
data points usingDeleteCases
. $\endgroup$Join
andList
functionality thoroughly.I advanced the code considerably and knew theListContourPlot
better now but those problems are really hindering me of any progress. $\endgroup$ListContourPlot
to show on each location based on that set of windspeeds? You need a single color there. So, what should that depict? $\endgroup$Reverse
to get your coordinates. That's OK for plotting, but not for getting information from WeatherData, which expects latlong, not longlat. $\endgroup$