3
$\begingroup$

When I explore the document of WeatherData of wolfram document center. It is said that WeatherData has properties of visibility. But when I doing it in mathematica, it seems can not get the value of different places.

In[5] := WeatherData["Singapore", "Visibility"]
Out[5] = Missing["NotAvailable"]
In[6] := WeatherData["Singapore", "Pressure"]
Out[6] = Quantity[1011, "Millibars"]
In[7] := WeatherData["Singapore", "Temperature"]
Out[7] = Quantity[30., "DegreesCelsius"]
In[8] := WeatherData["Shanghai", "Visibility"]
Out[8] = Missing["NotAvailable"]
In[9] := WeatherData["Beijing", "Visibility"]
Out[9] = Missing["NotAvailable"]
In[10]:= WeatherData["Beijing", "Temperature"]
Out[10] = Quantity[22., "DegreesCelsius"]
In[11] := WeatherData["NewYork", "Visibility"]
Out[11] = Missing["NotAvailable"]
In[12] := WeatherData["NewYork", "Temperature"]
Out[12] = Quantity[20., "DegreesCelsius"]

So the data of visibility seems to be missing for variable cities. Is it removed from the current version of Mathematica or can anyone get the visibility data of these cities?

I am using Mathematica version 10.0.1

WeatherData Documentation

$\endgroup$
5
$\begingroup$

Your problem appears to be that you asking for visibility data for the exact moment you are evaluating WeatherData and such data were not yet available. If you were to ask for historical data, say for this month, you would get results.

visibility = WeatherData["NewYork", "Visibility", {2015, 9}]

visibility

The above is hourly data from several stations in New York, so I reduce the data by selection the first midnight data point.

daily = 
  First /@ 
    Gather[Normal /@ Normal[visibility], Take[First[#1], 3] == Take[First[#2], 3] &]
{{{2015, 9, 1, 0, 0, 0.}, Quantity[16, "Kilometers"]}, 
 {{2015, 9, 2, 0, 0, 0.}, Quantity[16, "Kilometers"]}, 
 {{2015, 9, 3, 0, 0, 0.}, Quantity[16, "Kilometers"]}, 
 {{2015, 9, 4, 0, 51, 0.}, Quantity[16.093, "Kilometers"]}, 
 {{2015, 9, 5, 0, 0, 0.}, Quantity[16, "Kilometers"]}, 
 {{2015, 9, 6, 0, 51, 0.}, Quantity[16.093, "Kilometers"]}, 
 {{2015, 9, 7, 0, 0, 0.}, Quantity[16, "Kilometers"]}, 
 {{2015, 9, 8, 0, 0, 0.}, Quantity[16, "Kilometers"]}, 
 {{2015, 9, 9, 0, 0, 0.}, Quantity[16, "Kilometers"]}, 
 {{2015, 9, 10, 0, 0, 0.}, Quantity[16, "Kilometers"]}, 
 {{2015, 9, 11, 0, 0, 0.}, Quantity[12, "Kilometers"]}, 
 {{2015, 9, 12, 0, 0, 0.}, Quantity[16, "Kilometers"]}, 
 ...
 {{2015, 9, 19, 0, 0, 0.}, Quantity[16, "Kilometers"]},
 {{2015, 9, 20, 0, 3, 0.}, Missing["NotAvailable"]}, 
 {{2015, 9, 21, 0, 51, 0.}, Missing["NotAvailable"]}}

From this, except for the 11th, it looks like New York city had clear skies for September and that the data for 20th and 21st is not available yet.

$\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.